Skip to main content

Python client for the Investify Data API (wos-data-api)

Project description

investify-data

Python client for the Investify Data API (wos-data-api) — an AI-agent-first financial-data platform covering Vietnamese market data, company profiles, financial ratios, and searchable document collections.

Installation

pip install investify-data

Python 3.10+ required.

Quickstart — Sync

from investify_data import DataClient

with DataClient(api_key="ifyu_...") as client:
    # Discovery
    categories = client.catalog.list_table_categories()
    tables = client.catalog.list_tables(category="equities")
    schema = client.catalog.describe_table("financial_ratio", group="valuation")

    # Table query — same operators as REST (eq, in, not_in, gte/lte/gt/lt)
    rows = client.tables.query(
        "stock_price_history",
        columns=["symbol", "date", "close"],
        filters={"symbol": "VNM", "date": {"gte": "-30d"}},
        sort="date.desc",
        limit=5,
    )

    # Document search (semantic)
    hits = client.collections.search(
        "market_news",
        q="lãi suất ngân hàng tác động đến cổ phiếu",
        metadata_filters={"topic": {"in": ["banking", "macro"]}},
        limit=5,
    )

Async

import asyncio
from investify_data import AsyncDataClient

async def main():
    async with AsyncDataClient(api_key="ifyu_...") as client:
        rows = await client.tables.query("stock_price_history", filters={"symbol": "VNM"}, limit=5)
        print(rows)

asyncio.run(main())

Authentication

Three credential types, picked up from the api_key prefix:

Prefix Role Use
ifyu_ User Direct queries scoped to the user's permission
ifys_ Tenant on_behalf_of=<user_uuid> required for data; admin ops without
ifym_ Super admin System-wide; on_behalf_of=<user_uuid> for data queries
# Tenant key querying on behalf of an end-user
DataClient(api_key="ifys_...", on_behalf_of="550e8400-e29b-41d4-a716-446655440000")

Error handling

from investify_data import DataClient, NotFound, InvalidRequest, Unauthorized

try:
    client.tables.query("nonexistent")
except NotFound:
    ...
except InvalidRequest as err:
    print(err.code, err.detail)
except Unauthorized:
    ...

All exceptions inherit from InvestifyDataError. APIError subclasses (Unauthorized, Forbidden, NotFound, InvalidRequest, RateLimited, ServerError) carry status_code, code, and detail. TransportError wraps network/TLS/timeout failures.

Security

  • Never commit your API key. Read it from an env var or secret store.
  • The SDK redacts keys in repr(), logs, and error messages — only the 5-char prefix is shown (e.g., ifyu_***).
  • HTTPS is the default (https://data.investify.vn). Using http:// with a production key triggers a runtime warning; local/LAN hosts (localhost, 127.0.0.1, investify.k8s) are exempt.
  • If you pin a custom base_url, keep it behind TLS.

Configuration

DataClient(
    api_key="ifyu_...",
    base_url="https://data.investify.vn",  # override for dev (e.g. http://investify.k8s:30702)
    on_behalf_of=None,                      # set for tenant/master keys
    timeout=30.0,                           # seconds
    user_agent="my-app/1.0",                # optional
)

Links

License

MIT

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

investify_data-0.1.0a2.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

investify_data-0.1.0a2-py3-none-any.whl (11.2 kB view details)

Uploaded Python 3

File details

Details for the file investify_data-0.1.0a2.tar.gz.

File metadata

  • Download URL: investify_data-0.1.0a2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.0

File hashes

Hashes for investify_data-0.1.0a2.tar.gz
Algorithm Hash digest
SHA256 714a03d7c63e7843554145078e84d189f513c6f77d1f9343cb71b02edc58d467
MD5 99a553a2ad38da1a4318671fad8221bc
BLAKE2b-256 b04c554c2c15a1d7160cc6ce4b0b362ed68969e57e45bcd7fcbf88ea13f2b35e

See more details on using hashes here.

File details

Details for the file investify_data-0.1.0a2-py3-none-any.whl.

File metadata

File hashes

Hashes for investify_data-0.1.0a2-py3-none-any.whl
Algorithm Hash digest
SHA256 e04926bd0b4dc4a8feefc3f907e6e2d021fcc1f1652850d87b26fc62d602888d
MD5 04986b016438c36bbe414d8376648bef
BLAKE2b-256 9c1e45b80e8db8dfcd52f7def64decc6c80039fc6ed355bd8669dd2ac6d8389f

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