Skip to main content

Aress SDK

Official Python client for the Aress Data API — read access to the Iranian capital market: instruments (TSETMC), bonds, currencies, funds, market lists and reports.

  • Synchronous and asyncio clients with an identical surface.
  • Fully typed pydantic v2 models for every response.
  • Jalali (Persian) dates parsed into real jdatetime.date objects.
  • Money kept as Decimal (rials) — no float rounding.
  • Sensible defaults: timeouts, automatic retries with backoff for transient failures, and a clear exception hierarchy.

Installation

pip install aress-sdk

Requires Python 3.9+. Depends on httpx, pydantic>=2, and jdatetime.

Quickstart

from aress_sdk import AressClient

# An API key is required. The client talks to aress data backend
# by default and sends the key in the ``X-API-Key`` header on every request.
with AressClient("<your api key>") as client:
    # Currencies
    for currency in client.currencies.list():
        print(currency.symbol, currency.farsi_name)

    usd_history = client.currencies.daily_price_history("USD")
    print(usd_history[-1].trade_jdate, usd_history[-1].close_price)

    # Instruments
    sectors = client.instruments.list_sectors()
    steel = client.instruments.list(sector_code="27")
    trades = client.instruments.daily_trade_history("778253364357513")

    # Bonds
    bonds = client.bonds.list(market=1)
    bond = client.bonds.get(bonds[0].id)
    ytm = client.bonds.daily_trade_history(bond.id)

Async

import asyncio
from aress_sdk import AsyncAressClient

async def main():
    async with AsyncAressClient("<your api key>") as client:
        sectors = await client.instruments.list_sectors()
        usd = await client.currencies.daily_price_history("USD")

asyncio.run(main())

Configuration

client = AressClient(
    "<your api key>",                 # required
    timeout=30.0,            # per-request, seconds
    calculate_timeout=300.0, # report calculation endpoints, seconds
    max_retries=2,           # retries on connection errors / 5xx / 429
    backoff_factor=0.5,      # exponential backoff base, seconds
)

Bring your own configured httpx client (proxies, custom TLS, connection pools); the SDK will use it and leave its lifecycle to you:

import httpx
from aress_sdk import AressClient

http = httpx.Client(proxies="http://proxy.example.com:8080")
client = AressClient("<your api key>", http_client=http)  # the key is still sent

Error handling

Every error derives from AressError:

from aress_sdk import AressClient, NotFoundError, AressTransportError

with AressClient("<your api key>") as client:
    try:
        bond = client.bonds.get(999999)
    except NotFoundError as exc:
        print(exc.status_code, exc.detail)   # 404 and the error detail
    except AressTransportError as exc:
        print("network problem:", exc)
Exception When
BadRequestError HTTP 400
AuthenticationError HTTP 401
PermissionDeniedError HTTP 403
NotFoundError HTTP 404
UnprocessableEntityError HTTP 422 (request failed validation)
RateLimitError HTTP 429
ServerError HTTP 5xx
AressAPIStatusError any other non-2xx
AressTimeoutError / AressConnectionError transport failures

Resources & endpoints

