Skip to content

Define Metadata #7

Closed
Closed

Description

@jdcaballerov

You chose to Pascalize meta key names. The documentation doesn't require it. It just happens to be the case (ahah) for currently defined ones but as stated there, it's extendable. @kelson42 ?
related, it seems that get_metadata only returns those predefined keys while ZimCreator allows setting any. Confusing.
Yes it's correct, maybe we can put there only the mandatory metadata. Any metadata can be accessed getting an article by url

Yes, let's harmonize to only manage official ones this way and have the article mechanism for the rest ; if @kelson42 and @mgautierfr agrees.

Activity

  1. jdcaballerov commented on Apr 10, 2020

    @jdcaballerov
    ContributorAuthor

    Currently get_metadata will only return mandatory_metadata with pascalized keys

    Commit:
    9cb954b

  2. mgautierfr commented on Apr 14, 2020

    @mgautierfr
    Contributor

    A user can put whatever metadata it needs in zim file.
    However, we've defined a set of metadata to put in the zim file to be fully compliant (and metadata a zim reader can assume to be present). (https://www.openzim.org/wiki/Metadata)

    The wrapper may check that the mandatory metadata are provided and warn (error?) the user if somes are missing.
    But it should not limit the metadata to the ones defined.

    Any metadata can be accessed getting an article by url

    Technically yes. However I would prefer to have a specific function for that :

    def get_metadata(self, metadata_name):
        # get_article('M', metadata_name) (or equivalent)
    

    We plan to do something like that in libzim and disallow the user to get the metadata as a simple article.

  3. jdcaballerov commented on Apr 17, 2020

    @jdcaballerov
    ContributorAuthor

    @mgautierfr your answer clarifies from the read side. Now from the write side, since now we require article implementations should I left that to the user ? To implement their own metadata article to be added ?

    Warn the user when ?

  4. mgautierfr commented on Apr 17, 2020

    @mgautierfr
    Contributor

    I would do a specific API also on the writer side. The (not so long) plan it to totally hide the namespace from the user perspective.
    So the creator could have a specific set of function to define the metadata.

    The mandatory can have a specific method: (set_name(), set_title(), ...) and have a generic method add_metadata(name, value) for other metadata.

  5. jdcaballerov commented on Apr 25, 2020

    @jdcaballerov
    ContributorAuthor

    Mandatory metadata is checked and returned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions