|
From: Germán Poo-C. <gp...@gn...> - 2014-11-19 19:39:56
|
Hi,
As part of moving everything to UTF-8 (and prepare the support for both
Python 2.7 and Python >= 3.4 at some point) I started to work on a "new"
API for python-bibtex.
So, far I have implemented an object that can be instantiated like:
import bibtex
db = bibtex.new_from_file('my-file.bib', strictness=False)
for entry in db:
do_something_with_every_entry()
It is basically a wrapper on the functions that already exists.
I think it is simpler than the old way. Besides this, instead of using
PyString_FromString I would use PyUnicode_FromString, and provide
unicode support from closer to the actual data. That would remove the
need for encode/decode inside pybliographer in most of the code.
In addition, there are some functions that are public in the current
_bibtex, but I think those are too low level for what could be use. For
example, get_offset and set_offset.
I would like to expose BibtexEntry in a similar way, if that would make
sense.
My idea is to make use of bibtex (or any other module name), instead of
_bibtex, which usually is for internal modules (AFAIU). That would
benefit other developers, I would expect.
Thoughts?
--
Germán Poo-Caamaño
http://calcifer.org/
|