Unicat client library
Project description
Unicat client library
This library is still a work in progress, not all Unicat API options are covered yet.
No documentation yet either, just a few short examples.
First, connect to Unicat (https://unicat.app):
import sys
from unicat import Unicat
from .env import server, project_gid, api_key, local_folder
unicat = Unicat(server, project_gid, api_key, local_folder)
if not unicat.connect():
print("Invalid connection settings")
sys.exit(1)
Download all assets for the project (you can find them in the local_folder):
for asset in unicat.walk_asset_tree():
if asset.is_file:
asset.download()
Or, write an XML product feed:
with open("product-feed.xml", "w") as f:
f.write('<?xml version="1.0" encoding="UTF-8"?>\n')
f.write('<products>\n')
for record in unicat.walk_record_tree():
if record.definition.name != "article":
continue
fields = record.fields["nl"]
artnr = fields["artnr"].value
price = fields["price"].value
stock = fields["stock"].value
f.write(f' <product artnr="{artnr}" price="{price:%0.02f}" stock="{stock}"/>\n')
f.write('</products>\n')
There's also unicat.mutate, with options to update the Unicat project server-side, like unicat.mutate.create_record, unicat.mutate.modify_field and many more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file unicat-0.1.5.tar.gz.
File metadata
- Download URL: unicat-0.1.5.tar.gz
- Upload date:
- Size: 3.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b60d28139e0618a28e4d95a46ca6bd533c7e488be159c23a8a1f9ff207780388
|
|
| MD5 |
c9adb096d2c4c1f76f999648b4ccb15f
|
|
| BLAKE2b-256 |
fd0fcc5cb530ec882749e8b736528c41e4fa581ed57f3422efeb0fc6f4b77237
|
File details
Details for the file unicat-0.1.5-py3-none-any.whl.
File metadata
- Download URL: unicat-0.1.5-py3-none-any.whl
- Upload date:
- Size: 28.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51c4591985be7a2c3255fbf55cb5301cf2c01069ee42d793afd0ea5f6ed60eab
|
|
| MD5 |
308dd4a6b005013963998b5d01b48612
|
|
| BLAKE2b-256 |
0e4dfa65f67a4644fabb419fa1733e158985f27f9792d52607c5f14b263e78ed
|