Skip to main content

Typed Python client for the Finkovsky API.

Project description

Finkovsky SDK — Python

Typed Python client for the Finkovsky API — technical analysis, equity data, Taiwan market, and economic indicators.

pip install finkovsky

Requires Python 3.10+.

Three Ways to Use

1. Agent / LLM tool call (synchronous)

from finkovsky import Client, CreditError, RateLimitError

fk = Client(api_key="sk-...")  # or set FINKOVSKY_API_KEY

try:
    result = fk.ta.analyze(symbol="AAPL")
    print(result)
except CreditError as e:
    print(f"out of credits: {e.remaining}/{e.required}")
except RateLimitError as e:
    print(f"slow down: retry after {e.retry_after}s")

See examples/agent_tool_wrapping.md for framework-specific wrapping patterns.

2. Notebook / quantitative research

from finkovsky import Client
from finkovsky.pandas import to_dataframe

fk = Client()
df = to_dataframe(fk.tw.ohlcv(symbol="2330", days=90))
df["close"].plot()

Install the pandas extra: pip install 'finkovsky[pandas]'.

3. Async backend service

import asyncio
from finkovsky import AsyncClient

async def main():
    async with AsyncClient() as fk:
        result = await fk.ta.analyze(symbol="AAPL")
        print(result)

asyncio.run(main())

Authentication

  • Client(api_key="sk-...") — explicit key.
  • Client() — reads FINKOVSKY_API_KEY; raises AuthError if neither is set.
  • Client(api_key="sk-...", base_url="https://staging.example.com") — override for staging/self-hosted deployments.

Error Hierarchy

Exception HTTP trigger Meaning
AuthError 401, 403, missing key Credentials need fixing.
CreditError 402 Out of credits; carries remaining / required.
RateLimitError 429 Too many requests; carries retry_after.
APIError other 4xx, 5xx Carries status_code, body, request_id.
ValidationError client-side Response could not be parsed into the expected schema.

Endpoint Reference

All routes are available via client.<namespace>.<method>(...). The generated typed surface lives in src/finkovsky/_facade.py.

Development

cd sdk/python
pip install -e '.[dev]'
./scripts/gen.sh          # regenerate from a running API
./scripts/gen.sh --check  # drift check
pytest -m "not integration"

License

MIT — same as the parent repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

finkovsky-0.4.6.tar.gz (63.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

finkovsky-0.4.6-py3-none-any.whl (204.4 kB view details)

Uploaded Python 3

File details

Details for the file finkovsky-0.4.6.tar.gz.

File metadata

  • Download URL: finkovsky-0.4.6.tar.gz
  • Upload date:
  • Size: 63.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for finkovsky-0.4.6.tar.gz
Algorithm Hash digest
SHA256 f74c76624befddaffcd4381772ab27a209e7c9baeeddc015f367940d49e806b4
MD5 36a3be1224eb22575eae8995163d9dd7
BLAKE2b-256 13b5e1c94fef6dd669936eb15eefc9acb40069771d12a29ac37290a33478194b

See more details on using hashes here.

File details

Details for the file finkovsky-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: finkovsky-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 204.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for finkovsky-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d343e0ce01e01bf0cfbf8f344fd25697197c4781be0374d39eb8b3d1d0ce7241
MD5 aa5cb64bc57ff3b2f0af93ba3669cc00
BLAKE2b-256 95f186ffe1307208ba74b19eb517bb87383462059f35607c56cc5374a5a436a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page