Page MenuHomeSoftware Heritage
Paste P381

deposit-client: metadata xml generated from new cli flags
ActivePublic

Authored by ardumont on Apr 16 2019, 5:06 PM.
$ ipython
Python 3.7.2+ (default, Feb 2 2019, 14:31:48)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import logging
In [2]: logging.basicConfig(level=logging.DEBUG)
In [3]: from swh.deposit.cli.deposit import generate_metadata_file; name = 'some-awesome-tool'; author0 = 'Antoine R. Dumont (@ardumont)'; author1 = 'Morane G.'; authors = [author1, author0]; path = generate_metadata_file(name, authors)
DEBUG:root:Temporary file: /tmp/swh.deposit.cli.m79wstvz
DEBUG:root:Metadata dict to generate as xml: {'entry': {'@xmlns': 'http://www.w3.org/2005/Atom', '@xmlns:codemeta': 'https://doi.org/10.5063/SCHEMA/CODEMETA-2.0', 'codemeta:name': 'some-awesome-tool', 'codemeta:author': [{'codemeta:name':
'Morane G.'}, {'codemeta:name': 'Antoine R. Dumont (@ardumont)'}]}}
DEBUG:root:Metadata dict as xml generated: <?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:codemeta="https://doi.org/10.5063/SCHEMA/CODEMETA-2.0">
<codemeta:name>some-awesome-tool</codemeta:name>
<codemeta:author>
<codemeta:name>Morane G.</codemeta:name>
</codemeta:author>
<codemeta:author>
<codemeta:name>Antoine R. Dumont (@ardumont)</codemeta:name>
</codemeta:author>
</entry>

Event Timeline

ardumont edited the content of this paste. (Show Details)
ardumont changed the title of this paste from metadata xml generated from new cli flags to deposit-client: metadata xml generated from new cli flags.Apr 16 2019, 5:16 PM
ardumont updated the paste's language from autodetect to python.