Skip to main content

Python tools to work with JabRef libraries

Project description

ppf.jabref

ppf.jabref provides a python interface to JabRef SQL databases. It maps database relations to python classes using SQLAlchemy. Also, ppf.jabref provides tools to parse the data stored inside the database tables.

Using ppf.jabref

ppf.jabref relies on SQLAlchemy for database access. All that ppf.jabref adds to this is a data model which makes sqlalchemy understand how a JabRef database is structured (by providing classes Entry and Field).

A simple example that queries all entries and prints a selection of the fields looks like this:

    from sqlalchemy import create_engine
    from sqlalchemy.orm import sessionmaker
    from ppf.jabref import Entry, File

    engine = create_engine('<your connection string here>', echo=False)
    Session = sessionmaker(bind=engine)
    session = Session()

    q = session.query(Entry)
    for entry in q:
        print(entry.fields['author'], '\t',
            entry.fields['title'], '\t',
            entry.fields['year'], '\t', end='')

        files = File.from_string(entry.fields['file'])
        for i in range(len(files)):
            f = files[i]
            print(f.path, '\t', end='')

The first 6 lines are setup code to import required packages and to set up the database connection. The query then uses ppf.jabref's Entry class to obtain all Entries (=references) in the JabRef database. The for-loop shows how to access fields and uses the File class to find out where the documents linked to this entry are stored.

Installation

ppf.jabref is available via pypi:

pip install ppf.jabref

Change Log

  • 0.1.2: Fix problem with versioning
  • 0.1.1: Fix sqlalchemy deprecation warning, docstrings
  • 0.1.0: Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

ppf_jabref-0.1.2-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file ppf_jabref-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ppf_jabref-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.11

File hashes

Hashes for ppf_jabref-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d76f76abd61a140fb7e4b06a269cfb8682a0c106312f084027e80d99e839d829
MD5 b9952137af142b5caf682e2a1b06a99f
BLAKE2b-256 7b43efde5788bd19a20f1d815fdb1fd48b853b6f837106788072f3f74f930948

See more details on using hashes here.

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