Giter VIP home page Giter VIP logo

bib2academic's Introduction

bib2academic

A simple tool to populate the "Publications" section of Hugo websites using the Academic theme using BibTeX files, written in Python 3.

Installation

Using virtual environments to manage Python installations is recommended. However, since this is a simple script requiring no installation, it can be run with the system Python without many issues. To do so:

  1. Clone the repository
git clone <this-repo-url> <your-installation-path> && cd <your-installation-path>
  1. Install the dependencies using Pip
  • If the default Python version on your system is still Python 2 (check by running python -V), the pip3 command should be used instead of pip.
  • The --user flag tells Pip to install the packages in the Python user directory, as opposed to the Python system directory.
pip3 install --user requirements.txt

Dependencies

  • bibtexparser does all the heavy lifting to interact with BibTeX files.
  • invoke http://www.pyinvoke.org/ is used to create the command-line interface and run external commands.
  • oyaml is a drop-in replacement for the yaml (PyYAML) module. It's used to keep the same order as the input data in the YAML output.

Python compatibility

bib2academic is compatible with Python 3.5 and up.

Usage

Beyond the general "populate the 'Publications' section of a Hugo Academic website from BibTeX files", the details of the specific use cases may vary significantly. For this reason, instead of trying to anticipate all of them and (over-)generalize this script's functionality and API, I decided to concentrate on my particular workflow, and leave the tool itself as a starting point to be adapted / modified by other users.

In the current incarnation, the tool in structured as follows:

  • bib2academic.py contains all base functionality and conversion logic
  • tasks.py is used to define the command-line interface with Invoke
  • settings.py contains all user-specific settings, including the ADDITIONS dictionary used to initialize the corresponding (optional) object storing collective-level updates to each entry.

Once the correct values are defined in settings.py, test that everything is working by calling invoke/inv:

# list all available Invoke tasks
inv --list

If you encounter errors at this point, it could be caused by an incompatible Python executable being used by invoke behind-the-scenes. A quick way to address this is to call invoke as a module from a specific Python executable, using the -m syntax:

python3 -m invoke --list

Once this works properly, run the desired task, along with any applicable command-line options, e.g.:

inv process --dry-run

bib2academic's People

Contributors

fndari avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.