# đ yaml2bib: Convert YAML to BibTeX with Correct Journal Abbreviations Using Only DOIs đ
[](https://github.com/basnijholt/yaml2bib/blob/main/LICENSE) [](https://github.com/basnijholt/yaml2bib/actions?query=workflow%3Apytest) [](https://codecov.io/gh/basnijholt/yaml2bib) [](https://yaml2bib.readthedocs.io) [](https://pypi.org/project/yaml2bib/) [](https://pypi.org/project/yaml2bib/)
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
`bash
pip install yaml2bib
`
## đ Usage
### Command Line Tool
Check out the help message yaml2bib âhelp:
<!â CODE:BASH:START â>
<!â echo â`bash' -->
<!-- yaml2bib --help -->
<!-- echo '`â â>
<!â CODE:END â>
<!â OUTPUT:START â>
<!â â ď¸ This content is auto-generated by markdown-code-runner. â>
```bash
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.
<!â OUTPUT:END â>
Example invocation for Bas Nijholtâs [thesis](https://github.com/basnijholt/thesis):
âbib_fname âdissertation.bibâ âdois_yaml â/.yamlâ âreplacements_yaml âreplacements.yamlâ âstatic_bib âchapter_*/not_on_crossref.bibâ âemail âbas@nijho.ltâ
### Python Library
```python 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](https://github.com/basnijholt/yaml)
Convert with:
âbib_fname âexample.bibâ âdois_yaml âexample.yamlâ âreplacements_yaml âreplacements.yamlâ âstatic_bib ânot_on_crossref.bibâ âemail âbas@nijho.ltâ