Pohoda XML in Python
This project is basically a rewrite of https://github.com/riesenia/pohoda into Python3 and i will try to match their versioning if possible
Please consider sponsoring if you're using this package commercially, my time is not free :) You can sponsor me by clicking on "Sponsor" button in top button row. Thank You./Prosím pouvažujte nad sponzorováním tohoto projektu pokud používáte tento projekt komerčně, můj čas není zadarmo :) Sponzorovat můžete kliknutím na tlačítko "Sponsor" v horní řadě tlačítkek. Děkuji.
Install
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:
order.add_item({
'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
order.add_summary({
'roundingDocument': 'none'
})
# add order to import (identified by $order_number)
pohoda.add_item(order_number, order)
# Write data into file
pohoda.write(filename)
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
request.add_user_filter_name('MyFilter')
pohoda.add_item('Export 001', request)
pohoda.write(filename)
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)
pohoda.write(filename)
Release files for pohoda 1.17.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pohoda-1.17.3.tar.gz | 23.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pohoda-1.17.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 84.2 kB
Release files / pohoda-1.17.3.tar.gz
| Download URL | pohoda-1.17.3.tar.gz |
|---|---|
| Size | 23.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
270b2f42f219e09d341bae1f4270b48167b27b91c6cc8a7785ea9d792134eba5
|
|
BLAKE2b-256 checksum How to use checksums |
501a99b593e364d68794f4b20026549236a812b60ee5335fc92a78ebe38b8c65
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / pohoda-1.17.3-py3-none-any.whl
| Download URL | pohoda-1.17.3-py3-none-any.whl |
|---|---|
| Size | 60.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7c9c2f13d7b81bc5fb65af8bb624b04db479fe73a2cdff8f173a74442d873830
|
|
BLAKE2b-256 checksum How to use checksums |
239b281033bc99e59c3eb9a7c7273d600440e95e5922a9e8e0983b271fb0d5c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|