osa-py 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 (67) hide show
  1. osa_py-0.1.0/.github/workflows/ci.yml +38 -0
  2. osa_py-0.1.0/.github/workflows/publish.yml +20 -0
  3. osa_py-0.1.0/.gitignore +222 -0
  4. osa_py-0.1.0/.pre-commit-config.yaml +34 -0
  5. osa_py-0.1.0/Justfile +37 -0
  6. osa_py-0.1.0/LICENSE +190 -0
  7. osa_py-0.1.0/PKG-INFO +124 -0
  8. osa_py-0.1.0/README.md +100 -0
  9. osa_py-0.1.0/osa/__init__.py +36 -0
  10. osa_py-0.1.0/osa/_registry.py +141 -0
  11. osa_py-0.1.0/osa/authoring/__init__.py +13 -0
  12. osa_py-0.1.0/osa/authoring/convention.py +38 -0
  13. osa_py-0.1.0/osa/authoring/hook.py +37 -0
  14. osa_py-0.1.0/osa/authoring/ingester.py +37 -0
  15. osa_py-0.1.0/osa/authoring/validator.py +5 -0
  16. osa_py-0.1.0/osa/cli/__init__.py +0 -0
  17. osa_py-0.1.0/osa/cli/_ingestion_commands.py +79 -0
  18. osa_py-0.1.0/osa/cli/_runtime_commands.py +50 -0
  19. osa_py-0.1.0/osa/cli/credentials.py +167 -0
  20. osa_py-0.1.0/osa/cli/deploy.py +451 -0
  21. osa_py-0.1.0/osa/cli/ingestion.py +87 -0
  22. osa_py-0.1.0/osa/cli/link.py +71 -0
  23. osa_py-0.1.0/osa/cli/login.py +159 -0
  24. osa_py-0.1.0/osa/cli/logout.py +22 -0
  25. osa_py-0.1.0/osa/cli/main.py +147 -0
  26. osa_py-0.1.0/osa/manifest.py +174 -0
  27. osa_py-0.1.0/osa/py.typed +0 -0
  28. osa_py-0.1.0/osa/runtime/__init__.py +7 -0
  29. osa_py-0.1.0/osa/runtime/entrypoint.py +239 -0
  30. osa_py-0.1.0/osa/runtime/ingester_context.py +89 -0
  31. osa_py-0.1.0/osa/runtime/ingester_entrypoint.py +199 -0
  32. osa_py-0.1.0/osa/runtime/logging.py +39 -0
  33. osa_py-0.1.0/osa/testing/__init__.py +7 -0
  34. osa_py-0.1.0/osa/testing/harness.py +69 -0
  35. osa_py-0.1.0/osa/types/__init__.py +16 -0
  36. osa_py-0.1.0/osa/types/files.py +65 -0
  37. osa_py-0.1.0/osa/types/ingester.py +50 -0
  38. osa_py-0.1.0/osa/types/record.py +58 -0
  39. osa_py-0.1.0/osa/types/schema.py +136 -0
  40. osa_py-0.1.0/pyproject.toml +53 -0
  41. osa_py-0.1.0/tests/__init__.py +0 -0
  42. osa_py-0.1.0/tests/fixtures/config.json +1 -0
  43. osa_py-0.1.0/tests/fixtures/files/ligands.sdf +6 -0
  44. osa_py-0.1.0/tests/fixtures/files/sample.pdb +6 -0
  45. osa_py-0.1.0/tests/fixtures/record.json +1 -0
  46. osa_py-0.1.0/tests/test_cli.py +118 -0
  47. osa_py-0.1.0/tests/test_convention.py +149 -0
  48. osa_py-0.1.0/tests/test_convention_v2.py +250 -0
  49. osa_py-0.1.0/tests/test_credentials.py +259 -0
  50. osa_py-0.1.0/tests/test_deploy.py +49 -0
  51. osa_py-0.1.0/tests/test_deploy_auth.py +97 -0
  52. osa_py-0.1.0/tests/test_deploy_v2.py +343 -0
  53. osa_py-0.1.0/tests/test_entrypoint_new.py +362 -0
  54. osa_py-0.1.0/tests/test_files.py +64 -0
  55. osa_py-0.1.0/tests/test_harness.py +146 -0
  56. osa_py-0.1.0/tests/test_hook_decorator.py +199 -0
  57. osa_py-0.1.0/tests/test_ingester_entrypoint.py +183 -0
  58. osa_py-0.1.0/tests/test_ingester_types.py +98 -0
  59. osa_py-0.1.0/tests/test_ingestion.py +168 -0
  60. osa_py-0.1.0/tests/test_link.py +121 -0
  61. osa_py-0.1.0/tests/test_login.py +238 -0
  62. osa_py-0.1.0/tests/test_logout.py +45 -0
  63. osa_py-0.1.0/tests/test_new_manifest.py +186 -0
  64. osa_py-0.1.0/tests/test_record.py +108 -0
  65. osa_py-0.1.0/tests/test_schema.py +105 -0
  66. osa_py-0.1.0/tests/test_to_field_definitions.py +109 -0
  67. osa_py-0.1.0/uv.lock +426 -0
@@ -0,0 +1,38 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: astral-sh/setup-uv@v4
15
+ with:
16
+ enable-cache: true
17
+ cache-dependency-glob: "uv.lock"
18
+ - uses: taiki-e/install-action@just
19
+ - run: uv sync --frozen --dev
20
+ - run: just lint
21
+
22
+ test:
23
+ runs-on: ubuntu-latest
24
+ strategy:
25
+ matrix:
26
+ python-version: ["3.13", "3.14"]
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ - uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+ - uses: astral-sh/setup-uv@v4
33
+ with:
34
+ enable-cache: true
35
+ cache-dependency-glob: "uv.lock"
36
+ - uses: taiki-e/install-action@just
37
+ - run: uv sync --frozen --dev
38
+ - run: just test
@@ -0,0 +1,20 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ permissions:
8
+ id-token: write
9
+
10
+ jobs:
11
+ publish:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+ - uses: astral-sh/setup-uv@v4
16
+ with:
17
+ enable-cache: true
18
+ cache-dependency-glob: "uv.lock"
19
+ - run: uv build
20
+ - run: uv publish
@@ -0,0 +1,222 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[codz]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib64/
18
+ parts/
19
+ sdist/
20
+ var/
21
+ wheels/
22
+ share/python-wheels/
23
+ *.egg-info/
24
+ .installed.cfg
25
+ *.egg
26
+ MANIFEST
27
+
28
+ # PyInstaller
29
+ # Usually these files are written by a python script from a template
30
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
31
+ *.manifest
32
+ *.spec
33
+
34
+ # Installer logs
35
+ pip-log.txt
36
+ pip-delete-this-directory.txt
37
+
38
+ # Unit test / coverage reports
39
+ htmlcov/
40
+ .tox/
41
+ .nox/
42
+ .coverage
43
+ .coverage.*
44
+ .cache
45
+ nosetests.xml
46
+ coverage.xml
47
+ *.cover
48
+ *.py.cover
49
+ .hypothesis/
50
+ .pytest_cache/
51
+ cover/
52
+
53
+ # Translations
54
+ *.mo
55
+ *.pot
56
+
57
+ # Django stuff:
58
+ *.log
59
+ local_settings.py
60
+ db.sqlite3
61
+ db.sqlite3-journal
62
+
63
+ # Flask stuff:
64
+ instance/
65
+ .webassets-cache
66
+
67
+ # Scrapy stuff:
68
+ .scrapy
69
+
70
+ # Sphinx documentation
71
+ docs/_build/
72
+
73
+ # PyBuilder
74
+ .pybuilder/
75
+ target/
76
+
77
+ # Jupyter Notebook
78
+ .ipynb_checkpoints
79
+
80
+ # IPython
81
+ profile_default/
82
+ ipython_config.py
83
+
84
+ # pyenv
85
+ # For a library or package, you might want to ignore these files since the code is
86
+ # intended to run in multiple environments; otherwise, check them in:
87
+ # .python-version
88
+
89
+ # pipenv
90
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
91
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
92
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
93
+ # install all needed dependencies.
94
+ # Pipfile.lock
95
+
96
+ # UV
97
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
98
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
99
+ # commonly ignored for libraries.
100
+ # uv.lock
101
+
102
+ # poetry
103
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
104
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
105
+ # commonly ignored for libraries.
106
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
107
+ # poetry.lock
108
+ # poetry.toml
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
113
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
114
+ # pdm.lock
115
+ # pdm.toml
116
+ .pdm-python
117
+ .pdm-build/
118
+
119
+ # pixi
120
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
121
+ # pixi.lock
122
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
123
+ # in the .venv directory. It is recommended not to include this directory in version control.
124
+ .pixi
125
+
126
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
127
+ __pypackages__/
128
+
129
+ # Celery stuff
130
+ celerybeat-schedule
131
+ celerybeat.pid
132
+
133
+ # Redis
134
+ *.rdb
135
+ *.aof
136
+ *.pid
137
+
138
+ # RabbitMQ
139
+ mnesia/
140
+ rabbitmq/
141
+ rabbitmq-data/
142
+
143
+ # ActiveMQ
144
+ activemq-data/
145
+
146
+ # SageMath parsed files
147
+ *.sage.py
148
+
149
+ # Environments
150
+ .env
151
+ .envrc
152
+ .venv
153
+ env/
154
+ venv/
155
+ ENV/
156
+ env.bak/
157
+ venv.bak/
158
+
159
+ # Spyder project settings
160
+ .spyderproject
161
+ .spyproject
162
+
163
+ # Rope project settings
164
+ .ropeproject
165
+
166
+ # mkdocs documentation
167
+ /site
168
+
169
+ # mypy
170
+ .mypy_cache/
171
+ .dmypy.json
172
+ dmypy.json
173
+
174
+ # Pyre type checker
175
+ .pyre/
176
+
177
+ # pytype static type analyzer
178
+ .pytype/
179
+
180
+ # Cython debug symbols
181
+ cython_debug/
182
+
183
+ # PyCharm
184
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
185
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
186
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
187
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
188
+ # .idea/
189
+
190
+ # Abstra
191
+ # Abstra is an AI-powered process automation framework.
192
+ # Ignore directories containing user credentials, local state, and settings.
193
+ # Learn more at https://abstra.io/docs
194
+ .abstra/
195
+
196
+ # Visual Studio Code
197
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
198
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
199
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
200
+ # you could uncomment the following to ignore the entire vscode folder
201
+ # .vscode/
202
+
203
+ # Ruff stuff:
204
+ .ruff_cache/
205
+
206
+ # PyPI configuration file
207
+ .pypirc
208
+
209
+ # Marimo
210
+ marimo/_static/
211
+ marimo/_lsp/
212
+ __marimo__/
213
+
214
+ # Streamlit
215
+ .streamlit/secrets.toml
216
+
217
+ # Docker
218
+ .docker/
219
+
220
+ # Environment
221
+ .env
222
+ !.env.example
@@ -0,0 +1,34 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v6.0.0
4
+ hooks:
5
+ - id: check-yaml
6
+ - id: check-json
7
+ - id: check-toml
8
+ - id: check-merge-conflict
9
+ - id: end-of-file-fixer
10
+ - id: trailing-whitespace
11
+
12
+ - repo: https://github.com/astral-sh/ruff-pre-commit
13
+ rev: v0.14.10
14
+ hooks:
15
+ - id: ruff-check
16
+ args: [--fix]
17
+ - id: ruff-format
18
+
19
+ - repo: local
20
+ hooks:
21
+ - id: ty-check
22
+ name: ty type check
23
+ entry: uv run ty check osa
24
+ language: system
25
+ types: [python]
26
+ pass_filenames: false
27
+
28
+ - id: unit-tests
29
+ name: unit tests
30
+ entry: uv run pytest tests/ -q --tb=short
31
+ language: system
32
+ types: [python]
33
+ pass_filenames: false
34
+ stages: [pre-commit]
osa_py-0.1.0/Justfile ADDED
@@ -0,0 +1,37 @@
1
+ default:
2
+ @just --list
3
+
4
+ # Run all checks (lint, typecheck, test)
5
+ check: lint test
6
+
7
+ # Run tests
8
+ test *args:
9
+ uv run pytest tests/ -v --tb=short {{ args }}
10
+
11
+ # Run tests with coverage
12
+ coverage:
13
+ uv run pytest tests/ --cov=osa --cov-report=term-missing
14
+
15
+ # Lint and format check
16
+ lint:
17
+ uv run ruff check osa/ tests/
18
+ uv run ruff format --check osa/ tests/
19
+ uv run ty check osa
20
+
21
+ # Auto-fix lint errors and format
22
+ fix:
23
+ uv run ruff check osa/ tests/ --fix
24
+ uv run ruff format osa/ tests/
25
+
26
+ # Build the package
27
+ build:
28
+ uv build
29
+
30
+ # Clean build artifacts
31
+ clean:
32
+ rm -rf dist/ build/ *.egg-info
33
+ find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
34
+
35
+ # Install in development mode
36
+ dev:
37
+ uv sync
osa_py-0.1.0/LICENSE ADDED
@@ -0,0 +1,190 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to the Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by the Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding any notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ Copyright 2025 Open Science Archive contributors
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
osa_py-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,124 @@
1
+ Metadata-Version: 2.4
2
+ Name: osa-py
3
+ Version: 0.1.0
4
+ Summary: OSA Python SDK — validators and transforms for the Open Scientific Archive
5
+ Project-URL: Homepage, https://github.com/opensciencearchive/osa-py
6
+ Project-URL: Repository, https://github.com/opensciencearchive/osa-py
7
+ Project-URL: Issues, https://github.com/opensciencearchive/osa-py/issues
8
+ Author-email: Rory Byrne <rory@rory.bio>
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: archive,metadata,oci,scientific-data,validation
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Intended Audience :: Science/Research
15
+ Classifier: License :: OSI Approved :: Apache Software License
16
+ Classifier: Programming Language :: Python :: 3.13
17
+ Classifier: Topic :: Scientific/Engineering
18
+ Requires-Python: >=3.13
19
+ Requires-Dist: httpx>=0.27
20
+ Requires-Dist: pydantic>=2
21
+ Requires-Dist: pyyaml>=6.0.3
22
+ Requires-Dist: typer>=0.23.1
23
+ Description-Content-Type: text/markdown
24
+
25
+ <img src="https://opensciencearchive.org/osa_logo.svg" alt="OSA" width="64" />
26
+
27
+ # OSA Python SDK
28
+
29
+ The developer toolkit for the [Open Science Archive](https://github.com/opensciencearchive/server) — define metadata schemas, write validation hooks, build ingesters, and deploy conventions.
30
+
31
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue?style=flat-square)](LICENSE)
32
+ [![Python](https://img.shields.io/badge/python-≥3.13-blue?style=flat-square)](https://python.org)
33
+
34
+ > **Pre-release** — APIs will change without notice.
35
+
36
+ ---
37
+
38
+ ## Install
39
+
40
+ ```bash
41
+ pip install osa
42
+ ```
43
+
44
+ ## Quickstart
45
+
46
+ Define a schema, write a hook, register a convention:
47
+
48
+ ```python
49
+ from osa import Schema, Field, Record, Reject, hook, convention
50
+
51
+ class Crystal(Schema, id="crystal-structure"):
52
+ pdb_id: str
53
+ resolution: float = Field(unit="Å")
54
+ method: str
55
+
56
+ @hook
57
+ def resolution_check(record: Record[Crystal]) -> None:
58
+ if record.metadata.resolution > 3.5:
59
+ raise Reject("Resolution too low for inclusion")
60
+
61
+ convention(
62
+ title="Crystal Structures",
63
+ schema=Crystal,
64
+ hooks=[resolution_check],
65
+ files={"extensions": [".cif"], "min_count": 1},
66
+ )
67
+ ```
68
+
69
+ ## Testing
70
+
71
+ Test hooks in-process without Docker:
72
+
73
+ ```python
74
+ from osa.testing import run_hook
75
+
76
+ run_hook(resolution_check, meta={"pdb_id": "1ABC", "resolution": 2.1, "method": "X-ray"})
77
+ ```
78
+
79
+ ## Deploy
80
+
81
+ ```bash
82
+ osa link --server https://my-archive.org
83
+ osa login
84
+ osa deploy
85
+ ```
86
+
87
+ ## CLI reference
88
+
89
+ | Command | Description |
90
+ |---|---|
91
+ | `osa link --server <url>` | Link project to an archive server |
92
+ | `osa login` | Authenticate via device flow |
93
+ | `osa logout` | Remove stored credentials |
94
+ | `osa deploy` | Build OCI images and register conventions |
95
+ | `osa meta` | Print the convention manifest |
96
+ | `osa ingestion start` | Trigger an ingestion run |
97
+
98
+ ## Concepts
99
+
100
+ **Schema** — a Pydantic model defining typed metadata fields for a convention.
101
+
102
+ **Hook** — a pure function decorated with `@hook` that receives a `Record[T]` and returns structured results. Hooks run as OCI containers with a filesystem I/O contract.
103
+
104
+ **Convention** — a bundle of a schema, hooks, file requirements, and an optional ingester.
105
+
106
+ **Ingester** — an async generator that pulls records from external systems into the archive on a schedule.
107
+
108
+ **Record\[T\]** — generic container binding a schema type to its metadata, files, and SRN.
109
+
110
+ ## Project structure
111
+
112
+ ```
113
+ osa/
114
+ ├── __init__.py # Public API
115
+ ├── authoring/ # @hook, convention(), Reject, Ingester
116
+ ├── types/ # Schema, Record, Field, File
117
+ ├── runtime/ # OCI entrypoints (osa-run-hook, osa-run-ingester)
118
+ ├── testing/ # run_hook() test harness
119
+ └── cli/ # osa command (login, deploy, link, ...)
120
+ ```
121
+
122
+ ## License
123
+
124
+ [Apache 2.0](LICENSE)