another citeproc-py

Hi,

I thought I’d have a ‘quick go’ at implementing a CSL processor in Python.
It immediately became obvious I would need some more time. But now I’ve
got something that I am not too ashamed to show :slight_smile: You can find it at
GitHub:

The code is still pretty rough overall and definitely needs cleaning up.
However, a lot of the CSL spec is implemented. More details can be found
in the README. There’s no setup.py file yet, but you can add the root dir
of the cloned repository to your PYTHONPATH and run the tests. I’m sure
I’m forgetting something, so don’t hesitate to ask if you’re wondering
about something. For those who are interested in the internals, the actual
processing code is in citeproc/model.py.

I should not forget to thank everyone responsible for the clear CSL
specification and the test suite, which made the development a pretty
smooth experience. Great job! I still have some minor comments on both,
but I’ll leave that for another post.

Best regards,
Brecht

Cool.

Did you look at the other existing python implementations?

Hi,

Yes, I did have a look at these (I hope I didn’t miss any?):

The former seems to be in very early stages of development.

The latter has a lot of code already written for it, but I did not attempt
to run it. I assumed it was not very functional, since it has been ‘moved
to the attic’ a long time ago and is not linked from
http://citationstyles.org.

I was put off a bit by the large amount of code (and the organization into
many files). Instead of spending a lot of time grasping it, I opted to
start from scratch, relying on the automatic tag-to-class mapping offered
by lxml, allowing for a compact implementation (model.py, the actual CSL
processor, is only about 1200 lines).

Best regards,
Brecht