## another unofficial api for [knopka.com](https://knopka.com)
[![python-latest](https://img.shields.io/pypi/pyversions/knopka?logo=python&logoColor=FFE873)](https://www.python.org/downloads/)
[![pypi](https://img.shields.io/badge/pypi-0.0.1-blue?logo=pypi&logoColor=FFE873)](https://pypi.org/project/knopka/)
[![status](https://img.shields.io/pypi/status/knopka)](https://pypi.org/project/knopka/)
[![pypi_downloads](https://img.shields.io/pypi/dm/knopka)](https://pypi.org/project/knopka/)
[![license](https://img.shields.io/pypi/l/knopka)](https://github.com/rdnve/knopka/blob/master/LICENSE)
### installation
```bash
# 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
```python
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
```python
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
```python
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)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rdnve/knopka",
"name": "knopka",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.11",
"maintainer_email": null,
"keywords": "finance, accounting",
"author": "serje \u00f9",
"author_email": "pleaseanswermeserjeu@icloud.com",
"download_url": "https://files.pythonhosted.org/packages/f6/6f/c17a1e8a010eb95351f996ad11c14a0f8d736b3f1d53f66615aaf17b1b04/knopka-0.0.1.tar.gz",
"platform": null,
"description": "## another unofficial api for [knopka.com](https://knopka.com)\n\n[![python-latest](https://img.shields.io/pypi/pyversions/knopka?logo=python&logoColor=FFE873)](https://www.python.org/downloads/)\n[![pypi](https://img.shields.io/badge/pypi-0.0.1-blue?logo=pypi&logoColor=FFE873)](https://pypi.org/project/knopka/)\n[![status](https://img.shields.io/pypi/status/knopka)](https://pypi.org/project/knopka/)\n[![pypi_downloads](https://img.shields.io/pypi/dm/knopka)](https://pypi.org/project/knopka/)\n[![license](https://img.shields.io/pypi/l/knopka)](https://github.com/rdnve/knopka/blob/master/LICENSE)\n\n\n### installation\n\n```bash\n# via pypi (recommended)\n$ python -m pip install -U knopka\n\n# or using github w/ pip\n$ python -m pip install git+https://github.com/rdnve/knopka.git\n\n# or using github w/ poetry\n$ poetry add git+https://github.com/rdnve/knopka.git\n```\n\n### retrieve documents by task identifier\n```python\nimport typing as ty\n\nfrom knopka import KnopkaAdapter\nfrom knopka.library import Document\n\nadapter: KnopkaAdapter = KnopkaAdapter(access_token=\"your-secret-token\")\ndocuments: ty.List[Document] = adapter.get_documents_from_ones(uid=1234567)\n\nfor x in documents:\n print(f\"Document: {x.guid} ({x.type=!s}) {x.number=!s} {x.date=!s}\")\n```\n\n### retrieve file metadata\n```python\nimport typing as ty\n\nfrom knopka import KnopkaAdapter\nfrom knopka.library import Document, File\n\nadapter: KnopkaAdapter = KnopkaAdapter(access_token=\"your-secret-token\")\ndocuments: ty.List[Document] = adapter.get_documents_from_ones(uid=1234567)\n\nfor document in documents:\n myfile: File = adapter.get_meta_from_file(uid=document.file_uid)\n print(f\"Meta file: {myfile.name} type={myfile.type}\")\n```\n\n### retrieve full file\n```python\nimport typing as ty\n\nfrom knopka import KnopkaAdapter\nfrom knopka.library import Document, File\n\nadapter: KnopkaAdapter = KnopkaAdapter(access_token=\"your-secret-token\")\ndocuments: ty.List[Document] = adapter.get_documents_from_ones(uid=1234567)\n\npath: str = \"/home/user/some_files\"\nfor document in documents:\n myfile: File = adapter.get_file(uid=document.file_uid)\n\n print(f\"File: {myfile.name} type={myfile.type} w/ size={myfile.size} bytes\")\n path: str = myfile.save(path)\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "another api client for online accounting knopka.com",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/rdnve/knopka",
"Repository": "https://github.com/rdnve/knopka"
},
"split_keywords": [
"finance",
" accounting"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4e068121a2c94fb2e6de417cee78ce325c8f67f16ad367467eb0fa1a3717d538",
"md5": "1813fbe132657e63a41a3e5e6b9a2d0b",
"sha256": "1c5d76fcb18051df13d1972a27639559c3002c3659c5d1f4645cd7d1aed03b13"
},
"downloads": -1,
"filename": "knopka-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "1813fbe132657e63a41a3e5e6b9a2d0b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.11",
"size": 8173,
"upload_time": "2024-07-20T17:37:10",
"upload_time_iso_8601": "2024-07-20T17:37:10.287700Z",
"url": "https://files.pythonhosted.org/packages/4e/06/8121a2c94fb2e6de417cee78ce325c8f67f16ad367467eb0fa1a3717d538/knopka-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "f66fc17a1e8a010eb95351f996ad11c14a0f8d736b3f1d53f66615aaf17b1b04",
"md5": "c92773ad107aa82b86d3a0c2ba9fcbde",
"sha256": "5e93a4de7546c6d99ea63dc3dc97b15cfe8d77d111f9b96a22b23edbee4020ba"
},
"downloads": -1,
"filename": "knopka-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "c92773ad107aa82b86d3a0c2ba9fcbde",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.11",
"size": 7265,
"upload_time": "2024-07-20T17:37:12",
"upload_time_iso_8601": "2024-07-20T17:37:12.162295Z",
"url": "https://files.pythonhosted.org/packages/f6/6f/c17a1e8a010eb95351f996ad11c14a0f8d736b3f1d53f66615aaf17b1b04/knopka-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-20 17:37:12",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rdnve",
"github_project": "knopka",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "knopka"
}