Skip to main content

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

Project description

📘 yaml2bib: Convert YAML to BibTeX with Correct Journal Abbreviations Using Only DOIs 🚀

license tests codecov docs version PyPI - Python Version

Introducing 🌟 yaml2bib, an easy-to-use and powerful Python library and command-line tool that seamlessly converts YAML files to BibTeX format, all while maintaining the correct journal abbreviations using only DOIs! 🎉 Whether you're a researcher or a student, yaml2bib will simplify and streamline your bibliography management process. With an intuitive interface, customizable options, and compatibility as both a library and a command-line tool, it's never been more convenient to create and maintain your citation records. Say goodbye to manual conversions and hello to yaml2bib! 🚀

🛠️ Installation

pip install yaml2bib

🚀 Usage

Command Line Tool

Check out the help message yaml2bib --help:

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 Bas Nijholt's thesis:

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

Python 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",
)

🌟 Full Example

Check out the examples

Convert with:

yaml2bib \
  --bib_fname "example.bib" \
  --dois_yaml "example.yaml" \
  --replacements_yaml "replacements.yaml" \
  --static_bib "not_on_crossref.bib" \
  --email "bas@nijho.lt"

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.2.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yaml2bib-0.2.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: yaml2bib-0.2.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for yaml2bib-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ab70b0028929fc3f69dd6ada76cde627b8a3469e36628823b3bd92d673329c80
MD5 7cd3f33763c45a7e5af12aa7c0b67ae6
BLAKE2b-256 7a15605e9b343651ac46b026bb6d8e3dcf7ed030710a538dad124c5767c8a772

See more details on using hashes here.

Provenance

The following attestation bundles were made for yaml2bib-0.2.0.tar.gz:

Publisher: pythonpublish.yml on basnijholt/yaml2bib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: yaml2bib-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for yaml2bib-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cdbc5145ab9267e8406e0c83e36c2b8f8984c3ce208dc247cd85fb9c661dfcef
MD5 55099148547760d5ddcb54dd4f79fccf
BLAKE2b-256 f427c401771cc3b95cec286ae18cfe71519f08a58be1a0a15580578fc46cb29d

See more details on using hashes here.

Provenance

The following attestation bundles were made for yaml2bib-0.2.0-py3-none-any.whl:

Publisher: pythonpublish.yml on basnijholt/yaml2bib

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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