Resource Method Endpoint
client.instruments list_sectors() GET /sectors
get_sector(code) GET /sectors/{code}
list(market_flow=, sector_code=, sub_sector_code=, market_code=) GET /instruments
adjustments(code) GET /instruments/{code}/adjustments
share_changes(code) GET /instruments/{code}/share_changes
all_adjustments(from_date=) GET /instruments/adjustments
all_share_changes(from_date=) GET /instruments/share_changes
daily_trade_history(code, from_date_inclusive=, to_date_inclusive=) GET /instruments/{code}/trade_history/daily
daily_client_type_history(code, from_date_inclusive=, to_date_inclusive=) GET /instruments/{code}/client_type_history/daily
daily_trade_history_on(date) GET /instruments/trade_history/daily?date=
daily_client_type_history_on(date) GET /instruments/client_type_history/daily?date=
list_indices(market_flow=, is_active=) GET /indices
index_daily_history_on(date) GET /indices/history/daily?date=
index_return_history(index_id, from_date=, to_date=) GET /indices/{index_id}/return-history
realtime_market() GET /instruments/realtime/market/latest
option_chain(underlying_instrument_tsetmc_code=, expiration_date_from=, expiration_date_to=, target_date=, is_active=) GET /instruments/options/chain
realtime_option_market(underlying_instrument_tsetmc_code=, expiration_date_from=, expiration_date_to=, is_active=, only_with_market_data=) GET /instruments/realtime/options/market/latest
client.bonds list(market=, bond_type=, issuer_type=) GET /bonds
get(bond_id) GET /bonds/{bond_id}
daily_trade_history(bond_id) GET /bonds/{bond_id}/trade_history/daily
client.currencies list() GET /currencies
daily_price_history(symbol) GET /currencies/{symbol}/price_history/daily
daily_price_history_on(date) GET /currencies/price_history/daily?date=
realtime_market(symbol=) GET /currencies/realtime/market/latest
client.funds list(), managers(), latest_navs(), nav_history(reg_no, sub_fund), videos(...) GET /funds*
summary_analysis(...), flows_summary(...), aum_flow_series(...), monthly_returns(...), analysis(...) analysis endpoints
categories_issue_redeem_analysis(from_date=, to_date=) GET /fund-categories/issue-redeem-analysis
client.market stock_price_changes(window), sector_trade_values(window), realtime_stock_flows() GET /market/*
client.ime list_cdc_contracts(is_online=) GET /ime/cdc/contracts
get_cdc_contract(identifier) GET /ime/cdc/contracts/{identifier}
cdc_daily_trade_history(identifier, from_date_inclusive=, to_date_inclusive=) GET /ime/cdc/contracts/{identifier}/trade_history/daily
cdc_daily_trade_history_on(date) GET /ime/cdc/trade_history/daily?date=
option_daily_trade_history_on(date) GET /ime/options/trade_history/daily?date=
list_option_contracts(underlying_asset_type=, underlying_asset_identifier=, option_type=, expiration_date_from=, expiration_date_to=) GET /ime/options/contracts
get_option_contract(identifier) GET /ime/options/contracts/{identifier}
option_chain(underlying_asset_type=, underlying_asset_identifier=, expiration_date_from=, expiration_date_to=) GET /ime/options/chain
realtime_market() GET /ime/realtime/market/latest
realtime_option_chain(underlying_ticker=, underlying_identifier=, expiration_date_from=, expiration_date_to=, only_with_market_data=) GET /ime/realtime/options/market/latest
client.tradingview config(), time() GET /tradingview/config, GET /tradingview/time
search(query, symbol_type=, exchange=, limit=) GET /tradingview/search
symbol(symbol) GET /tradingview/symbols
history(symbol, resolution, from_, to, countback=, adjusted=, calendar=) GET /tradingview/history
client.reports list(), categories(), get(report_id) GET /reports*
calculate(...), calculate_batch(requests) POST /reports/calculate*
client health() GET /health

Time-series endpoints return records sorted by date ascending. Option-contract endpoints never return matured contracts.

Development

The project uses Hatch and a src/ layout.

hatch test            # pytest against the installed package (in-process httpx mock, no network)
hatch build           # sdist + wheel into dist/
hatch version minor   # bump src/aress_sdk/_version.py

License

MIT, see LICENSE.

Metadata

Release files for aress-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aress-sdk 0.1.1
File Size Uploaded Provenance
aress_sdk-0.1.1.tar.gz 54.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for aress-sdk 0.1.1
File Interpreter ABI Platform
aress_sdk-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 122.7 kB

Release files / aress_sdk-0.1.1.tar.gz

Download URL aress_sdk-0.1.1.tar.gz
Size 54.2 kB
Tags Source
SHA-256 checksum
How to use checksums
582c2e94f5be30e26ef36a49c08828097d3edb66c81b940c9fd6854bafc38fc6
BLAKE2b-256 checksum
How to use checksums
401347560d6490b2692d52a1721f27c55b091b0afe4dd98eb436b9d13e85a2a1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.2"},"implementation":{"name":"CPython","version":"3.12.14"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.5.8 25 Aug 2026","python":"3.12.14","system":{"name":"Darwin","release":"24.2.0"}} HTTPX2/2.16.0

Release files / aress_sdk-0.1.1-py3-none-any.whl

Download URL aress_sdk-0.1.1-py3-none-any.whl
Size 68.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c87a0abac129422c98dd119609be0ab50f21c3d37e52602b2705114efb417dc
BLAKE2b-256 checksum
How to use checksums
79a85e9a340704603d906b20d8572fd2ede75f0d2e2aa8e4d74a3fa1f19efda1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via Hatch/1.18.1 {"ci":null,"cpu":"arm64","distro":{"name":"macOS","version":"15.2"},"implementation":{"name":"CPython","version":"3.12.14"},"installer":{"name":"hatch","version":"1.18.1"},"openssl_version":"OpenSSL 3.5.8 25 Aug 2026","python":"3.12.14","system":{"name":"Darwin","release":"24.2.0"}} HTTPX2/2.16.0

Security for aress-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page