Data only. Sources reviewed; live endpoints not verified by these synthetic tests.
Search symbols without silently selecting the first match. Returns a typed DataFrame, including for no matches. A limit only limits displayed results; it is not a server pagination parameter.
search_instruments(query: 'str', *, market: 'Market | None' = None, include_inactive: 'bool' = True, limit: 'int | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| query | str | required | Nonempty text to search. Search does not guess which result the user meant. |
| market | Market | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| include_inactive | bool | True | Only False is supported for the current-observed instrument list; True cannot be claimed from market watch. |
| limit | int | None | None | Positive cap. For download_market at most 10000 entries; default 100 and request budget still applies. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Resolve one symbol or explicit InstrumentRef and verify its identity. Raises AmbiguousInstrumentError for multiple exact matches; use candidates or search_instruments to choose an ins_code. Historical identity and ISIN-only lookup remain unsupported.
get_instrument(instrument: 'InstrumentLike', *, market: 'Market | None' = None, as_of: 'date | None' = None, known_at: 'datetime | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'InstrumentRecord'
Output: InstrumentRecord
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| market | Market | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| as_of | date | None | None | Reserved economic identity date; historical identity lookup is explicitly unsupported. |
| known_at | datetime | None | None | Historical identity knowledge cutoff; reserved and explicitly rejected in this release. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Fetch the latest report as an immutable Quote with source and retrieval timestamps. A last report may be from a past trading day. Use an explicit offline policy to permit stale cached data; autosave errors are reported separately.
get_quote(instrument: 'InstrumentLike', *, freshness: 'FreshnessPolicy | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'Quote'
Output: Quote
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| freshness | FreshnessPolicy | None | None | Explicit FreshnessPolicy, with precedence over policy freshness for quotes. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Return a Decimal price. field is last, closing or previous_reference. Missing price raises MissingValueError and unverified price units raise UnsupportedQuoteUnitError. Use get_quote/get_quote_frame to retain time and unit metadata.
get_price(instrument: 'InstrumentLike', *, field: 'str' = 'last', freshness: 'FreshnessPolicy | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'Decimal'
Output: Decimal
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| field | str | 'last' | One of 'last', 'closing', 'previous_reference'; not a raw API field name. |
| freshness | FreshnessPolicy | None | None | Explicit FreshnessPolicy, with precedence over policy freshness for quotes. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, MissingValueError, UnsupportedQuoteUnitError
Fetch an ordered batch to a DataFrame. Accepts list/tuple, Series, Index or a 1D NumPy array. Duplicates and input order are preserved. on_error=collect records per-item errors; raise attaches partial_result to BatchDataError. No concurrency is implied.
get_quotes(instruments: 'Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray', *, on_error: 'str' = 'raise', freshness: 'FreshnessPolicy | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instruments | Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray | required | Nonempty ordered list/tuple, Pandas Series/Index or a one-dimensional NumPy array. Duplicates preserved; nulls rejected. |
| on_error | str | 'raise' | 'raise' stops with partial_result; 'collect' records errors without losing other inputs. |
| freshness | FreshnessPolicy | None | None | Explicit FreshnessPolicy, with precedence over policy freshness for quotes. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, BatchDataError
Raw daily history, ascending and inclusive. No rows are forward-filled. The full available endpoint response is fetched/cached, then filtered locally. ``source`` adjustments, stitched identities and ``as_of`` are reserved but raise explicit errors until their evidence is implemented.
get_history(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', adjustment: 'str' = 'none', series: 'str' = 'listing', as_of: 'datetime | None' = None, policy: 'FetchPolicy | str | None' = None, include_jdate: 'bool' = False) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| adjustment | str | 'none' | Only 'none' is implemented; 'source' raises UnsupportedCapabilityError, never a fabricated adjusted series. |
| series | str | 'listing' | Only 'listing' is implemented. 'continuous_verified' requires a verified historical identity chain. |
| as_of | datetime | None | None | Timezone-aware cutoff for locally stored history; online historical reconstruction is not implemented. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Bounded sequential batch. Each input, even repeated/empty, gets a report row.
get_history_many(instruments: 'Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', adjustment: 'str' = 'none', on_error: 'str' = 'raise', policy: 'FetchPolicy | str | None' = None, include_jdate: 'bool' = False) -> 'BatchFrames'
Output: BatchFrames
| Parameter | Type | Default | Description |
|---|---|---|---|
| instruments | Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray | required | Nonempty ordered list/tuple, Pandas Series/Index or a one-dimensional NumPy array. Duplicates preserved; nulls rejected. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| adjustment | str | 'none' | Only 'none' is implemented; 'source' raises UnsupportedCapabilityError, never a fabricated adjusted series. |
| on_error | str | 'raise' | 'raise' stops with partial_result; 'collect' records errors without losing other inputs. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError, BatchDataError
Yield local calendar chunks. The underlying full HTTP response is NOT streamed. Skips chunks without rows; yields one typed empty frame if the whole selected range is empty. Each frame records its actual and chunk range.
iter_history(instrument: 'InstrumentLike', *, start: 'DateLike', end: 'DateLike', calendar: 'Calendar' = 'gregorian', adjustment: 'str' = 'none', chunk_days: 'int' = 366, policy: 'FetchPolicy | str | None' = None, include_jdate: 'bool' = False) -> 'Iterator[pd.DataFrame]'
Output: Iterator[pd.DataFrame]
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| start | DateLike | required | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | required | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| adjustment | str | 'none' | Only 'none' is implemented; 'source' raises UnsupportedCapabilityError, never a fabricated adjusted series. |
| chunk_days | int | 366 | Positive calendar-day span for local output chunks. Not server-side streaming or pagination. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
to_gregorian(value: 'DateLike', *, calendar: 'Calendar' = 'jalali') -> 'date'
Output: date
| Parameter | Type | Default | Description |
|---|---|---|---|
| value | DateLike | required | Input date or identifier; use the documented constructor to state its kind. |
| calendar | Calendar | 'jalali' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
Errors: InvalidArgumentError
to_jalali(value: 'DateLike') -> 'str'
Output: str
| Parameter | Type | Default | Description |
|---|---|---|---|
| value | DateLike | required | Input date or identifier; use the documented constructor to state its kind. |
Errors: InvalidArgumentError
Return the implemented, conditional and deferred capability matrix. A source-reviewed endpoint is not a live-service guarantee.
capabilities() -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Return in-memory storage counters without querying the database. Queued work is not durable until committed.
storage_status() -> 'StorageStatus'
Output: StorageStatus
| Parameter | Type | Default | Description |
|---|
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Read the receipt status for this process. Unknown IDs raise UnknownReceiptError. A queued receipt does not prove disk durability.
get_write_receipt(receipt_id: 'str') -> 'WriteReceipt'
Output: WriteReceipt
| Parameter | Type | Default | Description |
|---|---|---|---|
| receipt_id | str | required | Receipt identifier created in this running process, not a reusable authentication token. |
Errors: UnknownReceiptError
Explicitly wait up to timeout seconds for queued persistence. With raise_on_error=True incomplete or failed storage raises StorageError/StorageFlushTimeout. Normal automatic saving never waits for this call.
flush(*, timeout: 'float' = 5.0, raise_on_error: 'bool' = True) -> 'FlushReport'
Output: FlushReport
| Parameter | Type | Default | Description |
|---|---|---|---|
| timeout | float | 5.0 | Bounded seconds for the explicit storage wait; not an exchange availability guarantee. |
| raise_on_error | bool | True | Whether detected errors should raise instead of only returning a report. |
Errors: StorageError, StorageFlushTimeout, ConfigurationError
Close the default client. Explicitly flush first to require durable writes. The selected configuration is retained; configure() can replace it after close.
close(*, flush_timeout: 'float' = 1.0) -> 'FlushReport'
Output: FlushReport
| Parameter | Type | Default | Description |
|---|---|---|---|
| flush_timeout | float | 1.0 | Maximum seconds to attempt flushing on close; inspect the returned complete flag. |
Errors: ConfigurationError
A one-row Pandas quote with the same checks as get_quote; no second HTTP call.
get_quote_frame(instrument: 'InstrumentLike', *, freshness: 'FreshnessPolicy | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| freshness | FreshnessPolicy | None | None | Explicit FreshnessPolicy, with precedence over policy freshness for quotes. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Resolve exactly one instrument and return its typed one-row DataFrame.
get_instrument_frame(instrument: 'InstrumentLike', *, market: 'Market | None' = None, as_of: 'date | None' = None, known_at: 'datetime | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| market | Market | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| as_of | date | None | None | Reserved economic identity date; historical identity lookup is explicitly unsupported. |
| known_at | datetime | None | None | Historical identity knowledge cutoff; reserved and explicitly rejected in this release. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Configure the lazy module-level client without HTTP or creating a database. Call before using data.get_*; if a default client already exists, close it explicitly with data.close() first. This avoids silently losing queued work or changing the configuration of an in-flight request. Omitted settings use ClientConfig defaults (or the explicitly supplied config).
configure(config: 'ClientConfig | None' = None, *, source: 'str | None' = None, mode: 'str | None' = None, storage: 'bool | None' = None, data_dir: 'str | Path | None' = None, numeric: 'str | None' = None) -> 'ClientConfig'
Output: ClientConfig
| Parameter | Type | Default | Description |
|---|---|---|---|
| config | ClientConfig | None | None | Immutable ClientConfig; supplied constructor overrides take precedence. |
| source | str | None | None | get_futures uses explicitly identified separate tse_exchange gateway. Not an authenticated TSETMC provider. |
| mode | str | None | None | auto/online/offline; fresh cached responses may be reused in online. FetchPolicy.fresh() bypasses the cache. |
| storage | bool | None | None | Boolean enabling the default best-effort local response storage, or None to use config. |
| data_dir | str | Path | None | None | Directory containing dara.sqlite3. Does not move or delete old databases. |
| numeric | str | None | None | 'analysis' gives nullable Float64; 'exact' uses Decimal for price/quantity fields. Identifiers always remain text. |
Errors: ConfigurationError
Return immutable default settings without creating a Client or any I/O.
get_config() -> 'ClientConfig'
Output: ClientConfig
| Parameter | Type | Default | Description |
|---|
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Save a self-describing snapshot; return only after successful commit. ``metadata=False`` omits df.attrs, not structural type/checksum information. MultiIndex/unsupported object values are rejected. No network requests. CSV + sidecar replace is not one filesystem transaction: a crash between replacements is detected by load's SHA256 check, never silently accepted.
save(df: 'pd.DataFrame', path: 'str | Path', *, format: 'str | None' = None, dataset: 'str' = 'user_data', metadata: 'bool' = True, overwrite: 'bool' = False, safe_text: 'bool' = True) -> 'WriteReceipt'
Output: WriteReceipt
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
| path | str | Path | required | Nonempty path string or pathlib.Path, not the working cache database for archive exports. |
| format | str | None | None | csv/excel/parquet/sqlite, or None to infer from the supported file suffix. |
| dataset | str | 'user_data' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| metadata | bool | True | Keep dataframe attrs as well as structural schema; False omits attrs, not required type/checksum metadata. |
| overwrite | bool | False | Explicit permission to replace the named output only. Active working database is never an archive destination. |
| safe_text | bool | True | Protect dangerous formula-like text on export; decoding reverses the protection. |
Errors: InvalidArgumentError, FileExistsDataError, StorageError, OptionalDependencyError
Read a Dara archive and verify its structure/content. This is not a signature. For arbitrary externally-created files use pandas readers, then validate. ``verify=False`` allows deliberate value edits, not code execution or a different schema. CSV still requires its sidecar for dtype restoration.
load(path: 'str | Path', *, format: 'str | None' = None, dataset: 'str' = 'user_data', schema=None, verify: 'bool' = True) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| path | str | Path | required | Nonempty path string or pathlib.Path, not the working cache database for archive exports. |
| format | str | None | None | csv/excel/parquet/sqlite, or None to infer from the supported file suffix. |
| dataset | str | 'user_data' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| schema | object | None | None | Name of an implemented structural schema. For load, this argument remains reserved; use None. |
| verify | bool | True | Check archive checksums and structure. Not a cryptographic signature of a trusted sender. |
Errors: InvalidArgumentError, StorageError, OptionalDependencyError
Explicit reconciliation into the local history index. full=True rechecks old corrections; overlap_days controls the tail window. wait=True may wait for storage. on_storage_error=report preserves fetched data with failure information; raise demands success. SyncResult.data is only this fetch, not the whole database.
sync_history(instrument: 'InstrumentLike', *, full: 'bool' = False, overlap_days: 'int' = 14, full_refresh_days: 'float' = 7, wait: 'bool' = True, timeout: 'float' = 30.0, on_storage_error: 'str' = 'report') -> 'SyncResult'
Output: SyncResult
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| full | bool | False | Force a full source-history recheck instead of the calculated tail request. |
| overlap_days | int | 14 | Positive calendar-day overlap window for rechecking recent corrections. |
| full_refresh_days | float | 7 | After this many days since a full fetch, the next explicit sync performs a full audit. No scheduler. |
| wait | bool | True | Wait for storage only in explicit sync. False may return queued state, not durable data. |
| timeout | float | 30.0 | Bounded seconds for the explicit storage wait; not an exchange availability guarantee. |
| on_storage_error | str | 'report' | 'report' retains downloaded data with a failure report; 'raise' requires successful explicit storage. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Read the versioned local history index; never sends HTTP. Dates are inclusive. as_of is a local observation/commit cutoff, not proof of historical public availability. Raises OfflineDataUnavailableError when no usable indexed data exists.
load_stored_history(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, as_of: 'datetime | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| as_of | datetime | None | None | Timezone-aware cutoff for locally stored history; online historical reconstruction is not implemented. |
Errors: OfflineDataUnavailableError, StorageError, InvalidArgumentError, AmbiguousInstrumentError
Return per-instrument counts, ranges and latest fetch state from the local index. Explicit disk read; no HTTP. Counts do not certify full market history.
history_status() -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|
Errors: StorageError
Return locally observed economic revisions in the requested inclusive range. This is local evidence, not all revisions ever published by the exchange.
get_history_revisions(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
Errors: StorageError, OfflineDataUnavailableError, InvalidArgumentError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Explicitly rebuild missing normalized history from cached responses of previous releases, without HTTP. Existing history is not deleted. Return a dictionary report; durable storage can raise StorageError.
reindex_history() -> 'dict'
Output: dict
| Parameter | Type | Default | Description |
|---|
Errors: StorageError
Return column names, expected dtypes and meanings for an implemented schema. Parameters ---------- schema : str, default 'daily_bars' One of daily_bars, quote, quotes.batch, instruments. numeric : {'analysis', 'exact'}, default 'analysis' Floating nullable columns or Decimal object columns for prices/quantities. Returns ------- pandas.DataFrame column, dtype, required, description. It is a description, not market data.
schema_info(schema: 'str' = 'daily_bars', *, numeric: 'str' = 'analysis') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| schema | str | 'daily_bars' | An implemented schema name returned by capabilities()/the dataset metadata; includes daily_bars, quote, market_watch, client_types, indices, index_history and related new schemas. |
| numeric | str | 'analysis' | 'analysis' gives nullable Float64; 'exact' uses Decimal for price/quantity fields. Identifiers always remain text. |
Errors: InvalidArgumentError
Report schema/value issues without changing data or contacting TSETMC. The report columns are severity, rule, column, count, row_positions, message. row_positions are zero-based positions (not possibly duplicated index labels). At most ten example positions are kept per rule. Warnings do not certify or invalidate financial truth. This function is NOT a point-in-time/leakage audit.
validate_data(df: 'pd.DataFrame', *, schema: 'str | None' = None, raise_on_error: 'bool' = False, check_order: 'bool' = True) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
| schema | str | None | None | An implemented schema name returned by capabilities()/the dataset metadata; includes daily_bars, quote, market_watch, client_types, indices, index_history and related new schemas. |
| raise_on_error | bool | False | Whether detected errors should raise instead of only returning a report. |
| check_order | bool | True | Report ascending natural-key order violations without sorting input. |
Errors: InvalidArgumentError, DataQualityError
Normalize only present known fields; never invent source/time/zero values. ``columns`` is an explicit old-name -> standard-name mapping. Date strings use the explicitly supplied calendar. Naive real timestamps require timezone. Floating-point identifiers are rejected even when they look integral: original digits may already be lost. Unknown columns are preserved, rows are not dropped, duplicate keys are left for validate_data(), and the input/index are preserved unless sort=True reorders rows. No investment calculation is performed.
normalize_data(df: 'pd.DataFrame', *, schema: 'str' = 'daily_bars', columns: 'Mapping[str, str] | None' = None, calendar: 'Calendar' = 'gregorian', numeric: 'str' = 'analysis', timezone: 'str | None' = None, sort: 'bool' = False) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
| schema | str | 'daily_bars' | An implemented schema name returned by capabilities()/the dataset metadata; includes daily_bars, quote, market_watch, client_types, indices, index_history and related new schemas. |
| columns | Mapping[str, str] | None | None | Explicit column names or supported presets. No silent dropping of unknown names. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| numeric | str | 'analysis' | 'analysis' gives nullable Float64; 'exact' uses Decimal for price/quantity fields. Identifiers always remain text. |
| timezone | str | None | None | Explicit timezone for otherwise-naive real timestamps. Daily dates remain timezone-naive. |
| sort | bool | False | Explicitly reorder normalized rows by request_index/ins_code/date if present. No rows are dropped. |
Errors: InvalidArgumentError
Select explicit columns, or the documented 'compact'/'full' presentation. Compact output is a view for users, not a provenance-complete archive. Full metadata is copied, and any removed evidence columns are listed in it. Unknown/duplicate column names raise InvalidArgumentError instead of being ignored.
select_columns(df: 'pd.DataFrame', columns: 'Sequence[str] | str' = 'compact') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
| columns | Sequence[str] | str | 'compact' | Explicit column names or supported presets. No silent dropping of unknown names. |
Errors: InvalidArgumentError
Return a deep copy of df.attrs['tse_dara']; absent evidence stays unknown.
frame_metadata(df: 'pd.DataFrame') -> 'dict'
Output: dict
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
Errors: InvalidArgumentError
Return signatures, inputs, outputs, errors and dependencies for this release. name is an optional exact public function/class name. The catalog includes implemented API only; the HTML roadmap has separate not-yet-implemented plans.
api_reference(name: 'str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| name | str | None | None | Optional exact public API name to select from the installed reference. |
Errors: InvalidArgumentError
Roadmap-compatible validation entry point. Returns row_id, rule, severity, message and additional grouped diagnostic columns. A grouped issue may have no single row_id; count and row_positions then describe it. strict=True raises DataQualityError with this same report. This verifies a structural contract, not source correctness or completeness.
validate(df: 'pd.DataFrame', *, schema: 'str', strict: 'bool' = True) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
| schema | str | required | An implemented schema name returned by capabilities()/the dataset metadata; includes daily_bars, quote, market_watch, client_types, indices, index_history and related new schemas. |
| strict | bool | True | Validated setting; see the constructor docstring and configuration source. |
Errors: InvalidArgumentError, DataQualityError
Roadmap normalization entry point for already canonical column names. source='canonical' is the currently reviewed mapping. Raw external API mappings are not inferred; use normalize_data(columns=...) for an explicit user mapping and then validate it. All unknown sources fail explicitly.
normalize(df: 'pd.DataFrame', *, schema: 'str', source: 'str', strict: 'bool' = True) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | An ordinary Pandas DataFrame; input is never modified in place by local helpers. |
| schema | str | required | Name of an implemented structural schema. For load, this argument remains reserved; use None. |
| source | str | required | get_futures uses explicitly identified separate tse_exchange gateway. Not an authenticated TSETMC provider. |
| strict | bool | True | Validated setting; see the constructor docstring and configuration source. |
Errors: InvalidArgumentError, DataQualityError, UnsupportedCapabilityError
Load explicit synthetic data with no database access or real network. Names: daily_prices_v1, quote_v1, market_watch_v1, client_types_v1, indices_v1 and index_history_v1. These are teaching/test values, never current market prices, and they cannot become live data through fallback.
load_sample(name: 'str' = 'daily_prices_v1') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| name | str | 'daily_prices_v1' | Synthetic fixture: daily_prices_v1, quote_v1, market_watch_v1, client_types_v1, indices_v1 or index_history_v1. |
Errors: InvalidArgumentError
Return the current public market watch as a typed DataFrame. auto falls back to the reviewed legacy text route only when JSON returns a valid empty list. Optional books and client types retain independent provenance; rows are not an atomic snapshot. Empty is not proof of a closed market.
get_market_watch(*, market: 'Market | str | None' = None, include_order_book: 'bool' = False, include_client_types: 'bool' = False, show_traded: 'bool' = False, backend: 'str' = 'auto', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| include_order_book | bool | False | Add reported depth 1..5 columns with separate provenance; no forward fill. |
| include_client_types | bool | False | Fetch and join a separate bulk response by exact ID; timestamps may be absent/different. |
| show_traded | bool | False | Return only rows with a reported positive trade_count. Unknown is not treated as proof of no trading. |
| backend | str | 'auto' | auto/json/legacy; auto uses legacy only after valid empty JSON, not after auth/HTTP/schema errors. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return reported best-limit levels for the current watch. This is not the full exchange order book or historical depth. Missing levels are not filled. Source timestamps not reported by the feed remain missing.
get_market_order_book(*, market: 'Market | str | None' = None, backend: 'str' = 'auto', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| backend | str | 'auto' | auto/json/legacy; auto uses legacy only after valid empty JSON, not after auth/HTTP/schema errors. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return one row of reported market totals and index values. TSE or IFB only. Activity time and overall data time remain separate.
get_market_overview(*, market: 'Market | str' = <Market.TSE: 'TSE'>, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return the reported market-map data only; no drawing or computed ranking. The source size parameter can truncate output; coverage is not certified.
get_market_map(*, sector_code: 'str | None' = None, limit: 'int' = 9999, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| sector_code | str | None | None | Exact short sector code returned by get_sectors(), preserving leading zeros. |
| limit | int | 9999 | Positive cap. For download_market at most 10000 entries; default 100 and request budget still applies. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return sector codes/names with the four source counters preserved as source_c1..source_c4. Their undocumented bucket meanings are not guessed.
get_sectors(*, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Return current related-company quotes for an exact sector code. This is industry grouping, not evidence of corporate ownership.
get_sector_instruments(sector_code: 'str', *, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| sector_code | str | required | Exact short sector code returned by get_sectors(), preserving leading zeros. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Return all reported parameter-code/value pairs (potentially a large response). ins_code filtering is local after the bulk response. reported_value stays text: undocumented units and metrics are not guessed.
get_key_statistics(*, ins_code: 'str | int | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| ins_code | str | int | None | None | Exact positive integer identifier; on bulk key statistics this is a local filter. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Return latest or one specified day of natural/legal counts, volumes and reported values as a DataFrame. Missing values and dates are not inferred. DDD source fields are kept separate from individual/institutional.
get_client_types(instrument: 'InstrumentLike', *, day: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| day | DateLike | None | None | Optional explicit single Gregorian/Jalali day; latest intraday index endpoint only supports None. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return full available client-type history, then filter locally to inclusive dates, sorted ascending. Current identity does not certify historical identity or point-in-time availability.
get_client_type_history(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | Symbol string or explicit InstrumentRef. A bare numeric string is not inferred as ins_code. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return the bulk client-type response. With market selected, intersect with current watch identities (one extra component); without a filter, keep every returned ins_code. No date/value/market is guessed when absent.
get_market_client_types(*, market: 'Market | str | None' = None, backend: 'str' = 'auto', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| backend | str | 'auto' | auto/json/legacy; auto uses legacy only after valid empty JSON, not after auth/HTTP/schema errors. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return index codes, names and latest reported values. market=None explicitly requests TSE and IFB catalogs separately. Unit is points, never currency.
get_indices(*, market: 'Market | str | None' = <Market.TSE: 'TSE'>, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError
Search normalized current index names; never choose the first match implicitly. A local limit does not change server pagination.
search_indices(query: 'str', *, market: 'Market | str | None' = <Market.TSE: 'TSE'>, limit: 'int | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| query | str | required | Nonempty text to search. Search does not guess which result the user meant. |
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| limit | int | None | None | Positive cap. For download_market at most 10000 entries; default 100 and request budget still applies. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Resolve exactly one index from the current catalog by exact name or code, returning a one-row DataFrame. Ambiguous names raise. Use get_indices(market=None) to inspect available codes.
get_index(index: 'str | int | InstrumentRef', *, market: 'Market | str | None' = <Market.TSE: 'TSE'>, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| index | str | int | InstrumentRef | required | Exact index code (string/int/InstrumentRef) or exact normalized catalog name. No first-match guess. |
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return daily index close/high/low in points, ascending with inclusive date filtering. Open and volume are not invented. A full response is fetched before local filtering.
get_index_history(index: 'str | int | InstrumentRef', *, market: 'Market | str | None' = <Market.TSE: 'TSE'>, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| index | str | int | InstrumentRef | required | Exact index code (string/int/InstrumentRef) or exact normalized catalog name. No first-match guess. |
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return index observations for the latest session available from the public endpoint. day=None only; selecting a historical session is not supported and raises before HTTP. Equal-time points preserve source order.
get_index_intraday(index: 'str | int | InstrumentRef', *, market: 'Market | str | None' = <Market.TSE: 'TSE'>, day: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| index | str | int | InstrumentRef | required | Exact index code (string/int/InstrumentRef) or exact normalized catalog name. No first-match guess. |
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| day | DateLike | None | None | Optional explicit single Gregorian/Jalali day; latest intraday index endpoint only supports None. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Return current constituent quotes, not historical membership or index weights. as_of is unsupported and raises before HTTP. Quote dates are not membership effective dates.
get_index_members(index: 'str | int | InstrumentRef', *, market: 'Market | str | None' = <Market.TSE: 'TSE'>, as_of: 'DateLike | None' = None, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| index | str | int | InstrumentRef | required | Exact index code (string/int/InstrumentRef) or exact normalized catalog name. No first-match guess. |
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| as_of | DateLike | None | None | Only None is supported; historical membership raises before HTTP. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
EXPERIMENTAL: fetch the reported total-market index-effect records and preserve every source field in source_fields. impact_points/unit remain unknown until the live economic mapping is verified. This does not compute index impact or address arbitrary indices.
get_index_impact(*, market: 'Market | str' = <Market.TSE: 'TSE'>, limit: 'int' = 7, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| limit | int | 7 | Positive cap. For download_market at most 10000 entries; default 100 and request budget still applies. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Yield freshly fetched full snapshots with bounded polling, not WebSocket deltas. A one-second local lower bound is not an exchange rate-limit promise. max_updates=None opts into indefinite polling. Cancel/close the iterator or interrupt execution to stop; exceptions propagate, no infinite retry.
watch_market(*, interval: 'float' = 10.0, max_updates: 'int | None' = 10, market: 'Market | str | None' = None, include_order_book: 'bool' = False, include_client_types: 'bool' = False, show_traded: 'bool' = False, backend: 'str' = 'auto') -> 'Iterator[pd.DataFrame]'
Output: Iterator[pd.DataFrame]
| Parameter | Type | Default | Description |
|---|---|---|---|
| interval | float | 10.0 | Polling sleep seconds after the previous returned snapshot; local minimum 1 second, not an exchange limit. |
| max_updates | int | None | 10 | Maximum yielded snapshots (default 10); None explicitly opts into indefinite polling. |
| market | Market | str | None | None | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| include_order_book | bool | False | Add reported depth 1..5 columns with separate provenance; no forward fill. |
| include_client_types | bool | False | Fetch and join a separate bulk response by exact ID; timestamps may be absent/different. |
| show_traded | bool | False | Return only rows with a reported positive trade_count. Unknown is not treated as proof of no trading. |
| backend | str | 'auto' | auto/json/legacy; auto uses legacy only after valid empty JSON, not after auth/HTTP/schema errors. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError
Sequential ordered batch with data/errors/requests tables. Input duplicates and empty successes have separate request rows. on_error=raise includes partial_result; collect reports per-item errors without claiming completeness.
get_client_types_many(instruments: 'Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray', *, day: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, on_error: 'str' = 'raise', policy: 'FetchPolicy | str | None' = None) -> 'BatchFrames'
Output: BatchFrames
| Parameter | Type | Default | Description |
|---|---|---|---|
| instruments | Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray | required | Nonempty ordered list/tuple, Pandas Series/Index or a one-dimensional NumPy array. Duplicates preserved; nulls rejected. |
| day | DateLike | None | None | Optional explicit single Gregorian/Jalali day; latest intraday index endpoint only supports None. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| on_error | str | 'raise' | 'raise' stops with partial_result; 'collect' records errors without losing other inputs. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError, BatchDataError
Sequential ordered batch with data/errors/requests tables. Input duplicates and empty successes have separate request rows. on_error=raise includes partial_result; collect reports per-item errors without claiming completeness.
get_client_type_history_many(instruments: 'Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, on_error: 'str' = 'raise', policy: 'FetchPolicy | str | None' = None) -> 'BatchFrames'
Output: BatchFrames
| Parameter | Type | Default | Description |
|---|---|---|---|
| instruments | Sequence[InstrumentLike] | pd.Series | pd.Index | np.ndarray | required | Nonempty ordered list/tuple, Pandas Series/Index or a one-dimensional NumPy array. Duplicates preserved; nulls rejected. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| on_error | str | 'raise' | 'raise' stops with partial_result; 'collect' records errors without losing other inputs. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError, BatchDataError
Sequential ordered batch with data/errors/requests tables. Input duplicates and empty successes have separate request rows. on_error=raise includes partial_result; collect reports per-item errors without claiming completeness.
get_index_history_many(indices: 'Sequence[str | int | InstrumentRef] | pd.Series | pd.Index | np.ndarray', *, market: 'Market | str | None' = <Market.TSE: 'TSE'>, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, on_error: 'str' = 'raise', policy: 'FetchPolicy | str | None' = None) -> 'BatchFrames'
Output: BatchFrames
| Parameter | Type | Default | Description |
|---|---|---|---|
| indices | Sequence[str | int | InstrumentRef] | pd.Series | pd.Index | np.ndarray | required | Ordered index names/codes, including Series/Index or a one-dimensional array; duplicates preserved. |
| market | Market | str | None | <Market.TSE: 'TSE'> | TSE/IFB/BASE enum or documented string. Support depends on endpoint; index/overview support TSE/IFB only. None never certifies historical coverage. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | Add a textual Jalali date column. It does not change the primary Gregorian date column. |
| on_error | str | 'raise' | 'raise' stops with partial_result; 'collect' records errors without losing other inputs. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError, PointInTimeUnavailableError, CoverageError, BatchDataError
Identity, quotes and raw daily history client. Construct freely; close explicitly or use ``with``. Part 3 adds file interchange and local reconciliation; adjustments, analytics and ML remain deferred. ``transport`` is a test/development hook, not a TSETMC authentication mechanism. A Client is not intended for concurrent use from multiple OS threads.
Client(*, config: 'ClientConfig | None' = None, source: 'str | None' = None, mode: 'str | None' = None, storage: 'bool | None' = None, data_dir: 'str | Path | None' = None, numeric: 'str | None' = None, credentials=None, transport: 'httpx.BaseTransport | None' = None, _namespace: 'str' = 'public')
Output: Client
| Parameter | Type | Default | Description |
|---|---|---|---|
| config | ClientConfig | None | None | Immutable ClientConfig; supplied constructor overrides take precedence. |
| source | str | None | None | get_futures uses explicitly identified separate tse_exchange gateway. Not an authenticated TSETMC provider. |
| mode | str | None | None | auto/online/offline; fresh cached responses may be reused in online. FetchPolicy.fresh() bypasses the cache. |
| storage | bool | None | None | Boolean enabling the default best-effort local response storage, or None to use config. |
| data_dir | str | Path | None | None | Directory containing dara.sqlite3. Does not move or delete old databases. |
| numeric | str | None | None | 'analysis' gives nullable Float64; 'exact' uses Decimal for price/quantity fields. Identifiers always remain text. |
| credentials | object | None | None | Reserved for official provider; any non-None value is rejected. |
| transport | httpx.BaseTransport | None | None | Explicit HTTPX transport test hook. It must never be used as an auth workaround. |
| _namespace | str | 'public' | Internal/testing cache namespace; normally leave unchanged. |
Errors: ConfigurationError, UnsupportedCapabilityError
Use within one event loop and async context manager. No hidden asyncio.run().
AsyncClient(*, config: 'ClientConfig | None' = None, source: 'str | None' = None, mode: 'str | None' = None, storage: 'bool | None' = None, data_dir: 'str | Path | None' = None, numeric: 'str | None' = None, credentials=None, transport: 'httpx.AsyncBaseTransport | None' = None, _namespace: 'str' = 'public')
Output: AsyncClient
| Parameter | Type | Default | Description |
|---|---|---|---|
| config | ClientConfig | None | None | Immutable ClientConfig; supplied constructor overrides take precedence. |
| source | str | None | None | get_futures uses explicitly identified separate tse_exchange gateway. Not an authenticated TSETMC provider. |
| mode | str | None | None | auto/online/offline; fresh cached responses may be reused in online. FetchPolicy.fresh() bypasses the cache. |
| storage | bool | None | None | Boolean enabling the default best-effort local response storage, or None to use config. |
| data_dir | str | Path | None | None | Directory containing dara.sqlite3. Does not move or delete old databases. |
| numeric | str | None | None | 'analysis' gives nullable Float64; 'exact' uses Decimal for price/quantity fields. Identifiers always remain text. |
| credentials | object | None | None | Reserved for official provider; any non-None value is rejected. |
| transport | httpx.AsyncBaseTransport | None | None | Explicit HTTPX transport test hook. It must never be used as an auth workaround. |
| _namespace | str | 'public' | Internal/testing cache namespace; normally leave unchanged. |
Errors: ConfigurationError, UnsupportedCapabilityError
ClientConfig(*, source: "Literal['public', 'official']" = 'public', mode: "Literal['auto', 'online', 'offline']" = 'auto', storage: 'StorageConfig | None' = None, network: 'NetworkConfig | None' = None, numeric: "Literal['analysis', 'exact']" = 'analysis', timezone: 'str' = 'Asia/Tehran', strict_schema: 'bool' = True)
ClientConfig(*, source: "Literal['public', 'official']" = 'public', mode: "Literal['auto', 'online', 'offline']" = 'auto', storage: 'StorageConfig | None' = None, network: 'NetworkConfig | None' = None, numeric: "Literal['analysis', 'exact']" = 'analysis', timezone: 'str' = 'Asia/Tehran', strict_schema: 'bool' = True) -> None
Output: None
| Parameter | Type | Default | Description |
|---|---|---|---|
| source | Literal['public', 'official'] | 'public' | get_futures uses explicitly identified separate tse_exchange gateway. Not an authenticated TSETMC provider. |
| mode | Literal['auto', 'online', 'offline'] | 'auto' | auto/online/offline; fresh cached responses may be reused in online. FetchPolicy.fresh() bypasses the cache. |
| storage | StorageConfig | None | None | Boolean enabling the default best-effort local response storage, or None to use config. |
| network | NetworkConfig | None | None | environment/direct/auto. direct is explicit and retains TLS verification; auto tests environment and tries direct only with permission. |
| numeric | Literal['analysis', 'exact'] | 'analysis' | 'analysis' gives nullable Float64; 'exact' uses Decimal for price/quantity fields. Identifiers always remain text. |
| timezone | str | 'Asia/Tehran' | Explicit timezone for otherwise-naive real timestamps. Daily dates remain timezone-naive. |
| strict_schema | bool | True | Validated setting; see the constructor docstring and configuration source. |
Errors: ConfigurationError
NetworkConfig(*, connect_timeout: 'float' = 5.0, read_timeout: 'float' = 20.0, operation_timeout: 'float' = 60.0, max_concurrency: 'int' = 4, max_retries: 'int' = 2, requests_per_second: 'float' = 0.5, request_budget: 'int' = 100, max_response_bytes: 'int' = 33554432, trust_env: 'bool' = True)
NetworkConfig(*, connect_timeout: 'float' = 5.0, read_timeout: 'float' = 20.0, operation_timeout: 'float' = 60.0, max_concurrency: 'int' = 4, max_retries: 'int' = 2, requests_per_second: 'float' = 0.5, request_budget: 'int' = 100, max_response_bytes: 'int' = 33554432, trust_env: 'bool' = True) -> None
Output: None
| Parameter | Type | Default | Description |
|---|---|---|---|
| connect_timeout | float | 5.0 | Validated setting; see the constructor docstring and configuration source. |
| read_timeout | float | 20.0 | Validated setting; see the constructor docstring and configuration source. |
| operation_timeout | float | 60.0 | Validated setting; see the constructor docstring and configuration source. |
| max_concurrency | int | 4 | Validated setting; see the constructor docstring and configuration source. |
| max_retries | int | 2 | Validated setting; see the constructor docstring and configuration source. |
| requests_per_second | float | 0.5 | Validated setting; see the constructor docstring and configuration source. |
| request_budget | int | 100 | Validated setting; see the constructor docstring and configuration source. |
| max_response_bytes | int | 33554432 | Validated setting; see the constructor docstring and configuration source. |
| trust_env | bool | True | Validated setting; see the constructor docstring and configuration source. |
Errors: ConfigurationError
StorageConfig(*, enabled: 'bool' = True, backend: "Literal['sqlite']" = 'sqlite', path: 'str | Path | None' = None, queue_max_jobs: 'int' = 128, queue_max_bytes: 'int' = 67108864, queue_overflow: "Literal['drop_new']" = 'drop_new', read_timeout: 'float' = 0.05, offline_read_timeout: 'float' = 30.0, busy_timeout: 'float' = 0.1, failure_cooldown: 'float' = 60.0, raw_capture: 'bool' = True)
StorageConfig(*, enabled: 'bool' = True, backend: "Literal['sqlite']" = 'sqlite', path: 'str | Path | None' = None, queue_max_jobs: 'int' = 128, queue_max_bytes: 'int' = 67108864, queue_overflow: "Literal['drop_new']" = 'drop_new', read_timeout: 'float' = 0.05, offline_read_timeout: 'float' = 30.0, busy_timeout: 'float' = 0.1, failure_cooldown: 'float' = 60.0, raw_capture: 'bool' = True) -> None
Output: None
| Parameter | Type | Default | Description |
|---|---|---|---|
| enabled | bool | True | Validated setting; see the constructor docstring and configuration source. |
| backend | Literal['sqlite'] | 'sqlite' | auto/json/legacy; auto uses legacy only after valid empty JSON, not after auth/HTTP/schema errors. |
| path | str | Path | None | None | Nonempty path string or pathlib.Path, not the working cache database for archive exports. |
| queue_max_jobs | int | 128 | Validated setting; see the constructor docstring and configuration source. |
| queue_max_bytes | int | 67108864 | Validated setting; see the constructor docstring and configuration source. |
| queue_overflow | Literal['drop_new'] | 'drop_new' | Validated setting; see the constructor docstring and configuration source. |
| read_timeout | float | 0.05 | Validated setting; see the constructor docstring and configuration source. |
| offline_read_timeout | float | 30.0 | Validated setting; see the constructor docstring and configuration source. |
| busy_timeout | float | 0.1 | Validated setting; see the constructor docstring and configuration source. |
| failure_cooldown | float | 60.0 | Validated setting; see the constructor docstring and configuration source. |
| raw_capture | bool | True | Validated setting; see the constructor docstring and configuration source. |
Errors: ConfigurationError
FreshnessPolicy(*, max_age: 'timedelta | None' = None, allow_stale: 'bool' = False, max_stale: 'timedelta | None' = None, max_source_age: 'timedelta | None' = None)
FreshnessPolicy(*, max_age: 'timedelta | None' = None, allow_stale: 'bool' = False, max_stale: 'timedelta | None' = None, max_source_age: 'timedelta | None' = None) -> None
Output: None
| Parameter | Type | Default | Description |
|---|---|---|---|
| max_age | timedelta | None | None | Validated setting; see the constructor docstring and configuration source. |
| allow_stale | bool | False | Explicit permission to use old cached data; never relabels it as live. |
| max_stale | timedelta | None | None | Optional nonnegative timedelta limiting age since response retrieval. |
| max_source_age | timedelta | None | None | Validated setting; see the constructor docstring and configuration source. |
Errors: ConfigurationError
FetchPolicy(*, mode: "Literal['auto', 'online', 'offline'] | None" = None, freshness: 'FreshnessPolicy | None' = None, coverage: "Literal['raise', 'report']" = 'report', allow_official_offline: 'bool' = False)
FetchPolicy(*, mode: "Literal['auto', 'online', 'offline'] | None" = None, freshness: 'FreshnessPolicy | None' = None, coverage: "Literal['raise', 'report']" = 'report', allow_official_offline: 'bool' = False) -> None
Output: None
| Parameter | Type | Default | Description |
|---|---|---|---|
| mode | Literal['auto', 'online', 'offline'] | None | None | auto/online/offline; fresh cached responses may be reused in online. FetchPolicy.fresh() bypasses the cache. |
| freshness | FreshnessPolicy | None | None | Explicit FreshnessPolicy, with precedence over policy freshness for quotes. |
| coverage | Literal['raise', 'report'] | 'report' | 'report' preserves unknown/partial coverage; 'raise' requires the available evidence. |
| allow_official_offline | bool | False | Validated setting; see the constructor docstring and configuration source. |
Errors: ConfigurationError
Reported price-adjustment events and price ratios. Reasons and complete corporate-action coverage are unknown; this is not a total-return algorithm.
get_adjustments(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Reported old/new share counts, not legal capital-increase classifications. All observed rows are retained.
get_share_capital_history(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Dividend history from the legacy text route. Payment/ex dates are not inferred; failed or HTML responses raise.
get_dividends(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Source-adjusted chart history, separate from raw history. Source method tsetmc_chart_a1; anchor is the last returned date. No total-return or point-in-time guarantee. Missing turnover/count/reference price stay missing.
get_adjusted_history(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Latest reported major shareholders. Empty does not prove that no major holders exist.
get_shareholders(instrument: 'InstrumentLike', *, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
History of one holder of one instrument; holder_id comes from get_shareholders, not the holding_ref. days is 1..3650; date filtering is local.
get_shareholder_history(instrument: 'InstrumentLike', holder_id: 'str | int', *, days: 'int' = 90, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| holder_id | str | int | required | Exact shareholder identifier from get_shareholders(), not a holdings-row ID. |
| days | int | 90 | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Disclosure metadata linked by TSETMC. Does not download or parse financial-statement attachments. limit is 1..1000; dates filter the returned subset only.
get_disclosures(instrument: 'InstrumentLike', *, limit: 'int' = 20, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| limit | int | 20 | Positive cap. For download_market at most 10000 entries; default 100 and request budget still applies. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Reported instrument supervisor messages, with source timestamp and original text.
get_messages(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Reported executions, current or per explicit calendar day. Same-second trades are not deduplicated. Cancellation remains unknown; only as_reported is supported. Max 31 days by default, configurable up to 366.
get_trades(instrument: 'InstrumentLike', *, day: 'DateLike | None' = None, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, max_days: 'int' = 31, cancellation: 'str' = 'as_reported', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| day | DateLike | None | None | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| max_days | int | 31 | Maximum number of calendar dates requested by an intraday operation. Default31; up to366 configurable. No holiday inference. |
| cancellation | str | 'as_reported' | as_reported only. Source cancellation semantics are not verified; no guessed cancellation filtering. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Current reported best limits (up to five depths), not a full exchange order book. Missing source timestamps stay missing.
get_order_book(instrument: 'InstrumentLike', *, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Historical best-limit updates. Sequence/reference and source position are preserved. No fill-forward or fictional complete snapshots; empty days do not prove holidays.
get_order_book_history(instrument: 'InstrumentLike', *, start: 'DateLike', end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, max_days: 'int' = 31, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | required | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| max_days | int | 31 | Maximum number of calendar dates requested by an intraday operation. Default31; up to366 configurable. No holiday inference. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Reported state/price-limit records for one day. No day means the last trading date reported by the quote, not today. Empty is not interpreted as open/unrestricted.
get_instrument_states(instrument: 'InstrumentLike', *, day: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| day | DateLike | None | None | See function contract; parameter is validated before use. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Reported state/price-limit records for one day. No day means the last trading date reported by the quote, not today. Empty is not interpreted as open/unrestricted.
get_thresholds(instrument: 'InstrumentLike', *, day: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| day | DateLike | None | None | See function contract; parameter is validated before use. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Board codes from the reviewed reference HTML table. A replaced page raises rather than returning a false empty registry.
get_boards(*, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Current observed watch instrument list only. include_inactive=True and changed_since require a historical registry and raise; suspended instruments may still be in the current watch.
get_instruments(*, market: 'Market | str | None' = None, include_inactive: 'bool' = False, changed_since: 'DateLike | None' = None, backend: 'str' = 'auto', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | None | None | See function contract; parameter is validated before use. |
| include_inactive | bool | False | Only False is supported for the current-observed instrument list; True cannot be claimed from market watch. |
| changed_since | DateLike | None | None | Not supported by the current-observed instrument list. Raises instead of inventing a historical registry. |
| backend | str | 'auto' | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Registered funds by category name/code; None explicitly fetches the ten reviewed categories. registration_no is not an ins_code.
get_funds(category: 'str | None' = 'stock', *, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| category | str | None | 'stock' | stock/mixed/fixed/market_making/vc/reit/project/commodity/private/fund, corresponding code, or None for all configured categories. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Fund detail as a one-row frame with raw fields retained. Use the registration_no from get_funds.
get_fund(registration_no: 'str | int', *, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| registration_no | str | int | required | Exact fund registration number; not ins_code. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Reported NAV stats; unit/currency not supplied by source remain unknown, not assumed from stock prices.
get_fund_nav_history(registration_no: 'str | int', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'Calendar' = 'gregorian', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| registration_no | str | int | required | Exact fund registration number; not ins_code. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | Calendar | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Public option-chain pairs expanded into one row per put/call contract. Underlying filter is optional and local. No option pricing or inferred Greeks.
get_options(underlying: 'InstrumentLike | None' = None, *, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| underlying | InstrumentLike | None | None | Optional underlying instrument filter; does not value the options. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Current futures snapshot from the separate public tse.ir exchange gateway (not TSETMC CDN). Source must be tse_exchange. Fields with unverified meanings remain in source_fields. No history or commodity-exchange completeness guarantee.
get_futures(*, source: 'str' = 'tse_exchange', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| source | str | 'tse_exchange' | get_futures uses explicitly identified separate tse_exchange gateway. Not an authenticated TSETMC provider. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
تاریخچه با رابط ساده و تقویم خودکار محدود.
history(instrument: 'InstrumentLike', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', adjustment: 'str' = 'none', include_jdate: 'bool' = False, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| adjustment | str | 'none' | See function contract; parameter is validated before use. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Simple alias for get_market_watch; no financial analysis.
market(*, market: 'Market | str | None' = None, include_order_book: 'bool' = False, include_client_types: 'bool' = False, backend: 'str' = 'auto', policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| market | Market | str | None | None | See function contract; parameter is validated before use. |
| include_order_book | bool | False | See function contract; parameter is validated before use. |
| include_client_types | bool | False | See function contract; parameter is validated before use. |
| backend | str | 'auto' | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Simple index-history alias with explicit auto-calendar policy.
index_history(index: 'str | int', *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', include_jdate: 'bool' = False, market: 'Market | str | None' = <Market.TSE: 'TSE'>, policy: 'FetchPolicy | str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| index | str | int | required | See function contract; parameter is validated before use. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| market | Market | str | None | <Market.TSE: 'TSE'> | See function contract; parameter is validated before use. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
List locally stored response families, without HTTP.
datasets() -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Inspect local storage health and file sizes, without HTTP.
storage_info() -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Read locally stored data only. Never a live request; cached results retain time and stale flags.
query(instrument: 'InstrumentLike', *, dataset: 'str' = 'history', start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', include_jdate: 'bool' = False) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| dataset | str | 'history' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
پشتیبان سازگار SQLite با WAL؛ عملیات صریح.
backup(path: 'str | Path', *, overwrite: 'bool' = False, timeout: 'float' = 30.0, flush: 'bool' = True) -> 'dict'
Output: dict
| Parameter | Type | Default | Description |
|---|---|---|---|
| path | str | Path | required | See function contract; parameter is validated before use. |
| overwrite | bool | False | Explicit permission to replace the named output only. Active working database is never an archive destination. |
| timeout | float | 30.0 | See function contract; parameter is validated before use. |
| flush | bool | True | Wait for queued writes before an explicit backup. Backup itself is SQLite-consistent, including WAL. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
دریافت گروهی، قابل ادامه و همراه گزارش خطا.
download(symbols, *, dataset: 'str' = 'history', start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', update: 'bool' = True, store: 'bool | None' = None, on_error: 'str' = 'collect', checkpoint_dir: 'str | Path | None' = None, resume: 'bool' = True, resume_max_age: 'float' = 3600.0, include_jdate: 'bool' = False, progress=None, policy: 'FetchPolicy | str | None' = None) -> 'BatchFrames'
Output: BatchFrames(data: DataFrame, requests: DataFrame, errors: DataFrame, manifest: dict)
| Parameter | Type | Default | Description |
|---|---|---|---|
| symbols | InstrumentLike | Sequence[InstrumentLike] | pd.Series | pd.Index | required | نماد یا فهرست مرتب نمادها؛ Series/Index هم پذیرفته میشود. |
| dataset | str | 'history' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| update | bool | True | History only: use bounded tail/full refresh and the local revision repository when enabled. Other datasets refresh through their own cache rules. |
| store | bool | None | None | None uses Client setting; module facade may explicitly create a client with storage False/True. Client method must agree with its config. |
| on_error | str | 'collect' | See function contract; parameter is validated before use. |
| checkpoint_dir | str | Path | None | None | Optional directory for per-input typed snapshots and a resumable job journal. None disables checkpoints. Storage failure is reported, not a fake success. |
| resume | bool | True | Reuse successfully persisted job items only while within resume_max_age; labeled as a cached snapshot, not refreshed data. |
| resume_max_age | float | 3600.0 | Maximum checkpoint age in seconds; nonnegative. resume=False or policy=fresh() bypasses checkpoint reuse. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| progress | Callable[[dict], None] | None | None | Optional synchronous callback receiving a report dict after each input. No hidden UI, telemetry or scheduling. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Update raw histories with overlap/correction handling. Default resume=False checks anew rather than reusing a job snapshot.
update(symbols, *, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', on_error: 'str' = 'collect', checkpoint_dir: 'str | Path | None' = None, resume: 'bool' = False, progress=None) -> 'BatchFrames'
Output: BatchFrames(data: DataFrame, requests: DataFrame, errors: DataFrame, manifest: dict)
| Parameter | Type | Default | Description |
|---|---|---|---|
| symbols | InstrumentLike | Sequence[InstrumentLike] | pd.Series | pd.Index | required | نماد یا فهرست مرتب نمادها؛ Series/Index هم پذیرفته میشود. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| on_error | str | 'collect' | See function contract; parameter is validated before use. |
| checkpoint_dir | str | Path | None | None | Optional directory for per-input typed snapshots and a resumable job journal. None disables checkpoints. Storage failure is reported, not a fake success. |
| resume | bool | False | Reuse successfully persisted job items only while within resume_max_age; labeled as a cached snapshot, not refreshed data. |
| progress | Callable[[dict], None] | None | None | Optional synchronous callback receiving a report dict after each input. No hidden UI, telemetry or scheduling. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Plan bounded downloads for the current watch universe. dry_run=True performs only watch retrieval; historical universe is not reconstructed.
download_market(*, dataset: 'str' = 'history', market: 'Market | str | None' = None, limit: 'int' = 100, start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', dry_run: 'bool' = True, on_error: 'str' = 'collect', checkpoint_dir: 'str | Path | None' = None) -> 'pd.DataFrame | BatchFrames'
Output: pd.DataFrame (dry_run=True) | BatchFrames (dry_run=False)
| Parameter | Type | Default | Description |
|---|---|---|---|
| dataset | str | 'history' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| market | Market | str | None | None | See function contract; parameter is validated before use. |
| limit | int | 100 | Positive cap. For download_market at most 10000 entries; default 100 and request budget still applies. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| dry_run | bool | True | True returns a plan after retrieving current watch; False executes a bounded job. Does not reconstruct a historical universe. |
| on_error | str | 'collect' | See function contract; parameter is validated before use. |
| checkpoint_dir | str | Path | None | None | Optional directory for per-input typed snapshots and a resumable job journal. None disables checkpoints. Storage failure is reported, not a fake success. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Trades for multiple inputs with explicit errors, not silent dropping.
get_trades_many(instruments, *, start, end=None, calendar='gregorian', include_jdate=False, on_error='collect', policy=None) -> 'BatchFrames'
Output: BatchFrames(data: DataFrame, requests: DataFrame, errors: DataFrame, manifest: dict)
| Parameter | Type | Default | Description |
|---|---|---|---|
| instruments | Sequence[InstrumentLike] | required | See function contract; parameter is validated before use. |
| start | object | None | required | ابتدای بازه؛ در نتیجه مشمول است. |
| end | object | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| on_error | str | 'collect' | See function contract; parameter is validated before use. |
| policy | object | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Historical best-limit updates, not full snapshots.
get_order_book_updates(instrument, *, start, end=None, calendar='gregorian', include_jdate=False, max_days=31, policy=None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| instrument | InstrumentLike | required | See function contract; parameter is validated before use. |
| start | object | None | required | ابتدای بازه؛ در نتیجه مشمول است. |
| end | object | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| max_days | int | 31 | Maximum number of calendar dates requested by an intraday operation. Default31; up to366 configurable. No holiday inference. |
| policy | object | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Save a self-describing snapshot; return only after successful commit. ``metadata=False`` omits df.attrs, not structural type/checksum information. MultiIndex/unsupported object values are rejected. No network requests. CSV + sidecar replace is not one filesystem transaction: a crash between replacements is detected by load's SHA256 check, never silently accepted.
export(df: 'pd.DataFrame', path: 'str | Path', *, format: 'str | None' = None, dataset: 'str' = 'user_data', metadata: 'bool' = True, overwrite: 'bool' = False, safe_text: 'bool' = True) -> 'WriteReceipt'
Output: WriteReceipt
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | See function contract; parameter is validated before use. |
| path | str | Path | required | See function contract; parameter is validated before use. |
| format | str | None | None | See function contract; parameter is validated before use. |
| dataset | str | 'user_data' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| metadata | bool | True | See function contract; parameter is validated before use. |
| overwrite | bool | False | Explicit permission to replace the named output only. Active working database is never an archive destination. |
| safe_text | bool | True | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Export separate files with safe deterministic filenames; no path traversal. Returns one receipt/error row per group and format. Does not delete other files.
export_many(value, directory, *, formats=('csv',), group_by='symbol', overwrite=False, on_error='collect') -> 'pd.DataFrame'Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| value | pd.DataFrame | Quote | BatchFrames | records | required | See function contract; parameter is validated before use. |
| directory | object | None | required | See function contract; parameter is validated before use. |
| formats | str | Sequence[str] | ('csv',) | One or more csv, excel/xlsx, parquet, sqlite; optional engines remain required. |
| group_by | str | 'symbol' | See function contract; parameter is validated before use. |
| overwrite | bool | False | Explicit permission to replace the named output only. Active working database is never an archive destination. |
| on_error | str | 'collect' | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Ordered data job with reports and opt-in disk checkpoints. Uses existing bounded network budget; partial success is explicit.
download_many(symbols, *, dataset: 'str' = 'history', start: 'DateLike | None' = None, end: 'DateLike | None' = None, calendar: 'str' = 'auto', update: 'bool' = True, store: 'bool | None' = None, on_error: 'str' = 'collect', checkpoint_dir: 'str | Path | None' = None, resume: 'bool' = True, resume_max_age: 'float' = 3600.0, include_jdate: 'bool' = False, progress=None, policy: 'FetchPolicy | str | None' = None) -> 'BatchFrames'
Output: BatchFrames(data: DataFrame, requests: DataFrame, errors: DataFrame, manifest: dict)
| Parameter | Type | Default | Description |
|---|---|---|---|
| symbols | InstrumentLike | Sequence[InstrumentLike] | pd.Series | pd.Index | required | نماد یا فهرست مرتب نمادها؛ Series/Index هم پذیرفته میشود. |
| dataset | str | 'history' | history, client_types, trades, order_book_history, adjustments, shares, dividends, disclosures, messages, quotes, shareholders. |
| start | DateLike | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | DateLike | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| update | bool | True | History only: use bounded tail/full refresh and the local revision repository when enabled. Other datasets refresh through their own cache rules. |
| store | bool | None | None | None uses Client setting; module facade may explicitly create a client with storage False/True. Client method must agree with its config. |
| on_error | str | 'collect' | See function contract; parameter is validated before use. |
| checkpoint_dir | str | Path | None | None | Optional directory for per-input typed snapshots and a resumable job journal. None disables checkpoints. Storage failure is reported, not a fake success. |
| resume | bool | True | Reuse successfully persisted job items only while within resume_max_age; labeled as a cached snapshot, not refreshed data. |
| resume_max_age | float | 3600.0 | Maximum checkpoint age in seconds; nonnegative. resume=False or policy=fresh() bypasses checkpoint reuse. |
| include_jdate | bool | False | See function contract; parameter is validated before use. |
| progress | Callable[[dict], None] | None | None | Optional synchronous callback receiving a report dict after each input. No hidden UI, telemetry or scheduling. |
| policy | FetchPolicy | str | None | None | FetchPolicy or auto/online/offline. Old data requires explicit stale permission; fresh() bypasses response cache. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
تنظیم ساده ارتباط بدون تغییر پنهانی تنظیمات امنیتی.
setup(*, network='environment', allow_direct=False, probe=False, storage=None, data_dir=None, mode=None, numeric=None) -> 'ClientConfig'
Output: ClientConfig
| Parameter | Type | Default | Description |
|---|---|---|---|
| network | str | 'environment' | environment/direct/auto. direct is explicit and retains TLS verification; auto tests environment and tries direct only with permission. |
| allow_direct | bool | False | Explicit permission for diagnostics to try a direct profile after environment profile; False never bypasses environment proxy implicitly. |
| probe | bool | False | Whether to validate the selected environment/direct profile. auto always performs bounded probes. |
| storage | object | None | None | See function contract; parameter is validated before use. |
| data_dir | object | None | None | See function contract; parameter is validated before use. |
| mode | object | None | None | See function contract; parameter is validated before use. |
| numeric | object | None | None | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Probe one reviewed small endpoint with explicit connection profiles. network: environment/direct/auto. auto tries direct ONLY when allow_direct=True. Does not alter configuration, disable certificate validation, or expose proxy URLs.
check_connection(*, network='environment', allow_direct=False, timeout=10.0) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| network | str | 'environment' | environment/direct/auto. direct is explicit and retains TLS verification; auto tests environment and tries direct only with permission. |
| allow_direct | bool | False | Explicit permission for diagnostics to try a direct profile after environment profile; False never bypasses environment proxy implicitly. |
| timeout | float | 10.0 | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, NetworkError, ApiError, SchemaMismatchError, DataQualityError, UnknownInstrumentError, AmbiguousInstrumentError, StaleDataError, OfflineDataUnavailableError, UnsupportedCapabilityError
Version/dependency report without network by default; no credentials or proxy URLs.
diagnose(*, live=False, network='environment', allow_direct=False) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| live | bool | False | See function contract; parameter is validated before use. |
| network | str | 'environment' | environment/direct/auto. direct is explicit and retains TLS verification; auto tests environment and tries direct only with permission. |
| allow_direct | bool | False | Explicit permission for diagnostics to try a direct profile after environment profile; False never bypasses environment proxy implicitly. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Obtain a caller-owned DataFrame; no automatic import of optional engines. Supports DataFrame, a Dara object with to_frame(), records, or BatchFrames.data. Does not invent provenance for external data.
to_pandas(value, *, copy=True) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| value | pd.DataFrame | Quote | BatchFrames | records | required | See function contract; parameter is validated before use. |
| copy | bool | True | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Use a date or (ins_code,date) index, preserving identifier strings. Multi-instrument frames automatically retain ins_code in the index.
set_date_index(df: 'pd.DataFrame', *, column='date', calendar='gregorian', by=None, sort=True, verify_unique=True) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | See function contract; parameter is validated before use. |
| column | str | 'date' | See function contract; parameter is validated before use. |
| calendar | str | 'gregorian' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| by | str | Sequence[str] | None | None | Columns to preserve alongside date in the index; multi-instrument frames default to including ins_code. |
| sort | bool | True | See function contract; parameter is validated before use. |
| verify_unique | bool | True | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Filter without mutating input. Omitted columns retain all evidence.
select(df: 'pd.DataFrame', columns=None, *, symbols=None, start=None, end=None, calendar='auto', date_column='date') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | See function contract; parameter is validated before use. |
| columns | str | Sequence[str] | None | None | Explicit column names or supported presets. No silent dropping of unknown names. |
| symbols | InstrumentLike | Sequence[InstrumentLike] | pd.Series | pd.Index | None | نماد یا فهرست مرتب نمادها؛ Series/Index هم پذیرفته میشود. |
| start | object | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | object | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
| date_column | str | 'date' | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Concatenate schema-compatible tables, preserving component provenance. Unknown schema remains unknown. Raw and adjusted data are never mixed silently.
concat(frames: 'Sequence[pd.DataFrame]', *, verify_keys=None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| frames | Sequence[pd.DataFrame] | required | See function contract; parameter is validated before use. |
| verify_keys | object | None | None | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
پوشش مشاهدهشده؛ نه تضمین کمال تاریخچه.
coverage(df: 'pd.DataFrame', *, expected_sessions=None, start=None, end=None, calendar='auto') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | See function contract; parameter is validated before use. |
| expected_sessions | Sequence[date] | pd.Series | pd.DatetimeIndex | pd.DataFrame | None | Explicit caller-supplied Gregorian session dates. No guessed holidays/halts. Missing is only relative to this list. |
| start | object | None | None | ابتدای بازه؛ در نتیجه مشمول است. |
| end | object | None | None | انتهای بازه؛ در نتیجه مشمول است. |
| calendar | str | 'auto' | auto only in simple aliases: 1200..1599 Jalali, 1800..2199 Gregorian; ambiguous/mixed years rejected. Low-level get_* retains explicit Gregorian/Jalali defaults. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Compare to caller-supplied sessions. Missing means no record, not a holiday or halt.
missing_sessions(df: 'pd.DataFrame', *, expected_sessions, date_column='date') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| df | pd.DataFrame | required | See function contract; parameter is validated before use. |
| expected_sessions | Sequence[date] | pd.Series | pd.DatetimeIndex | pd.DataFrame | required | Explicit caller-supplied Gregorian session dates. No guessed holidays/halts. Missing is only relative to this list. |
| date_column | str | 'date' | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Compare two supplied tables without fetching sources or replacing values. Currency/adjustment mismatch raises. Differences are evidence, not a verdict.
compare_sources(left: 'pd.DataFrame', right: 'pd.DataFrame', *, keys=('ins_code', 'date'), columns=None, atol=0.0, rtol=0.0) -> 'pd.DataFrame'Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| left | pd.DataFrame | required | See function contract; parameter is validated before use. |
| right | pd.DataFrame | required | See function contract; parameter is validated before use. |
| keys | Sequence[str] | ('ins_code', 'date') | Existing unique comparison keys; duplicates raise instead of a many-to-many merge. |
| columns | str | Sequence[str] | None | None | Explicit column names or supported presets. No silent dropping of unknown names. |
| atol | float | 0.0 | Nonnegative absolute tolerance for comparison of supplied data, not price rounding. |
| rtol | float | 0.0 | Nonnegative relative tolerance for comparison, no economic correctness verdict. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Runnable usage snippets. Network examples are labeled; no snippet is executed.
examples(name: 'str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| name | str | None | None | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Persian-aware API catalog, returned as a DataFrame without printing or network.
help(name: 'str | None' = None) -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| name | str | None | None | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)
Alias for schema_info; no duplicate column registry.
columns(schema: 'str' = 'daily_bars', *, numeric='analysis') -> 'pd.DataFrame'
Output: pd.DataFrame
| Parameter | Type | Default | Description |
|---|---|---|---|
| schema | str | 'daily_bars' | See function contract; parameter is validated before use. |
| numeric | str | 'analysis' | See function contract; parameter is validated before use. |
Errors: InvalidArgumentError, DataQualityError, StorageError (explicit I/O)