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.5.0.tar.gz (69.0 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.5.0-py3-none-any.whl (219.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for finkovsky-0.5.0.tar.gz
Algorithm Hash digest
SHA256 06bbc7282ec9f9629abd8cf788b4c58a643d31643f78ac1e99b67865511c8fde
MD5 104e606863dcf1efed0b96ab3f183d87
BLAKE2b-256 32ea021a759dfbf17e7ce3709b6bd45c3d89876edde819652ac79b25cb58c5a6

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for finkovsky-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 059994d915d35b9a0852043c41c4b2431dfc1de6677c6b7017c064a8b562a197
MD5 04ad586a277dff73a5c43d3b7b043a8d
BLAKE2b-256 031f09e9b42cd3ee937eeb6e825197fddd42f5685752e4e6c8e14e47df15122f

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