This is a simple command line application to convert bibtex to json written in Rust and Python

Overview

bibtex-to-json

This is a simple command line application to convert bibtex to json written in Rust and Python.

Why?

To enable you to convert very big bibtex collections into a more comfortable format within seconds.

The program has two parts:

    1. A finite state machine to mark the start and end positions of the elements
    1. Parsing elements with the help of the marked position

The second part is done in parallel and uses all available threads. If a field in a bibtex entry contains latex code, then the content of the field is passed to pylatexenc (a latex interpreter for python). Thanks to Philippe Faist for this awesome python library. Each thread has its own instance of the python interpreter so that they do not block each other through the gil.

Prerequirements:

  • python3 and pip3
  • make
  • Cargo

How to compile:

make

How to run with example:

#run a small example
source .env/bin/activate && cargo run --release examples/single.bib single.json 

#Download a big example BibTeX file
curl -o ir-anthology.bib https://raw.githubusercontent.com/ir-anthology/ir-anthology-data/master/ir-anthology.bib
source .env/bin/activate && cargo run --release ir-anthology.bib ir-anthology.json 
# takes about 10 seconds on a Ryzen 7 5800U 

Output structure

The json is an array of dictionaries. Here is an example structure:

[
  {
    "bibkey": "this string contains the bibkey of the bibtex entry e.g. conf/ecit/Meier2000",
    "entry_type": "this string contains the typ eof the bibtex entry e.g. article or proceedings",
    "original": "the original string of this entry from the parsed bibtex file",
    "fields" : {
      "author" : "the fields dictionary contains all fields, e.g. the author field, a value here could be Max Mustermann",
      "editor" : "here are some more example fields",
      "year" : "2022",
      "pages" : "1--23"
    }
  }
]
You might also like...
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!
A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text!

uwuifyy A robust, customizable, blazingly-fast, efficient and easy-to-use command line application to uwu'ify your text! Logo Credits: Jade Nelson Tab

A tool crate to quickly build rust command line application.

Falsework A tool crate to quickly build rust command line application.

Command line application for searching
Command line application for searching

maven_search_rs Command line application for searching in https://search.maven.org Usage Non-interactive $ maven-search -f maven wicket-core The abov

A command line application which sets your wall paper with new image generating pollens once they arrive.

pollenwall Table of Contents pollenwall About Installation Binary releases Build from source Usage Command Line Arguments Running as a service MacOS L

omekasy is a command line application that converts alphanumeric characters in your input to various styles defined in Unicode.

omekasy is a command line application that converts alphanumeric characters in your input to various styles defined in Unicode. omekasy means "dress up" in Japanese.

Fast command-line application to show the moon phase

moon-phases Command-line application to show the moon phase for a given date and time, as a text string, emoji, or numeric value. It can also show the

CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.
CLI application to run clang-format on a set of files specified using globs in a JSON configuration file.

run_clang_format CLI application for running clang-format for an existing .clang-format file on a set of files, specified using globs in a .json confi

CLI application to run clang-tidy on a set of files specified using globs in a JSON configuration file.
CLI application to run clang-tidy on a set of files specified using globs in a JSON configuration file.

run-clang-tidy CLI application for running clang-tidy for an existing .clang-tidy file on a set of files, specified using globs in a .json configurati

Command-line HTTP client for sending a POST request to specified URI on each stdin line.

line2httppost Simple tool to read lines from stdin and post each line as separate POST request to a specified URL (TCP connection is reused though). G

Owner
null
hj is a command line tool to convert HTTP/1-style text into JSON

hj hj is a command line tool to convert HTTP/1-style text into JSON. This command is inspired by yusukebe/rj, which is a standalone HTTP client that s

FUJI Goro 10 Aug 21, 2022
Command line linguistic tools: display pronunciation, convert between regional norms of orthography

Command line linguistic tools: display pronunciation, convert between regional norms of orthography; support for multiple modern and ancient languages: English, Latin, Polish, Quechua, Tikuna

Piotr Bajdek 7 Nov 28, 2022
Command line tool to convert env variables beginning with user to a htpasswd file

envhtp This command line tool converts environment variables whose keys start with "user_" into htpasswd compatible username/password pairs. The goal

Florian Neumann 1 Apr 5, 2022
Small command-line tool to switch monitor inputs from command line

swmon Small command-line tool to switch monitor inputs from command line Installation git clone https://github.com/cr1901/swmon cargo install --path .

William D. Jones 5 Aug 20, 2022
A small command-line application to view images from the terminal written in Rust.

A small command-line application to view images from the terminal written in Rust. It is basically the front-end of viuer

Atanas Yankov 1.9k Jan 3, 2023
Functional command-line JSON processor

rq rq is a tiny functional language with which you can manipulate JSON. Basically, it is (an insignificant subset of!) jq, written in Rust. NOTE: This

Tony Zorman 13 Feb 10, 2024
Rust Imaging Library's Python binding: A performant and high-level image processing library for Python written in Rust

ril-py Rust Imaging Library for Python: Python bindings for ril, a performant and high-level image processing library written in Rust. What's this? Th

Cryptex 13 Dec 6, 2022
A Command-line tool to create, manage and deploy your python projects

PPM A Command-line tool to create, manage and deploy your python projects Table of Contents PPM Main Features Create a Project project.ini file Projec

FUSEN 6 Aug 30, 2022
Rust implementation of Python command line progress bar tool tqdm.

tqdm Rust implementation of Python command line progress bar tool tqdm. From original documentation: tqdm derives from the Arabic word taqaddum (تقدّم

Yiheng Du 8 Dec 7, 2022
Application microframework with command-line option parsing, configuration, error handling, logging, and shell interactions

Abscissa is a microframework for building Rust applications (either CLI tools or network/web services), aiming to provide a large number of features w

iqlusion 524 Dec 26, 2022