another api client for online accounting knopka.com
Project description
another unofficial api for knopka.com
installation
# via pypi (recommended)
$ python -m pip install -U knopka
# or using github w/ pip
$ python -m pip install git+https://github.com/rdnve/knopka.git
# or using github w/ poetry
$ poetry add git+https://github.com/rdnve/knopka.git
retrieve documents by task identifier
import typing as ty
from knopka import KnopkaAdapter
from knopka.library import Document
adapter: KnopkaAdapter = KnopkaAdapter(access_token="your-secret-token")
documents: ty.List[Document] = adapter.get_documents_from_ones(uid=1234567)
for x in documents:
print(f"Document: {x.guid} ({x.type=!s}) {x.number=!s} {x.date=!s}")
retrieve file metadata
import typing as ty
from knopka import KnopkaAdapter
from knopka.library import Document, File
adapter: KnopkaAdapter = KnopkaAdapter(access_token="your-secret-token")
documents: ty.List[Document] = adapter.get_documents_from_ones(uid=1234567)
for document in documents:
myfile: File = adapter.get_meta_from_file(uid=document.file_uid)
print(f"Meta file: {myfile.name} type={myfile.type}")
retrieve full file
import typing as ty
from knopka import KnopkaAdapter
from knopka.library import Document, File
adapter: KnopkaAdapter = KnopkaAdapter(access_token="your-secret-token")
documents: ty.List[Document] = adapter.get_documents_from_ones(uid=1234567)
path: str = "/home/user/some_files"
for document in documents:
myfile: File = adapter.get_file(uid=document.file_uid)
print(f"File: {myfile.name} type={myfile.type} w/ size={myfile.size} bytes")
path: str = myfile.save(path)
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
knopka-0.0.1.tar.gz
(7.3 kB
view details)
Built Distribution
File details
Details for the file knopka-0.0.1.tar.gz
.
File metadata
- Download URL: knopka-0.0.1.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e93a4de7546c6d99ea63dc3dc97b15cfe8d77d111f9b96a22b23edbee4020ba |
|
MD5 | c92773ad107aa82b86d3a0c2ba9fcbde |
|
BLAKE2b-256 | f66fc17a1e8a010eb95351f996ad11c14a0f8d736b3f1d53f66615aaf17b1b04 |
File details
Details for the file knopka-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: knopka-0.0.1-py3-none-any.whl
- Upload date:
- Size: 8.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.9.19 Darwin/22.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c5d76fcb18051df13d1972a27639559c3002c3659c5d1f4645cd7d1aed03b13 |
|
MD5 | 1813fbe132657e63a41a3e5e6b9a2d0b |
|
BLAKE2b-256 | 4e068121a2c94fb2e6de417cee78ce325c8f67f16ad367467eb0fa1a3717d538 |