Skip to main content

Python-bindings for the Collmex import/export API

Project description

Introduction

Collmex is an online ERP system for (small) companies with a focus on simple accounting. <http://www.collmex.de> (Note: Collmex is Germany-based but seems to support English. You’re bound to stumble over German strings, though.)

This package aims to provide pythonic bindings to program against Collmex’ API. It includes transaction management for integration with the ZODB or other databases that can integrate with the transaction package.

Collmex API

Collmex provides a POST- and CSV-based API, which is encapsulated into a utility that provides methods for the various CSV record types. API documentation is available at <http://www.collmex.de/cgi-bin/cgi.exe?1005,1,help,api>.

First we need to clean up the Collmex environment:

>>> import gocept.collmex.testing
>>> gocept.collmex.testing.cleanup_collmex()

Invalid login information raises an exception:

>>> import os
>>> import gocept.collmex.collmex
>>> collmex = gocept.collmex.collmex.Collmex(
...     os.environ['collmex_customer'], os.environ['collmex_company'],
...     os.environ['collmex_username'], 'invalid')
>>> collmex.get_invoices(customer_id='10000')
Traceback (most recent call last):
APIError: ('204008', 'Fehler in Zeile 1: Benutzer oder Kennwort nicht korrekt')

Invoices

Invoices can be looked up again, however, the invoice was only registered for addition and the transaction needs to be committed first:

>>> import datetime
>>> collmex = gocept.collmex.collmex.Collmex(
...     os.environ['collmex_customer'], os.environ['collmex_company'],
...     os.environ['collmex_username'], os.environ['collmex_password'])
>>> start_date = datetime.datetime.now()
>>> item = gocept.collmex.collmex.InvoiceItem()
>>> item['Kunden-Nr'] = '10000'
>>> item['Rechnungsnummer'] = 100000
>>> item['Menge'] = 3
>>> item['Produktnummer'] = 'TRAFFIC'
>>> item['Rechnungstext'] = 'item text'
>>> item['Positionstyp'] = 0
>>> collmex.create_invoice([item])
>>> collmex.get_invoices(customer_id='10000', start_date=start_date)
[]

After committing, the invoice is found:

>>> import transaction
>>> transaction.commit()
>>> collmex.get_invoices(customer_id='10000', start_date=start_date)[0]['Rechnungstext']
'item text'

Changes

0.2 (unreleased)

0.1 (2008-10-14)

  • first release. Supports getting and storing invoices.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gocept.collmex-0.1.tar.gz (6.9 kB view details)

Uploaded Source

File details

Details for the file gocept.collmex-0.1.tar.gz.

File metadata

  • Download URL: gocept.collmex-0.1.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for gocept.collmex-0.1.tar.gz
Algorithm Hash digest
SHA256 f2673edbb3803d30a516996cc1e2895e03de7ae8ead395c0bec9c8231ed00f9e
MD5 2fe4f0c04d12351e6017ebe820c074e6
BLAKE2b-256 971dc4ca890b51f39517e6b026034c69cb74731e8222114796466d60c1c41b69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page