xlcnd / isbnlib

python library to validate, clean, transform and get metadata of ISBN strings (for devs).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[QUESTION] Is it true that `meta` dictionary ALWAYS contains 'ISBN-13', 'Title', 'Authors', 'Publisher', 'Year', and 'Language' keys?

andrei-volkau opened this issue · comments

Let me please consider an example of metadata.

{'ISBN-13': '9783319069104',
  'Title': 'Introduction To Law',
  'Authors': ['Jaap Hage', 'Bram Akkermans'],
  'Publisher': 'Springer',
  'Year': '2014',
  'Language': 'en'}

Can I be sure that the meta dictionary will ALWAYS contain 'ISBN-13', 'Title', 'Authors', 'Publisher', 'Year', and 'Language' keys? I understand that a value might be empty.

Thank you in advance for the info!

commented

Yes, if you use isbnlib without plugins. This happens because the way metadata is built, not because is enforced!

No, if you use plugins. Most of the plugins follow isbnlib but not all.

NOTE I am considering making this structure mandatory in a future version.

commented

I am sorry, but this feature was implemented several versions ago...!

So the answer is YES you can assume that those keys exist in a metadata dictionary validated by stdmeta.