🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

knopka

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knopka

another api client for online accounting knopka.com

pipPyPI
Version
0.0.1
Maintainers
1

another unofficial api for knopka.com

python-latest pypi status pypi_downloads license

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)

Keywords

finance

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts