|
| 1 | +XeroPy |
| 2 | +====== |
| 3 | + |
| 4 | +This is a ORM style implementation of the [Xero API](http://developer.xero.com). |
| 5 | + |
| 6 | +Overview |
| 7 | +-------- |
| 8 | + |
| 9 | +```python |
| 10 | +>>> from XeroPy import Xero, XeroException |
| 11 | +>>> from datetime import datetime |
| 12 | +>>> xero = Xero(XERO_CONSUMER_KEY, |
| 13 | + XERO_CONSUMER_SECRET, |
| 14 | + XERO_PRIVATE_KEY_FILE) |
| 15 | +>>> xero.contacts.all() |
| 16 | +[{u'Addresses': ({u'AddressType': u'STREET'}, {u'AddressType': u'POBOX'}), |
| 17 | + u'ContactID': u'9568059d-a856-44f4-8961-0060a3dabc8f', |
| 18 | + u'ContactStatus': u'ACTIVE', |
| 19 | + u'EmailAddress': u'130979849416st@corpmail.net', |
| 20 | + u'FirstName': u'first name', |
| 21 | + u'IsCustomer': False, |
| 22 | + u'IsSupplier': False, |
| 23 | + u'LastName': u'last name', |
| 24 | + u'Name': u'[TEST] 130979849416st', |
| 25 | + u'Phones': ({u'PhoneType': u'DEFAULT'}, |
| 26 | + {u'PhoneType': u'FAX'}, |
| 27 | + {u'PhoneType': u'DDI'}, |
| 28 | + {u'PhoneType': u'MOBILE'}), |
| 29 | + u'UpdatedDateUTC': datetime.datetime(2011, 7, 4, 16, 54, 57, 653000)}, |
| 30 | + ...] |
| 31 | + |
| 32 | +>>> xero.contacts.get("9568059d-a856-44f4-8961-0060a3dabc8f") |
| 33 | +{u'Addresses': ({u'AddressType': u'STREET'}, {u'AddressType': u'POBOX'}), |
| 34 | + u'ContactID': u'9568059d-a856-44f4-8961-0060a3dabc8f', |
| 35 | + u'ContactStatus': u'ACTIVE', |
| 36 | + u'EmailAddress': u'130979849416st@corpmail.net', |
| 37 | + u'FirstName': u'first name', |
| 38 | + u'IsCustomer': False, |
| 39 | + u'IsSupplier': False, |
| 40 | + u'LastName': u'last name', |
| 41 | + u'Name': u'[TEST] 130979849416st', |
| 42 | + u'Phones': ({u'PhoneType': u'DEFAULT'}, |
| 43 | + {u'PhoneType': u'FAX'}, |
| 44 | + {u'PhoneType': u'DDI'}, |
| 45 | + {u'PhoneType': u'MOBILE'}), |
| 46 | + u'UpdatedDateUTC': datetime.datetime(2011, 7, 4, 16, 54, 57, 653000)} |
| 47 | + |
| 48 | +>>> xero.contacts.filter(Since=datetime(2011,7,1)) |
| 49 | +[{u'Addresses': ({u'AddressType': u'STREET'}, {u'AddressType': u'POBOX'}), |
| 50 | + u'ContactID': u'9568059d-a856-44f4-8961-0060a3dabc8f', |
| 51 | + u'ContactStatus': u'ACTIVE', |
| 52 | + u'EmailAddress': u'130979849416st@corpmail.net', |
| 53 | + u'FirstName': u'first name', |
| 54 | + u'IsCustomer': False, |
| 55 | + u'IsSupplier': False, |
| 56 | + u'LastName': u'last name', |
| 57 | + u'Name': u'[TEST] 130979849416st', |
| 58 | + u'Phones': ({u'PhoneType': u'DEFAULT'}, |
| 59 | + {u'PhoneType': u'FAX'}, |
| 60 | + {u'PhoneType': u'DDI'}, |
| 61 | + {u'PhoneType': u'MOBILE'}), |
| 62 | + u'UpdatedDateUTC': datetime.datetime(2011, 7, 4, 16, 54, 57, 653000)}, |
| 63 | + ...] |
| 64 | +``` |
| 65 | + |
| 66 | +TODO |
| 67 | +---- |
| 68 | +More docs & tests |
| 69 | + |
| 70 | + |
| 71 | +Copyright (c) 2011 FatBox Inc. |
0 commit comments