Xero - beautiful accounting software

Xero Developer Help Center

Xero Developer Community

Community > Wrapper libraries >

Python wrapper libraries - feedback

Started by Ronan Quirke (Community Manager) -   in Wrapper libraries

There are two contributed 3rd party wrappers for private API applications we found out on the web. As we don't have any expertise in Python ourselves, we would love to get some feedback on them, bugs/issues or suggestions, or get in there and contribute yourself!

XeroAPI: http://pypi.python.org/pypi/XeroAPI
XeroPy: https://github.com/fatbox/XeroPy

XeroAPI doesn't seem to implement LineItems properly

David C  

XeroAPI doesn't appear to be availalble any more.

XeroPy has some serious problems:

* It doesn't work with Public applications
* It requires M2Crypto for Private applications, which isn't pure Python, so it's painful to install
* It has some serious bugs in dealing with LineItems on invoices.
* The authorization module for Public applications isn't well set up for the workflow you'd expect to see on a web app.

So - I've used XeroPy as a starting point, and rewritten it to fix these problems.

* Tested with both Private and Public applications
* Uses PyCrypto for Private applications, which *is* pure Python
* Code has a test suite - not yet comprehensive, but enough to prove some key portions work as expected.

It's called PyXero - see https://github.com/freakboy3742/pyxero for the code and documentation.

It's also on PyPI, so you can 'pip install pyxero'.

Russell Keith-Magee  

Thanks for you work Russell!

Your fork seems to be the pick of the Python options. We've made some mods to be able to access the Reports endpoint, and I'll do a pull request once happy with it.

Once again, thanks for your efforts and I recommend developers look at PyXero first.

Gavin Hodge  

As the maintainer of XeroPy I can say I also recommend that everyone looks at PyXero first! :)

I haven't put any effort into XeroPy for a number of years now, it worked fine for our needs but I agree that it needed to get rid of the reliance on m2crypto and move to requests.

I've marked that the XeroPy is no longer maintained and pointed people to PyXero.

Evan Borgstrom  

Hi everyone, thank you for chipping in with feedback and info so far.
We have updated the primary page to reflect this: http://developer.xero.com/code-samples/libraries/python/.

Thanks Evan in particular for your work on the XeroPy library in the past.

Ronan Quirke (Community Manager)  

The PyXero uses old dependencies and is more of a pain to use than anything.

Brian Monk  

Brian - which dependencies are you referring to? All the dependencies are specified as minimum requirements, so if you want to use a more recent version of six, requests, requests-oauthlib or python-dateutil, you can. If a newer version of those libraries raises an error, then that's a bug, and it should be logged.

I can see that someone logged a bug 19 hours ago about dependencies from oauthlib - if that's what you're referring to, complaining that something doesn't work when the bug is only 19 hours old is a bit rich.

Russell Keith-Magee