Skip to main content

Convert a yaml file containing (key -> DOI) pairs to bib file with the correct journal abbreviations.

Project description

yaml2bib: Convert a yaml file to bib file with the correct journal abbreviations using only DOIs

license tests codecov docs version PyPI - Python Version

Install

pip install yaml2bib

Usage

Use as command line tool

Usage: yaml2bib [OPTIONS]

Options:
  --bib_fname TEXT          Output file. (default: 'dissertation.bib')
  --dois_yaml TEXT          The `key: doi` YAML file, may contain wildcards
                            (*). (default: 'bib.yaml' ,example: '*/*.yaml')
  --replacements_yaml TEXT  Replacements to perform, might be None. (default:
                            None, example: 'replacements.yaml')
  --static_bib TEXT         Static bib entries, might be None, may contain
                            wildcards (*). (default: None, example:
                            'chapter_*/not_on_crossref.bib')
  --doi2bib_database TEXT   The doi2bib database folder 📁 to not query doi.org
                            more than needed. (default: 'yaml2bib-doi2bib.db')
  --crossref_database TEXT  The Crossref database folder 📁 to not query
                            crossref.org more than needed. (default:
                            'yaml2bib-doi2bib.db')
  --email TEXT              E-mail 📧 for crossref.org, such that one can make
                            more API calls without getting blocked. (default:
                            'anonymous', example: 'bas@nijho.lt')
  --help                    Show this message and exit.

Example invocation for my thesis:

yaml2bib \
  --bib_fname "dissertation.bib" \
  --dois_yaml "*/*.yaml" \
  --replacements_yaml "replacements.yaml" \
  --static_bib "chapter_*/not_on_crossref.bib" \
  --email "bas@nijho.lt"

or as a library:

from yaml2bib import yaml2bib

yaml2bib(
    bib_fname="dissertation.bib",
    dois_yaml="*/*.yaml",
    replacements_yaml="replacements.yaml",
    static_bib="chapter_*/not_on_crossref.bib",
    email="bas@nijho.lt",
)

License

MIT License

Contributions

  • Bas Nijholt

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

yaml2bib-0.1.2.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

yaml2bib-0.1.2-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file yaml2bib-0.1.2.tar.gz.

File metadata

  • Download URL: yaml2bib-0.1.2.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for yaml2bib-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5d32357470fe9f6ba3898a9d9e3a9ffb4fa5ed37e79953bc9e7d914ac16a9c71
MD5 a991a0aea08c01976f94b19f3bb8ec78
BLAKE2b-256 51ff8ec658d51ed9568ec651b2ae233cf4d66fc2470d732da11b13f9a0552936

See more details on using hashes here.

File details

Details for the file yaml2bib-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: yaml2bib-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.4

File hashes

Hashes for yaml2bib-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5dd1a5fcbf64437b3ad6a702e4e477f4109e95f9f56c77e2bc3bd21613085bec
MD5 909cd3f992a0664022c1cd6e233df384
BLAKE2b-256 cddc0a5bd0ce684f0524a05dd96d2457c4615214092ce59cf43467ff1a536c24

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page