tessera-api 0.1.0__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.
Files changed (51) hide show
  1. tessera_api-0.1.0/.github/workflows/ci.yml +44 -0
  2. tessera_api-0.1.0/.github/workflows/codegen-check.yml +38 -0
  3. tessera_api-0.1.0/.github/workflows/docs.yml +38 -0
  4. tessera_api-0.1.0/.github/workflows/release.yml +36 -0
  5. tessera_api-0.1.0/.gitignore +221 -0
  6. tessera_api-0.1.0/LICENSE +674 -0
  7. tessera_api-0.1.0/Makefile +40 -0
  8. tessera_api-0.1.0/PKG-INFO +140 -0
  9. tessera_api-0.1.0/README.md +98 -0
  10. tessera_api-0.1.0/docs/api.md +25 -0
  11. tessera_api-0.1.0/docs/datasets.md +78 -0
  12. tessera_api-0.1.0/docs/index.md +43 -0
  13. tessera_api-0.1.0/docs/quickstart.md +71 -0
  14. tessera_api-0.1.0/docs/recipes/funding-duckdb.md +35 -0
  15. tessera_api-0.1.0/docs/recipes/ohlcv-polars.md +47 -0
  16. tessera_api-0.1.0/docs/recipes/orderflow-metrics.md +34 -0
  17. tessera_api-0.1.0/examples/01_list_datasets.py +24 -0
  18. tessera_api-0.1.0/examples/02_load_one_month_polars.py +36 -0
  19. tessera_api-0.1.0/examples/03_multi_month_lazy.py +38 -0
  20. tessera_api-0.1.0/examples/04_duckdb_sql.py +26 -0
  21. tessera_api-0.1.0/examples/05_async_concurrent.py +32 -0
  22. tessera_api-0.1.0/mkdocs.yml +63 -0
  23. tessera_api-0.1.0/openapi.json +1 -0
  24. tessera_api-0.1.0/pyproject.toml +119 -0
  25. tessera_api-0.1.0/scripts/gen_models.py +61 -0
  26. tessera_api-0.1.0/src/tessera/__init__.py +68 -0
  27. tessera_api-0.1.0/src/tessera/_base.py +81 -0
  28. tessera_api-0.1.0/src/tessera/_generated/__init__.py +1 -0
  29. tessera_api-0.1.0/src/tessera/_generated/models.py +85 -0
  30. tessera_api-0.1.0/src/tessera/_resolver.py +41 -0
  31. tessera_api-0.1.0/src/tessera/_version.py +1 -0
  32. tessera_api-0.1.0/src/tessera/async_client.py +191 -0
  33. tessera_api-0.1.0/src/tessera/client.py +197 -0
  34. tessera_api-0.1.0/src/tessera/config.py +64 -0
  35. tessera_api-0.1.0/src/tessera/errors.py +145 -0
  36. tessera_api-0.1.0/src/tessera/models.py +116 -0
  37. tessera_api-0.1.0/src/tessera/py.typed +0 -0
  38. tessera_api-0.1.0/src/tessera/readers/__init__.py +5 -0
  39. tessera_api-0.1.0/src/tessera/readers/_common.py +41 -0
  40. tessera_api-0.1.0/src/tessera/readers/duckdb.py +67 -0
  41. tessera_api-0.1.0/src/tessera/readers/polars.py +70 -0
  42. tessera_api-0.1.0/tests/__init__.py +0 -0
  43. tessera_api-0.1.0/tests/conftest.py +46 -0
  44. tessera_api-0.1.0/tests/test_async_client.py +47 -0
  45. tessera_api-0.1.0/tests/test_client.py +106 -0
  46. tessera_api-0.1.0/tests/test_codegen_drift.py +28 -0
  47. tessera_api-0.1.0/tests/test_errors.py +51 -0
  48. tessera_api-0.1.0/tests/test_models.py +53 -0
  49. tessera_api-0.1.0/tests/test_readers.py +133 -0
  50. tessera_api-0.1.0/tests/test_retries.py +57 -0
  51. tessera_api-0.1.0/uv.lock +1723 -0
@@ -0,0 +1,44 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ concurrency:
9
+ group: ci-${{ github.ref }}
10
+ cancel-in-progress: true
11
+
12
+ jobs:
13
+ lint:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ enable-cache: true
21
+ - run: uv sync --all-extras
22
+ - name: Ruff lint
23
+ run: uv run ruff check .
24
+ - name: Ruff format
25
+ run: uv run ruff format --check .
26
+ - name: Pyright
27
+ run: uv run pyright
28
+
29
+ test:
30
+ runs-on: ubuntu-latest
31
+ strategy:
32
+ fail-fast: false
33
+ matrix:
34
+ python-version: ["3.10", "3.11", "3.12", "3.13"]
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - name: Install uv
38
+ uses: astral-sh/setup-uv@v5
39
+ with:
40
+ enable-cache: true
41
+ python-version: ${{ matrix.python-version }}
42
+ - run: uv sync --all-extras
43
+ - name: Run tests
44
+ run: uv run pytest -q
@@ -0,0 +1,38 @@
1
+ name: OpenAPI drift
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 6 * * 1" # Mondays 06:00 UTC
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
12
+ jobs:
13
+ check:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ enable-cache: true
21
+ - run: uv sync --all-extras
22
+ - name: Refresh vendored spec
23
+ run: make fetch-spec
24
+ - name: Regenerate models
25
+ run: make codegen
26
+ - name: Open a PR if the spec drifted
27
+ uses: peter-evans/create-pull-request@v6
28
+ with:
29
+ commit-message: "chore: sync models with updated Tessera OpenAPI spec"
30
+ title: "Sync client with updated Tessera OpenAPI spec"
31
+ branch: automated/openapi-drift
32
+ delete-branch: true
33
+ body: |
34
+ The live OpenAPI spec at https://tesseralytics.dev/v1/openapi.json changed.
35
+
36
+ This PR refreshes the vendored `openapi.json` and regenerates
37
+ `src/tessera/_generated/models.py`. Review for breaking changes,
38
+ update the hand-written client/readers if needed, then merge.
@@ -0,0 +1,38 @@
1
+ name: Docs
2
+ on:
3
+ push:
4
+ branches: [main]
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: read
9
+ id-token: write # was: contents: write (OIDC instead of gh-pages push)
10
+
11
+ concurrency:
12
+ group: docs
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ deploy:
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+ with: { fetch-depth: 0 }
21
+ - name: Install uv
22
+ uses: astral-sh/setup-uv@v5
23
+ with: { enable-cache: true }
24
+ - run: uv sync --all-extras
25
+ - name: Build site
26
+ run: uv run --group docs mkdocs build --strict # outputs to site/
27
+ - name: Configure AWS credentials
28
+ uses: aws-actions/configure-aws-credentials@v4
29
+ with:
30
+ role-to-assume: ${{ vars.AWS_DOCS_ROLE_ARN }}
31
+ aws-region: ap-northeast-1
32
+ - name: Sync to S3
33
+ run: aws s3 sync site/ s3://${{ vars.DOCS_BUCKET }}/python-client/ --delete
34
+ - name: Invalidate CloudFront
35
+ run: |
36
+ aws cloudfront create-invalidation \
37
+ --distribution-id ${{ vars.CLOUDFRONT_DISTRIBUTION_ID }} \
38
+ --paths '/python-client/*'
@@ -0,0 +1,36 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*"]
6
+
7
+ jobs:
8
+ build:
9
+ runs-on: ubuntu-latest
10
+ steps:
11
+ - uses: actions/checkout@v4
12
+ - name: Install uv
13
+ uses: astral-sh/setup-uv@v5
14
+ - name: Build sdist + wheel
15
+ run: uv build
16
+ - uses: actions/upload-artifact@v4
17
+ with:
18
+ name: dist
19
+ path: dist/
20
+
21
+ publish:
22
+ needs: build
23
+ runs-on: ubuntu-latest
24
+ # Configure a "pypi" environment with trusted publishing on PyPI.
25
+ environment:
26
+ name: pypi
27
+ url: https://pypi.org/p/tessera-api
28
+ permissions:
29
+ id-token: write # OIDC — no API token needed
30
+ steps:
31
+ - uses: actions/download-artifact@v4
32
+ with:
33
+ name: dist
34
+ path: dist/
35
+ - name: Publish to PyPI
36
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,221 @@
1
+ # mkdocs build output
2
+ site/
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[codz]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ share/python-wheels/
27
+ *.egg-info/
28
+ .installed.cfg
29
+ *.egg
30
+ MANIFEST
31
+
32
+ # PyInstaller
33
+ # Usually these files are written by a python script from a template
34
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
35
+ *.manifest
36
+ *.spec
37
+
38
+ # Installer logs
39
+ pip-log.txt
40
+ pip-delete-this-directory.txt
41
+
42
+ # Unit test / coverage reports
43
+ htmlcov/
44
+ .tox/
45
+ .nox/
46
+ .coverage
47
+ .coverage.*
48
+ .cache
49
+ nosetests.xml
50
+ coverage.xml
51
+ *.cover
52
+ *.py.cover
53
+ .hypothesis/
54
+ .pytest_cache/
55
+ cover/
56
+
57
+ # Translations
58
+ *.mo
59
+ *.pot
60
+
61
+ # Django stuff:
62
+ *.log
63
+ local_settings.py
64
+ db.sqlite3
65
+ db.sqlite3-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+
77
+ # PyBuilder
78
+ .pybuilder/
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+
84
+ # IPython
85
+ profile_default/
86
+ ipython_config.py
87
+
88
+ # pyenv
89
+ # For a library or package, you might want to ignore these files since the code is
90
+ # intended to run in multiple environments; otherwise, check them in:
91
+ # .python-version
92
+
93
+ # pipenv
94
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
95
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
96
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
97
+ # install all needed dependencies.
98
+ # Pipfile.lock
99
+
100
+ # UV
101
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
102
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
103
+ # commonly ignored for libraries.
104
+ # uv.lock
105
+
106
+ # poetry
107
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
108
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
109
+ # commonly ignored for libraries.
110
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
111
+ # poetry.lock
112
+ # poetry.toml
113
+
114
+ # pdm
115
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
116
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
117
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
118
+ # pdm.lock
119
+ # pdm.toml
120
+ .pdm-python
121
+ .pdm-build/
122
+
123
+ # pixi
124
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
125
+ # pixi.lock
126
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
127
+ # in the .venv directory. It is recommended not to include this directory in version control.
128
+ .pixi
129
+
130
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
131
+ __pypackages__/
132
+
133
+ # Celery stuff
134
+ celerybeat-schedule
135
+ celerybeat.pid
136
+
137
+ # Redis
138
+ *.rdb
139
+ *.aof
140
+ *.pid
141
+
142
+ # RabbitMQ
143
+ mnesia/
144
+ rabbitmq/
145
+ rabbitmq-data/
146
+
147
+ # ActiveMQ
148
+ activemq-data/
149
+
150
+ # SageMath parsed files
151
+ *.sage.py
152
+
153
+ # Environments
154
+ .env
155
+ .envrc
156
+ .venv
157
+ env/
158
+ venv/
159
+ ENV/
160
+ env.bak/
161
+ venv.bak/
162
+
163
+ # Spyder project settings
164
+ .spyderproject
165
+ .spyproject
166
+
167
+ # Rope project settings
168
+ .ropeproject
169
+
170
+ # mkdocs documentation
171
+ /site
172
+
173
+ # mypy
174
+ .mypy_cache/
175
+ .dmypy.json
176
+ dmypy.json
177
+
178
+ # Pyre type checker
179
+ .pyre/
180
+
181
+ # pytype static type analyzer
182
+ .pytype/
183
+
184
+ # Cython debug symbols
185
+ cython_debug/
186
+
187
+ # PyCharm
188
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
189
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
190
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
191
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
192
+ # .idea/
193
+
194
+ # Abstra
195
+ # Abstra is an AI-powered process automation framework.
196
+ # Ignore directories containing user credentials, local state, and settings.
197
+ # Learn more at https://abstra.io/docs
198
+ .abstra/
199
+
200
+ # Visual Studio Code
201
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
202
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
203
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
204
+ # you could uncomment the following to ignore the entire vscode folder
205
+ # .vscode/
206
+ # Temporary file for partial code execution
207
+ tempCodeRunnerFile.py
208
+
209
+ # Ruff stuff:
210
+ .ruff_cache/
211
+
212
+ # PyPI configuration file
213
+ .pypirc
214
+
215
+ # Marimo
216
+ marimo/_static/
217
+ marimo/_lsp/
218
+ __marimo__/
219
+
220
+ # Streamlit
221
+ .streamlit/secrets.toml