Skip to main content

Python library for generating pohoda XML files

Project description

Pohoda XML in Python

This project is basically a rewrite of into Python3 and i will try to match their versioning if possible

Python package


pip install pohoda

Example of order import

Examples for other agenda imports in tests folder.

from pohoda.Pohoda import Pohoda

pohoda = Pohoda('ICO', 'i_obj1', 'Import orders')

# create order
order = pohoda.create_order({
    'numberOrder': order_number,
    'isReserved': True,
    'date': created,
    'text': '...',
    'partnerIdentity': {
        'address': {
            'name': billing_name,
            'street': billing_street,
            'city': billing_city,
            'zip': billing_zip,
            'email': email,
            'phone': phone
        'shipToAddress': {
            'name': shipping_name,
            'street': shipping_street,
            'city': shipping_city,
            'zip': shipping_zip,
            'email': email,
            'phone' phone

# add items
for item in items:
        'code': item.code,
        'text': item.text,
        'quantity': item.quantity,
        'payVAT': False,
        'rateVAT': item.rate,
        'homeCurrency': {
            'unitPrice': item.unit_price
        'stockItem': {
            'stockItem': {
                'id': item.pohoda_id

# add summary
    'roundingDocument': 'none'

# add order to import (identified by $order_number)
pohoda.add_item(order_number, order)

# Write data into file

Example of stock export

Export request is made by creating ListRequest

from pohoda.Pohoda import Pohoda

pohoda = Pohoda('ICO', 'e_zas1', 'Export stock')

request = pohoda.create_list_request({
    'type': 'Stock'

# optional filter

pohoda.add_item('Export 001', request)


Deleting stock example

We need to create a empty agenda with delete actionType to delete stock.

from pohoda.Pohoda import Pohoda

pohoda = Pohoda('ICO', 'd_zas1', 'Delete stock')

stock = pohoda.create_stock([])

stock.add_action_type('delete', {
    'code': code

pohoda.add_item(code, stock)


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

pohoda-1.0.9.tar.gz (21.0 kB view hashes)

Uploaded Source

Built Distribution

pohoda-1.0.9-py3-none-any.whl (51.6 kB view hashes)

Uploaded Python 3

Supported by

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