This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This package for now only includes a quite basic parser for BibTeX which converts a bibliography and its entries into simple dict-like data structures and also checks crossreferences if used.

Warning

The parser does not (and probably never will) support some of the more advanced BibTeX-features like preambles.

It also doesn’t convert things like accented characters into unicode but leaves them as they were in the original input.

Usage

A simple example on how to use it:

from zs.bibtex.parser import parse_string

data = '''@article{mm09,
    author = {Max Mustermann},
    title = {The story of my life},
    year = {2009},
    journal = {Life Journale}
}'''

bibliography = parse_string(data)
article = bibliography['mm09']

A bibliography as well as each entry in it offers a validate() method which checks aspects like cross-references on the bibliography and fields on the entries. It also supports an optional raise_unsupported keyword-argument which raises an exception once a possibly unsupported field is used in an entry.

The information about what fields are required and optional for what kind of entry is based on the BibTeX article on Wikipedia.

If you’re working with a file you can also use a small helper function called parse_file(file_or_path, encoding='utf-8', validate=False) which works on a given filepath or file-like object and returns a bibliography object for the content of that file.

Custom entry types

Out of the box zs.bibtex supports following entry types for validation:

  • article
  • book
  • booklet
  • incollection
  • inproceedings
  • conference
  • inbook
  • manual
  • masterthesis
  • misc
  • phdthesis
  • proceedings
  • techreport
  • unpublished

For details on which of these requires what fields please take a look at the zs.bibtex.structures module.

But if you are in a situation where you need a different entry type, you can also easily register your own.

First you have to create a subclass of the zs.bibtex.structures.Entry class:

from zs.bibtex import structures


class MyEntryType(structures.Entry):
    required_fields = ('required_field_1', ('either_this', 'or_that', ), )
    optional_fields = ('optional_field_1', )

and then simply register it:

structures.TypeRegistry.register('mytype', MyEntryType')
Release History

Release History

1.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0rc1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
zs.bibtex-1.0.0.tar.gz (9.0 kB) Copy SHA256 Checksum SHA256 Source Sep 6, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting