pydara 0.6.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydara-0.6.0a1/BUNDLE.json +18 -0
- pydara-0.6.0a1/CHANGELOG.md +12 -0
- pydara-0.6.0a1/INSTALL_WINDOWS.bat +10 -0
- pydara-0.6.0a1/LICENSE +21 -0
- pydara-0.6.0a1/MANIFEST.in +8 -0
- pydara-0.6.0a1/PKG-INFO +131 -0
- pydara-0.6.0a1/README.md +98 -0
- pydara-0.6.0a1/README_FA.md +65 -0
- pydara-0.6.0a1/SECURITY.md +33 -0
- pydara-0.6.0a1/THIRD_PARTY_NOTICES.md +44 -0
- pydara-0.6.0a1/docs/API_REFERENCE.md +2472 -0
- pydara-0.6.0a1/docs/EXTENSION_ENDPOINTS.json +182 -0
- pydara-0.6.0a1/docs/EXTENSION_SOURCES.md +36 -0
- pydara-0.6.0a1/docs/HISTORY_SCHEMA.md +73 -0
- pydara-0.6.0a1/docs/INDEX.md +8 -0
- pydara-0.6.0a1/docs/MARKET_SOURCE_EVIDENCE.json +119 -0
- pydara-0.6.0a1/docs/MIGRATION_FA.md +45 -0
- pydara-0.6.0a1/docs/PART2_SOURCES.json +27 -0
- pydara-0.6.0a1/docs/PART3_SOURCES.json +12 -0
- pydara-0.6.0a1/docs/PART3_STORAGE_SCHEMA.md +25 -0
- pydara-0.6.0a1/docs/ROADMAP_FA.md +15 -0
- pydara-0.6.0a1/docs/SOURCES.md +45 -0
- pydara-0.6.0a1/examples/01_offline_demo.ipynb +209 -0
- pydara-0.6.0a1/examples/02_live_quote.ipynb +142 -0
- pydara-0.6.0a1/examples/03_history_offline.ipynb +226 -0
- pydara-0.6.0a1/examples/04_history_live.ipynb +183 -0
- pydara-0.6.0a1/examples/05_history_async.ipynb +138 -0
- pydara-0.6.0a1/examples/06_files_offline.ipynb +137 -0
- pydara-0.6.0a1/examples/07_history_store_sync.ipynb +153 -0
- pydara-0.6.0a1/examples/08_part3_live.ipynb +131 -0
- pydara-0.6.0a1/examples/09_part3_async.ipynb +127 -0
- pydara-0.6.0a1/examples/10_data_usability_offline.ipynb +210 -0
- pydara-0.6.0a1/examples/11_pandas_validation.ipynb +155 -0
- pydara-0.6.0a1/examples/12_data_review_live.ipynb +138 -0
- pydara-0.6.0a1/examples/13_market_client_indices_offline.ipynb +185 -0
- pydara-0.6.0a1/examples/14_market_client_indices_live.ipynb +186 -0
- pydara-0.6.0a1/examples/15_market_client_indices_async.ipynb +105 -0
- pydara-0.6.0a1/examples/16_workflows_offline.ipynb +141 -0
- pydara-0.6.0a1/examples/17_extended_data_offline.ipynb +140 -0
- pydara-0.6.0a1/examples/18_release_0_5_live.ipynb +131 -0
- pydara-0.6.0a1/examples/19_workflows_async.ipynb +134 -0
- pydara-0.6.0a1/examples/async_example.py +12 -0
- pydara-0.6.0a1/install.py +105 -0
- pydara-0.6.0a1/pyproject.toml +46 -0
- pydara-0.6.0a1/setup.cfg +4 -0
- pydara-0.6.0a1/src/dara/__init__.py +13 -0
- pydara-0.6.0a1/src/dara/py.typed +0 -0
- pydara-0.6.0a1/src/dara/tse/__init__.py +469 -0
- pydara-0.6.0a1/src/dara/tse/_core/__init__.py +1 -0
- pydara-0.6.0a1/src/dara/tse/_core/exceptions.py +117 -0
- pydara-0.6.0a1/src/dara/tse/_core/models.py +184 -0
- pydara-0.6.0a1/src/dara/tse/api_catalog.json +6772 -0
- pydara-0.6.0a1/src/dara/tse/async_client.py +300 -0
- pydara-0.6.0a1/src/dara/tse/client.py +296 -0
- pydara-0.6.0a1/src/dara/tse/config.py +153 -0
- pydara-0.6.0a1/src/dara/tse/dates.py +120 -0
- pydara-0.6.0a1/src/dara/tse/diagnostics.py +86 -0
- pydara-0.6.0a1/src/dara/tse/engine.py +189 -0
- pydara-0.6.0a1/src/dara/tse/exceptions.py +2 -0
- pydara-0.6.0a1/src/dara/tse/extended.py +149 -0
- pydara-0.6.0a1/src/dara/tse/extended_client.py +228 -0
- pydara-0.6.0a1/src/dara/tse/extension_schemas.py +16 -0
- pydara-0.6.0a1/src/dara/tse/frames.py +90 -0
- pydara-0.6.0a1/src/dara/tse/friendly.py +195 -0
- pydara-0.6.0a1/src/dara/tse/history.py +254 -0
- pydara-0.6.0a1/src/dara/tse/history_models.py +17 -0
- pydara-0.6.0a1/src/dara/tse/instrument_lookup.py +140 -0
- pydara-0.6.0a1/src/dara/tse/io.py +293 -0
- pydara-0.6.0a1/src/dara/tse/market.py +281 -0
- pydara-0.6.0a1/src/dara/tse/market_batch.py +58 -0
- pydara-0.6.0a1/src/dara/tse/market_client.py +378 -0
- pydara-0.6.0a1/src/dara/tse/market_schemas.py +179 -0
- pydara-0.6.0a1/src/dara/tse/pandas_tools.py +478 -0
- pydara-0.6.0a1/src/dara/tse/providers/__init__.py +1 -0
- pydara-0.6.0a1/src/dara/tse/providers/extended.py +278 -0
- pydara-0.6.0a1/src/dara/tse/providers/history.py +169 -0
- pydara-0.6.0a1/src/dara/tse/providers/market.py +411 -0
- pydara-0.6.0a1/src/dara/tse/providers/public.py +344 -0
- pydara-0.6.0a1/src/dara/tse/reference.py +46 -0
- pydara-0.6.0a1/src/dara/tse/samples/__init__.py +52 -0
- pydara-0.6.0a1/src/dara/tse/samples/extended.py +39 -0
- pydara-0.6.0a1/src/dara/tse/samples/extended_fixture.json +239 -0
- pydara-0.6.0a1/src/dara/tse/samples/fixtures.json +44 -0
- pydara-0.6.0a1/src/dara/tse/samples/history_fixture.json +112 -0
- pydara-0.6.0a1/src/dara/tse/samples/market.py +65 -0
- pydara-0.6.0a1/src/dara/tse/samples/market_fixture.json +384 -0
- pydara-0.6.0a1/src/dara/tse/services.py +135 -0
- pydara-0.6.0a1/src/dara/tse/storage/__init__.py +1 -0
- pydara-0.6.0a1/src/dara/tse/storage/codec.py +292 -0
- pydara-0.6.0a1/src/dara/tse/storage/contracts.py +11 -0
- pydara-0.6.0a1/src/dara/tse/storage/history_store.py +329 -0
- pydara-0.6.0a1/src/dara/tse/storage/sqlite.py +394 -0
- pydara-0.6.0a1/src/dara/tse/sync.py +170 -0
- pydara-0.6.0a1/src/dara/tse/transport.py +261 -0
- pydara-0.6.0a1/src/dara/tse/workflow_client.py +122 -0
- pydara-0.6.0a1/src/dara/tse/workflows.py +348 -0
- pydara-0.6.0a1/src/pydara.egg-info/PKG-INFO +131 -0
- pydara-0.6.0a1/src/pydara.egg-info/SOURCES.txt +125 -0
- pydara-0.6.0a1/src/pydara.egg-info/dependency_links.txt +1 -0
- pydara-0.6.0a1/src/pydara.egg-info/requires.txt +22 -0
- pydara-0.6.0a1/src/pydara.egg-info/top_level.txt +1 -0
- pydara-0.6.0a1/tests/conftest.py +19 -0
- pydara-0.6.0a1/tests/test_async.py +110 -0
- pydara-0.6.0a1/tests/test_contracts.py +202 -0
- pydara-0.6.0a1/tests/test_dara_namespace.py +36 -0
- pydara-0.6.0a1/tests/test_data_usability.py +323 -0
- pydara-0.6.0a1/tests/test_dates.py +39 -0
- pydara-0.6.0a1/tests/test_extensions_v05.py +338 -0
- pydara-0.6.0a1/tests/test_file_roundtrips.py +201 -0
- pydara-0.6.0a1/tests/test_history.py +366 -0
- pydara-0.6.0a1/tests/test_history_repository.py +257 -0
- pydara-0.6.0a1/tests/test_instrument_lookup_policies.py +65 -0
- pydara-0.6.0a1/tests/test_instrument_short_api.py +62 -0
- pydara-0.6.0a1/tests/test_market_extension.py +384 -0
- pydara-0.6.0a1/tests/test_market_optional_book_regression.py +23 -0
- pydara-0.6.0a1/tests/test_storage.py +234 -0
- pydara-0.6.0a1/tests/test_unified_bundle.py +115 -0
- pydara-0.6.0a1/tests/test_windows_sqlite_close_regression.py +15 -0
- pydara-0.6.0a1/tests/test_wire_and_parsing.py +194 -0
- pydara-0.6.0a1/tools/build.py +10 -0
- pydara-0.6.0a1/tools/check_data_usability.py +66 -0
- pydara-0.6.0a1/tools/check_installation.py +41 -0
- pydara-0.6.0a1/tools/check_market_data.py +100 -0
- pydara-0.6.0a1/tools/generate_api_reference.py +166 -0
- pydara-0.6.0a1/tools/publish_pypi.ps1 +30 -0
- pydara-0.6.0a1/tools/update_bundle.py +27 -0
- pydara-0.6.0a1/tools/verify_installation.py +53 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"bundle": "pydara",
|
|
3
|
+
"bundle_revision": 1,
|
|
4
|
+
"package_version": "0.6.0a1",
|
|
5
|
+
"wheel": "dist/pydara-0.6.0a1-py3-none-any.whl",
|
|
6
|
+
"wheel_sha256": "ab1137ea6f800a4a3e6a550979134c4aea965d47857ed5ff57a9a9a0558f5f14",
|
|
7
|
+
"extras": [
|
|
8
|
+
"files",
|
|
9
|
+
"notebook"
|
|
10
|
+
],
|
|
11
|
+
"minimum_python": [
|
|
12
|
+
3,
|
|
13
|
+
12
|
|
14
|
+
],
|
|
15
|
+
"runtime_code_changed": true,
|
|
16
|
+
"runtime_files_matched": 45,
|
|
17
|
+
"scope": "Dara with the TSE data module; no analysis or ML modules yet"
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# 0.6.0a1 — Dara modular namespace
|
|
2
|
+
|
|
3
|
+
- Rename the distribution from `tse-dara` to `pydara` (Python import: `dara`).
|
|
4
|
+
- Move the complete TSE API from `tse_dara.data` to `dara.tse`.
|
|
5
|
+
- Expose only `tse` at the package root; remove unused analytics/ML placeholders.
|
|
6
|
+
- Move exceptions and internal TSE models under `dara.tse`.
|
|
7
|
+
- Update installation, build, publishing, examples and documentation.
|
|
8
|
+
- Preserve the existing cache location, SQLite schemas and archive formats.
|
|
9
|
+
- Remove obsolete release artifacts, overlay manifests and historical delivery tools.
|
|
10
|
+
|
|
11
|
+
The TSE data features of 0.5.0a4 are retained. Analysis, ML and additional
|
|
12
|
+
markets are future modules, not implemented features of this release.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
@echo off
|
|
2
|
+
setlocal
|
|
3
|
+
if not defined CONDA_PREFIX if not defined VIRTUAL_ENV (
|
|
4
|
+
echo Activate your project environment in Anaconda Prompt first.
|
|
5
|
+
echo Then run: python install.py
|
|
6
|
+
exit /b 2
|
|
7
|
+
)
|
|
8
|
+
python "%~dp0install.py" %*
|
|
9
|
+
set "RESULT=%ERRORLEVEL%"
|
|
10
|
+
endlocal & exit /b %RESULT%
|
pydara-0.6.0a1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 tse-dara contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
include LICENSE THIRD_PARTY_NOTICES.md README.md README_FA.md CHANGELOG.md SECURITY.md
|
|
2
|
+
include install.py INSTALL_WINDOWS.bat BUNDLE.json
|
|
3
|
+
recursive-include docs *.md *.json *.html
|
|
4
|
+
recursive-include tests *.py
|
|
5
|
+
recursive-include examples *.ipynb *.py
|
|
6
|
+
recursive-include tools *.py *.ps1
|
|
7
|
+
recursive-include src/dara *.json py.typed
|
|
8
|
+
global-exclude __pycache__ *.py[cod] *.sqlite3 *.sqlite3-wal *.sqlite3-shm
|
pydara-0.6.0a1/PKG-INFO
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pydara
|
|
3
|
+
Version: 0.6.0a1
|
|
4
|
+
Summary: Dara financial data modules: TSE quotes, history, typed exports and versioned local storage
|
|
5
|
+
Author: Dara contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Classifier: Development Status :: 3 - Alpha
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
10
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
11
|
+
Requires-Python: >=3.12
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
15
|
+
Requires-Dist: httpx<0.29,>=0.27
|
|
16
|
+
Requires-Dist: pandas<4,>=2.2
|
|
17
|
+
Requires-Dist: platformdirs<5,>=4
|
|
18
|
+
Requires-Dist: tzdata>=2024.1
|
|
19
|
+
Provides-Extra: excel
|
|
20
|
+
Requires-Dist: openpyxl<4,>=3.1.5; extra == "excel"
|
|
21
|
+
Provides-Extra: parquet
|
|
22
|
+
Requires-Dist: pyarrow>=19; extra == "parquet"
|
|
23
|
+
Provides-Extra: files
|
|
24
|
+
Requires-Dist: openpyxl<4,>=3.1.5; extra == "files"
|
|
25
|
+
Requires-Dist: pyarrow>=19; extra == "files"
|
|
26
|
+
Provides-Extra: test
|
|
27
|
+
Requires-Dist: pytest<10,>=8; extra == "test"
|
|
28
|
+
Provides-Extra: notebook
|
|
29
|
+
Requires-Dist: ipykernel>=6; extra == "notebook"
|
|
30
|
+
Requires-Dist: nbformat>=5; extra == "notebook"
|
|
31
|
+
Requires-Dist: nbclient>=0.10; extra == "notebook"
|
|
32
|
+
Dynamic: license-file
|
|
33
|
+
|
|
34
|
+
# Dara
|
|
35
|
+
|
|
36
|
+
Release **0.6.0a1**. Dara is a modular Python library for financial data.
|
|
37
|
+
The PyPI distribution is named **`pydara`**; its Python import is **`dara`**.
|
|
38
|
+
The currently implemented public module is **`dara.tse`**, providing TSETMC
|
|
39
|
+
quotes, instrument lookup, history, market data, sync/async workflows, Pandas
|
|
40
|
+
outputs, versioned SQLite storage and typed file exports.
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
Requires Python 3.12 or newer. After publication on PyPI:
|
|
45
|
+
|
|
46
|
+
```console
|
|
47
|
+
python -m pip install --upgrade pydara==0.6.0a1
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Optional Excel, Parquet and notebook support:
|
|
51
|
+
|
|
52
|
+
```console
|
|
53
|
+
python -m pip install --upgrade "pydara[files,notebook]==0.6.0a1"
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For a local release bundle, activate your Python environment and run
|
|
57
|
+
`python install.py` (`--core-only` omits optional file/notebook dependencies).
|
|
58
|
+
Restart the Jupyter kernel after installation or upgrade.
|
|
59
|
+
|
|
60
|
+
## Use
|
|
61
|
+
|
|
62
|
+
```python
|
|
63
|
+
from dara import tse
|
|
64
|
+
|
|
65
|
+
# Synthetic teaching data; no external request.
|
|
66
|
+
sample = tse.load_sample()
|
|
67
|
+
reference = tse.api_reference('instrument')
|
|
68
|
+
|
|
69
|
+
# Real data: network access or an eligible cache entry is required.
|
|
70
|
+
matches = tse.instrument(symbol="فولاد", on_multiple="all")
|
|
71
|
+
history = tse.history("فولاد", start="1403-01-01", end="1403-12-30")
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from dara.tse import Client, AsyncClient
|
|
76
|
+
from dara.tse.exceptions import DaraError
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Instrument lookup defaults to all matching rows. `on_multiple="first"` returns
|
|
80
|
+
the first source-ordered match; `"error"` rejects ambiguity.
|
|
81
|
+
`on_conflict="error"` checks supplied constraints. `"ins_code"` explicitly
|
|
82
|
+
prioritizes a supplied instrument code.
|
|
83
|
+
|
|
84
|
+
## Scope and data contracts
|
|
85
|
+
|
|
86
|
+
The TSE module includes public quotes/history, market watch, client types,
|
|
87
|
+
indices, reported trades/books/states/thresholds, ownership/share counts,
|
|
88
|
+
adjustment events, source-adjusted chart data, fund/NAV data, messages and
|
|
89
|
+
options. Availability depends on the source endpoint. The separate futures
|
|
90
|
+
exchange gateway is experimental. Current catalog coverage is not a complete
|
|
91
|
+
historical instrument registry. Source-adjusted data does not certify total
|
|
92
|
+
return or point-in-time history.
|
|
93
|
+
|
|
94
|
+
Analysis, ML, Bitcoin, exchange rates, gold and other countries' markets are
|
|
95
|
+
planned extensions. They are not implemented modules in this release.
|
|
96
|
+
|
|
97
|
+
Importing `dara` creates no network connection, database or worker thread.
|
|
98
|
+
Explicit offline use is `tse.FetchPolicy.offline(allow_stale=True)`.
|
|
99
|
+
A queued storage receipt is not durable storage. Preserve the JSON sidecar
|
|
100
|
+
when copying a CSV Dara archive.
|
|
101
|
+
|
|
102
|
+
## Migration from tse-dara
|
|
103
|
+
|
|
104
|
+
Replace `from tse_dara import data` with `from dara import tse`, and use
|
|
105
|
+
`tse.history(...)`, `tse.instrument(...)`, etc. Alternatively,
|
|
106
|
+
`from dara import tse as data` keeps existing local variable names.
|
|
107
|
+
Exceptions move to `dara.tse.exceptions`. The old Python namespace is not shipped.
|
|
108
|
+
|
|
109
|
+
The existing default cache path and the legacy `tse_dara` metadata key and
|
|
110
|
+
`tse-dara-frame` storage marker are retained for stored-data compatibility.
|
|
111
|
+
No user database is deleted or migrated by this rename.
|
|
112
|
+
See [migration instructions](docs/MIGRATION_FA.md).
|
|
113
|
+
|
|
114
|
+
## Documentation and development
|
|
115
|
+
|
|
116
|
+
- [Persian guide](README_FA.md)
|
|
117
|
+
- [API reference](docs/API_REFERENCE.md)
|
|
118
|
+
- [Roadmap](docs/ROADMAP_FA.md)
|
|
119
|
+
- [Third-party notices](THIRD_PARTY_NOTICES.md)
|
|
120
|
+
|
|
121
|
+
```console
|
|
122
|
+
python -m pip install -e ".[test,files]" build twine
|
|
123
|
+
python tools/generate_api_reference.py
|
|
124
|
+
python -m build --wheel --outdir dist
|
|
125
|
+
python tools/update_bundle.py
|
|
126
|
+
python -m pytest -q
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Offline/synthetic tests verify local contracts and do not certify live source
|
|
130
|
+
accuracy or endpoint availability. The code is MIT licensed; data rights are
|
|
131
|
+
separate from the code license.
|
pydara-0.6.0a1/README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# Dara
|
|
2
|
+
|
|
3
|
+
Release **0.6.0a1**. Dara is a modular Python library for financial data.
|
|
4
|
+
The PyPI distribution is named **`pydara`**; its Python import is **`dara`**.
|
|
5
|
+
The currently implemented public module is **`dara.tse`**, providing TSETMC
|
|
6
|
+
quotes, instrument lookup, history, market data, sync/async workflows, Pandas
|
|
7
|
+
outputs, versioned SQLite storage and typed file exports.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Requires Python 3.12 or newer. After publication on PyPI:
|
|
12
|
+
|
|
13
|
+
```console
|
|
14
|
+
python -m pip install --upgrade pydara==0.6.0a1
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Optional Excel, Parquet and notebook support:
|
|
18
|
+
|
|
19
|
+
```console
|
|
20
|
+
python -m pip install --upgrade "pydara[files,notebook]==0.6.0a1"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
For a local release bundle, activate your Python environment and run
|
|
24
|
+
`python install.py` (`--core-only` omits optional file/notebook dependencies).
|
|
25
|
+
Restart the Jupyter kernel after installation or upgrade.
|
|
26
|
+
|
|
27
|
+
## Use
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
from dara import tse
|
|
31
|
+
|
|
32
|
+
# Synthetic teaching data; no external request.
|
|
33
|
+
sample = tse.load_sample()
|
|
34
|
+
reference = tse.api_reference('instrument')
|
|
35
|
+
|
|
36
|
+
# Real data: network access or an eligible cache entry is required.
|
|
37
|
+
matches = tse.instrument(symbol="فولاد", on_multiple="all")
|
|
38
|
+
history = tse.history("فولاد", start="1403-01-01", end="1403-12-30")
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
from dara.tse import Client, AsyncClient
|
|
43
|
+
from dara.tse.exceptions import DaraError
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Instrument lookup defaults to all matching rows. `on_multiple="first"` returns
|
|
47
|
+
the first source-ordered match; `"error"` rejects ambiguity.
|
|
48
|
+
`on_conflict="error"` checks supplied constraints. `"ins_code"` explicitly
|
|
49
|
+
prioritizes a supplied instrument code.
|
|
50
|
+
|
|
51
|
+
## Scope and data contracts
|
|
52
|
+
|
|
53
|
+
The TSE module includes public quotes/history, market watch, client types,
|
|
54
|
+
indices, reported trades/books/states/thresholds, ownership/share counts,
|
|
55
|
+
adjustment events, source-adjusted chart data, fund/NAV data, messages and
|
|
56
|
+
options. Availability depends on the source endpoint. The separate futures
|
|
57
|
+
exchange gateway is experimental. Current catalog coverage is not a complete
|
|
58
|
+
historical instrument registry. Source-adjusted data does not certify total
|
|
59
|
+
return or point-in-time history.
|
|
60
|
+
|
|
61
|
+
Analysis, ML, Bitcoin, exchange rates, gold and other countries' markets are
|
|
62
|
+
planned extensions. They are not implemented modules in this release.
|
|
63
|
+
|
|
64
|
+
Importing `dara` creates no network connection, database or worker thread.
|
|
65
|
+
Explicit offline use is `tse.FetchPolicy.offline(allow_stale=True)`.
|
|
66
|
+
A queued storage receipt is not durable storage. Preserve the JSON sidecar
|
|
67
|
+
when copying a CSV Dara archive.
|
|
68
|
+
|
|
69
|
+
## Migration from tse-dara
|
|
70
|
+
|
|
71
|
+
Replace `from tse_dara import data` with `from dara import tse`, and use
|
|
72
|
+
`tse.history(...)`, `tse.instrument(...)`, etc. Alternatively,
|
|
73
|
+
`from dara import tse as data` keeps existing local variable names.
|
|
74
|
+
Exceptions move to `dara.tse.exceptions`. The old Python namespace is not shipped.
|
|
75
|
+
|
|
76
|
+
The existing default cache path and the legacy `tse_dara` metadata key and
|
|
77
|
+
`tse-dara-frame` storage marker are retained for stored-data compatibility.
|
|
78
|
+
No user database is deleted or migrated by this rename.
|
|
79
|
+
See [migration instructions](docs/MIGRATION_FA.md).
|
|
80
|
+
|
|
81
|
+
## Documentation and development
|
|
82
|
+
|
|
83
|
+
- [Persian guide](README_FA.md)
|
|
84
|
+
- [API reference](docs/API_REFERENCE.md)
|
|
85
|
+
- [Roadmap](docs/ROADMAP_FA.md)
|
|
86
|
+
- [Third-party notices](THIRD_PARTY_NOTICES.md)
|
|
87
|
+
|
|
88
|
+
```console
|
|
89
|
+
python -m pip install -e ".[test,files]" build twine
|
|
90
|
+
python tools/generate_api_reference.py
|
|
91
|
+
python -m build --wheel --outdir dist
|
|
92
|
+
python tools/update_bundle.py
|
|
93
|
+
python -m pytest -q
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Offline/synthetic tests verify local contracts and do not certify live source
|
|
97
|
+
accuracy or endpoint availability. The code is MIT licensed; data rights are
|
|
98
|
+
separate from the code license.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# دارا — Dara 0.6.0a1
|
|
2
|
+
|
|
3
|
+
نام نصب در PyPI برابر `pydara` و نام واردکردن در پایتون `dara` است.
|
|
4
|
+
|
|
5
|
+
دارا کتابخانهای ماژولار برای دادههای مالی است. فعلاً فقط زیرماژول عمومی
|
|
6
|
+
`tse` پیادهسازی شده و قابلیتهای نسخهٔ قبلی دادهٔ بورس را حفظ میکند.
|
|
7
|
+
|
|
8
|
+
## نصب
|
|
9
|
+
|
|
10
|
+
پس از انتشار در PyPI با Python 3.12 یا جدیدتر:
|
|
11
|
+
|
|
12
|
+
```console
|
|
13
|
+
python -m pip install --upgrade pydara==0.6.0a1
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
برای Excel، Parquet و Notebook:
|
|
17
|
+
|
|
18
|
+
```console
|
|
19
|
+
python -m pip install --upgrade "pydara[files,notebook]==0.6.0a1"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
نصب محلی بستهٔ آماده: `python install.py` در محیط پایتون فعال.
|
|
23
|
+
پس از نصب یا ارتقا، Kernel ژوپیتر را Restart کنید.
|
|
24
|
+
|
|
25
|
+
## شروع
|
|
26
|
+
|
|
27
|
+
```python
|
|
28
|
+
from dara import tse
|
|
29
|
+
|
|
30
|
+
sample = tse.load_sample() # دادهٔ مصنوعی، بدون شبکه
|
|
31
|
+
reference = tse.api_reference("instrument")
|
|
32
|
+
|
|
33
|
+
# نیازمند اتصال شبکه یا کش مجاز
|
|
34
|
+
matches = tse.instrument(symbol="فولاد", on_multiple="all")
|
|
35
|
+
history = tse.history("فولاد", start="1403-01-01", end="1403-12-30")
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
from dara.tse import Client, AsyncClient
|
|
40
|
+
from dara.tse.exceptions import DaraError
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## سیاست شناسایی ابزار
|
|
44
|
+
|
|
45
|
+
`on_multiple="all"` پیشفرض است و همهٔ نتایج منطبق را میدهد.
|
|
46
|
+
`"first"` اولین مورد با ترتیب منبع و `"error"` خطا در صورت ابهام را انتخاب میکند.
|
|
47
|
+
`on_conflict="error"` شروط دادهشده را بررسی میکند؛ `"ins_code"` فقط با
|
|
48
|
+
کد صریح اجازهٔ اولویت دادن به کد را میدهد.
|
|
49
|
+
|
|
50
|
+
## مهاجرت و دادههای قبلی
|
|
51
|
+
|
|
52
|
+
شرح کامل در [راهنمای مهاجرت](docs/MIGRATION_FA.md) است.
|
|
53
|
+
نام قبلی `tse_dara.data` به `dara.tse` تبدیل شده است.
|
|
54
|
+
برای کمترین تغییر میتوان `from dara import tse as data` نوشت.
|
|
55
|
+
مسیر کش و قرارداد متادیتای فایلهای ذخیرهشده حفظ شدهاند؛ پایگاه دادهٔ کاربر حذف نمیشود.
|
|
56
|
+
|
|
57
|
+
## دامنه و محدودیت
|
|
58
|
+
|
|
59
|
+
قیمت، تاریخچه، ابزارها، دیدهبان، مشتریان، شاخصها، عملیات گروهی، ذخیرهٔ SQLite
|
|
60
|
+
و خروجی فایل در `tse` در دسترساند؛ پوشش هر خروجی به سرویس منبع وابسته است.
|
|
61
|
+
آزمونهای مصنوعی، صحت یا دسترسی لحظهای سرویس واقعی را تضمین نمیکنند.
|
|
62
|
+
ماژولهای تحلیل و ML و دادههای بیتکوین، دلار، طلا و بازارهای خارجی فعلاً در نقشهٔ راه هستند.
|
|
63
|
+
|
|
64
|
+
مرجع امضاها: [API_REFERENCE.md](docs/API_REFERENCE.md).
|
|
65
|
+
برای مشاهدهٔ مرجع بدون شبکه از `tse.api_reference()` استفاده کنید.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Security and operational notes
|
|
2
|
+
|
|
3
|
+
No API credentials are needed or accepted in this release. No telemetry, trading,
|
|
4
|
+
account access, proxy rotation, TLS bypass, or package auto-update is performed.
|
|
5
|
+
Requests target a fixed HTTPS base URL; redirects are not followed. Response
|
|
6
|
+
bytes are capped; malformed JSON and duplicate keys are rejected. Only validated
|
|
7
|
+
responses enter the cache. Never send credentials or tokens in issue reports.
|
|
8
|
+
|
|
9
|
+
Do not treat a fresh retrieval timestamp as proof of fresh exchange data.
|
|
10
|
+
Unit normalization is deliberately narrow and unverified instruments carry
|
|
11
|
+
unknown units. The fixture suite is not an independent security audit.
|
|
12
|
+
|
|
13
|
+
No background network polling is started. The optional background writer only
|
|
14
|
+
persists data already obtained by an explicit user operation. Stop/close clients
|
|
15
|
+
when finished, and explicitly flush when durability is required.
|
|
16
|
+
|
|
17
|
+
The supplied license covers code, not permission to redistribute exchange data.
|
|
18
|
+
A public endpoint does not imply unlimited access or a service-level guarantee.
|
|
19
|
+
|
|
20
|
+
Daily-history cache versions are response observations, not certified publication history.
|
|
21
|
+
Do not use raw or retroactively adjusted daily data as point-in-time ML evidence.
|
|
22
|
+
|
|
23
|
+
Part 3 adds inert tagged serialization, not pickle or eval. Structural dtype
|
|
24
|
+
parsing uses an allowlist. Hashes detect accidental corruption, not malicious
|
|
25
|
+
rewriting of data and hashes together. XLSX formulas are not executed;
|
|
26
|
+
metadata is not encrypted. CSV+sidecar are two files, not an atomic pair.
|
|
27
|
+
Readers are eager and file-size limits are not a universal sandbox against
|
|
28
|
+
all compressed-format resource-exhaustion attacks. Only open trusted archives.
|
|
29
|
+
|
|
30
|
+
Normalized history stores observation versions. `committed_at` is the writer's
|
|
31
|
+
transaction timestamp, not a metrologically precise post-fsync timestamp.
|
|
32
|
+
Local as_of is based on recorded timestamps and does not certify an exchange
|
|
33
|
+
publication time or a sub-second, crash-consistent replay of database visibility.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Third-party attribution
|
|
2
|
+
|
|
3
|
+
## Calendar arithmetic
|
|
4
|
+
|
|
5
|
+
The `_nowruz` routine in `src/dara/tse/dates.py` adapts the
|
|
6
|
+
`jalCalCore` calendar-cycle calculation from **jalaali-js**, based on the
|
|
7
|
+
Borkowski Persian-calendar algorithm. Python date arithmetic and validation
|
|
8
|
+
around it are implemented for Dara. Supported Jalali dates are intentionally
|
|
9
|
+
restricted to years 1200..1599, not the full upstream interval.
|
|
10
|
+
|
|
11
|
+
Source inspected 2026-10-13:
|
|
12
|
+
https://github.com/jalaali/jalaali-js/blob/master/src/index.ts
|
|
13
|
+
Git blob SHA: 14309485f93dd8eff2e30d7ba20ba38115457a74
|
|
14
|
+
License source: https://raw.githubusercontent.com/jalaali/jalaali-js/master/LICENSE
|
|
15
|
+
|
|
16
|
+
MIT License
|
|
17
|
+
|
|
18
|
+
Copyright (c) 2020 Behrang Norouzinia
|
|
19
|
+
|
|
20
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
21
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
22
|
+
in the Software without restriction, including without limitation the rights
|
|
23
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
24
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
25
|
+
furnished to do so, subject to the following conditions:
|
|
26
|
+
|
|
27
|
+
The above copyright notice and this permission notice shall be included in all
|
|
28
|
+
copies or substantial portions of the Software.
|
|
29
|
+
|
|
30
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
31
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
32
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
33
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
34
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
35
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
36
|
+
SOFTWARE.
|
|
37
|
+
|
|
38
|
+
## TSETMC access
|
|
39
|
+
|
|
40
|
+
TSETMC and its data are not owned by this project. This package does not
|
|
41
|
+
include market data; bundled sample responses are explicitly synthetic.
|
|
42
|
+
The MIT code license does not grant market-data redistribution permissions.
|
|
43
|
+
API paths/schema were reviewed using 5j9/tsetmc's source; its GPL code is not
|
|
44
|
+
bundled or made a runtime dependency. No authenticated API is guessed.
|