# another citeproc-py

**URL:** <https://discourse.citationstyles.org/t/another-citeproc-py/1058>\
**Category:** CSL Development\
**Created:** [January 7, 2012, 12:52am UTC](https://discourse.citationstyles.org/t/another-citeproc-py/1058 "2012-01-07T00:52:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Brecht\_Machiels](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Brecht\_Machiels](https://discourse.citationstyles.org/u/Brecht_Machiels)\
**Post date:** [January 7, 2012, 12:52am UTC](https://discourse.citationstyles.org/t/another-citeproc-py/1058/1 "2012-01-07T00:52:17Z")

</div>

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 🙂 You can find it at  
GitHub:

> **[brechtm/citeproc-py](https://github.com/brechtm/citeproc-py)**
>
> Yet another Python CSL Processor. Contribute to brechtm/citeproc-py development by creating an account on 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

---

<div class="post-metadata">

**Author:** ![Bruce\_D\_Arcus1](https://avatars.discourse-cdn.com/v4/letter/b/4bbf92/32.png) [@Bruce\_D\_Arcus1](https://discourse.citationstyles.org/u/Bruce_D_Arcus1)\
**Post date:** [January 7, 2012, 3:28pm UTC](https://discourse.citationstyles.org/t/another-citeproc-py/1058/2 "2012-01-07T15:28:57Z")

</div>

Cool.

Did you look at the other existing python implementations?

---

<div class="post-metadata">

**Author:** ![Brecht\_Machiels](https://avatars.discourse-cdn.com/v4/letter/b/e9bcb4/32.png) [@Brecht\_Machiels](https://discourse.citationstyles.org/u/Brecht_Machiels)\
**Post date:** [January 7, 2012, 8:25pm UTC](https://discourse.citationstyles.org/t/another-citeproc-py/1058/3 "2012-01-07T20:25:04Z")

</div>

Hi,

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

- [https://github.com/bdarcus/citeproc-py/](https://github.com/bdarcus/citeproc-py/)
- [http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/attic/citeproc-py/](http://xbiblio.svn.sourceforge.net/viewvc/xbiblio/attic/citeproc-py/)

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](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](http://model.py), the actual CSL  
processor, is only about 1200 lines).

Best regards,  
Brecht
