{"id":13441005,"url":"https://github.com/sciunto-org/python-bibtexparser","last_synced_at":"2025-05-13T19:18:04.678Z","repository":{"id":6229026,"uuid":"7460583","full_name":"sciunto-org/python-bibtexparser","owner":"sciunto-org","description":"Bibtex parser for Python 3","archived":false,"fork":false,"pushed_at":"2024-12-19T20:45:07.000Z","size":933,"stargazers_count":510,"open_issues_count":30,"forks_count":132,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-02T02:04:37.647Z","etag":null,"topics":["bibtex","bibtex-files","latex","python"],"latest_commit_sha":null,"homepage":"https://bibtexparser.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sciunto-org.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-01-05T22:07:21.000Z","updated_at":"2025-03-25T21:45:05.000Z","dependencies_parsed_at":"2023-02-19T16:55:31.667Z","dependency_job_id":"82e9976b-d8b6-43a7-a3f3-31660f373b80","html_url":"https://github.com/sciunto-org/python-bibtexparser","commit_stats":{"total_commits":591,"total_committers":56,"mean_commits":"10.553571428571429","dds":0.4686971235194586,"last_synced_commit":"214ef38eabd60538cc96349bc31d219897029f70"},"previous_names":[],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciunto-org%2Fpython-bibtexparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciunto-org%2Fpython-bibtexparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciunto-org%2Fpython-bibtexparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sciunto-org%2Fpython-bibtexparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sciunto-org","download_url":"https://codeload.github.com/sciunto-org/python-bibtexparser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247968274,"owners_count":21025821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bibtex","bibtex-files","latex","python"],"created_at":"2024-07-31T03:01:28.781Z","updated_at":"2025-04-09T03:05:25.695Z","avatar_url":"https://github.com/sciunto-org.png","language":"Python","readme":"# python-bibtexparser v2\n\nWelcome to python-bibtexparser, a parser for `.bib` files with a long history and wide adaption.\n\nBibtexparser is available in two versions: V1 and V2. For new projects, we recommend using v2 which, in the long run, will provide an overall more robust and faster experience. **For now, however, note that v2 is an early beta, and does not contain all features of v1**. Install v2 using pip:\n\n```bash\npip install bibtexparser --pre\n```\n\nOr you can install the latest development version directly from the main branch:\n```bash\npip install --no-cache-dir --force-reinstall git+https://github.com/sciunto-org/python-bibtexparser@main\n```\n\nIf instead, you want to use v1, install it using:\n\n```bash\npip install bibtexparser~=1.0\n```\n\nNote that all development and maintenance effort is focussed on v2.\nSmall PRs for v1 are still accepted, but only as long as they are backwards compatible and don't introduce much additional technical debt.\nDevelopment of version one happens on the dedicated [v1 branch](https://github.com/sciunto-org/python-bibtexparser/tree/v1).\n\nThe remainder of this README is specific to v2.\n\n## Documentation\nGo check out our documentation on [https://bibtexparser.readthedocs.io/en/main/](https://bibtexparser.readthedocs.io/en/main/).\n\n## Advantages of V2\n\n- :rocket: Order of magnitudes faster\n- :wrench: Easily customizable parsing **and** writing\n- :herb: Access to raw, unparsed bibtex.\n- :hankey: Fault-Tolerant: Able to parse files with syntax errors\n- :mahjong: Massively simplified, robuster handling of de- and encoding (special chars, ...).\n- :copyright: Permissive MIT license\n\n## TLDR Usage Example\n\n```python\n# Parsing a bibtex string with default values\nbib_database = bibtexparser.parse_string(bibtex_string)\n# Converting it back to a bibtex string, again with default values\nnew_bibtex_string = bibtexparser.write_string(bib_database)\n```\n\nSlightly more involved example:\n\n```python\n\n# Lets parse some bibtex string.\nbib_database = bibtexparser.parse_string(bibtex_string,\n    # Middleware layers to transform parsed entries.\n    # Here, we split multiple authors from each other and then extract first name, last name, ... for each\n    append_middleware=[SeparateCoAuthors(), SplitNameParts()],\n)\n\n# Here you have a `bib_database` with all parsed bibtex blocks.\n\n# Let's transform it back to a bibtex_string.\nnew_bibtex_string = bibtexparser.write_string(bib_database,\n    # Revert aboves transfomration\n    prepend_middleware=[MergeNameParts(), MergeCoAuthors()]\n)\n```\n\nThese examples really only show the bare minimum.\nConsult the documentation for a list of available middleware, parsing options and write-formatting options.\n\n## V2 Architecture and Terminology\n\n![bibtexparserv2](https://user-images.githubusercontent.com/4815944/193734283-f19f94e8-7986-4acf-b1a3-1d215e297224.png)\n\nThe architecture consists of the following components:\n\n#### Library\nReflects the contents of a parsed bibtex files, including all comments, entries, strings, preamples and their metadata (e.g. order).\n\n#### A Splitter\nSplits a bibtex string into basic blocks (Entry, String, Preamble, ...), with correspondingly split content (e.g. fields on Entry, key-value on String, ...).\nThe splitter aims to be forgiving when facing invalid bibtex: A line starting with a block definition (``@....``) ends the previous block, even if not yet every bracket is closed, failing the parsing of the previous block. Correspondingly, one block type is \"ParsingFailedBlock\".\n\n#### Middleware\nMiddleware layers transform a library and its blocks, for example by decoding latex special characters, interpolating string references, resoling crossreferences or re-ordering blocks. Thus, the choice of middleware allows to customize parsing and writing to ones specific usecase. Note: Middlewares, by default, no not mutate their input, but return a modified copy.\n\n#### Writer\nWrites the content of a bibtex library to a ``.bib`` file. Optional formatting parameters can be passed using a corresponding dedicated data structure.\n\n## About\n\nSince 2022, `bibtexparser` is primarily written and maintained by Michael Weiss ([@MiWeiss](https://github.com/MiWeiss/)). In 2024, Tom de Geus ([@tdegeus](https://github.com/tdegeus)) joined as co-maintainer.\n\nCredits and thanks to the many contributors who helped creating this library, including\nFrançois Boulogne ([@sciunto](https://github.com/sciunto/), creator of the first version) and Olivier Mangin ([@omangin](https://github.com/omangin/), long-term contributor).\n","funding_links":[],"categories":["HarmonyOS","Python","License"],"sub_categories":["Windows Manager","Journal and Conference Papers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciunto-org%2Fpython-bibtexparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsciunto-org%2Fpython-bibtexparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsciunto-org%2Fpython-bibtexparser/lists"}