ab-openapi-python-generator 2.1.3__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 (109) hide show
  1. ab_openapi_python_generator-2.1.3/.envrc.example +5 -0
  2. ab_openapi_python_generator-2.1.3/.gitattributes +0 -0
  3. ab_openapi_python_generator-2.1.3/.github/dependabot.yml +18 -0
  4. ab_openapi_python_generator-2.1.3/.github/workflows/ci.yaml +74 -0
  5. ab_openapi_python_generator-2.1.3/.github/workflows/publish.yaml +37 -0
  6. ab_openapi_python_generator-2.1.3/.gitignore +219 -0
  7. ab_openapi_python_generator-2.1.3/.pre-commit-config.yaml +27 -0
  8. ab_openapi_python_generator-2.1.3/.vscode/launch.json +66 -0
  9. ab_openapi_python_generator-2.1.3/.vscode/tasks.json +40 -0
  10. ab_openapi_python_generator-2.1.3/LICENSE +21 -0
  11. ab_openapi_python_generator-2.1.3/Makefile +35 -0
  12. ab_openapi_python_generator-2.1.3/PKG-INFO +125 -0
  13. ab_openapi_python_generator-2.1.3/README.md +99 -0
  14. ab_openapi_python_generator-2.1.3/docs/acknowledgements/index.md +11 -0
  15. ab_openapi_python_generator-2.1.3/docs/css/custom.css +120 -0
  16. ab_openapi_python_generator-2.1.3/docs/css/termynal.css +101 -0
  17. ab_openapi_python_generator-2.1.3/docs/index.md +34 -0
  18. ab_openapi_python_generator-2.1.3/docs/js/custom.js +161 -0
  19. ab_openapi_python_generator-2.1.3/docs/js/termynal.js +197 -0
  20. ab_openapi_python_generator-2.1.3/docs/openapi-definition.md +201 -0
  21. ab_openapi_python_generator-2.1.3/docs/quick_start.md +48 -0
  22. ab_openapi_python_generator-2.1.3/docs/references/index.md +45 -0
  23. ab_openapi_python_generator-2.1.3/docs/references/module_usage.md +3 -0
  24. ab_openapi_python_generator-2.1.3/docs/tutorial/advanced.md +3 -0
  25. ab_openapi_python_generator-2.1.3/docs/tutorial/authentication.md +3 -0
  26. ab_openapi_python_generator-2.1.3/docs/tutorial/index.md +890 -0
  27. ab_openapi_python_generator-2.1.3/logo.png +0 -0
  28. ab_openapi_python_generator-2.1.3/pyproject.toml +118 -0
  29. ab_openapi_python_generator-2.1.3/src/ab_openapi_python_generator/__init__.py +13 -0
  30. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/__init__.py +17 -0
  31. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/__main__.py +85 -0
  32. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/common.py +58 -0
  33. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/generate_data.py +235 -0
  34. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/__init__.py +0 -0
  35. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/__init__.py +0 -0
  36. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/api_config_generator.py +35 -0
  37. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/common.py +58 -0
  38. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/generator.py +54 -0
  39. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/jinja_config.py +38 -0
  40. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/model_generator.py +896 -0
  41. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/service_generator.py +540 -0
  42. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/aiohttp.jinja2 +49 -0
  43. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/alias_union.jinja2 +17 -0
  44. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/apiconfig.jinja2 +38 -0
  45. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/apiconfig_pydantic_2.jinja2 +42 -0
  46. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/discriminator_enum.jinja2 +7 -0
  47. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/enum.jinja2 +11 -0
  48. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/httpx.jinja2 +126 -0
  49. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/models.jinja2 +24 -0
  50. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/models_pydantic_2.jinja2 +28 -0
  51. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/requests.jinja2 +50 -0
  52. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/language_converters/python/templates/service.jinja2 +12 -0
  53. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/models.py +101 -0
  54. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/parsers/__init__.py +13 -0
  55. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/parsers/openapi_30.py +65 -0
  56. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/parsers/openapi_31.py +65 -0
  57. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/py.typed +0 -0
  58. ab_openapi_python_generator-2.1.3/src/openapi_python_generator/version_detector.py +70 -0
  59. ab_openapi_python_generator-2.1.3/tests/__init__.py +0 -0
  60. ab_openapi_python_generator-2.1.3/tests/build_test_api/api.py +154 -0
  61. ab_openapi_python_generator-2.1.3/tests/conftest.py +42 -0
  62. ab_openapi_python_generator-2.1.3/tests/regression/__init__.py +0 -0
  63. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_11.py +33 -0
  64. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_117.py +36 -0
  65. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_120.py +36 -0
  66. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_17.py +27 -0
  67. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_30_87.py +24 -0
  68. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_51.py +27 -0
  69. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_55.py +23 -0
  70. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_7.py +34 -0
  71. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_71.py +27 -0
  72. ab_openapi_python_generator-2.1.3/tests/regression/test_issue_illegal_py_symbols.py +51 -0
  73. ab_openapi_python_generator-2.1.3/tests/test_api_config.py +10 -0
  74. ab_openapi_python_generator-2.1.3/tests/test_common_normalize_symbol.py +6 -0
  75. ab_openapi_python_generator-2.1.3/tests/test_data/failing_api.json +7 -0
  76. ab_openapi_python_generator-2.1.3/tests/test_data/gitea_issue_11.json +1 -0
  77. ab_openapi_python_generator-2.1.3/tests/test_data/issue_117.json +29 -0
  78. ab_openapi_python_generator-2.1.3/tests/test_data/issue_120.json +53 -0
  79. ab_openapi_python_generator-2.1.3/tests/test_data/issue_17.json +1038 -0
  80. ab_openapi_python_generator-2.1.3/tests/test_data/issue_30_87.json +70 -0
  81. ab_openapi_python_generator-2.1.3/tests/test_data/issue_51.json +480 -0
  82. ab_openapi_python_generator-2.1.3/tests/test_data/issue_55.json +70 -0
  83. ab_openapi_python_generator-2.1.3/tests/test_data/issue_71.json +31 -0
  84. ab_openapi_python_generator-2.1.3/tests/test_data/issue_71_31.json +42 -0
  85. ab_openapi_python_generator-2.1.3/tests/test_data/issue_illegal_character_in_operation_id.json +46 -0
  86. ab_openapi_python_generator-2.1.3/tests/test_data/issue_keyword_parameter_name.json +55 -0
  87. ab_openapi_python_generator-2.1.3/tests/test_data/openapi_gitea_converted.json +24858 -0
  88. ab_openapi_python_generator-2.1.3/tests/test_data/swagger_petstore_3_0_4.yaml +913 -0
  89. ab_openapi_python_generator-2.1.3/tests/test_data/swagger_petstore_3_1.yaml +931 -0
  90. ab_openapi_python_generator-2.1.3/tests/test_data/test_api.json +625 -0
  91. ab_openapi_python_generator-2.1.3/tests/test_data/test_api_31.json +388 -0
  92. ab_openapi_python_generator-2.1.3/tests/test_generate_data.py +193 -0
  93. ab_openapi_python_generator-2.1.3/tests/test_generate_data_negative.py +51 -0
  94. ab_openapi_python_generator-2.1.3/tests/test_generated_code.py +452 -0
  95. ab_openapi_python_generator-2.1.3/tests/test_main.py +28 -0
  96. ab_openapi_python_generator-2.1.3/tests/test_model_docstring.py +30 -0
  97. ab_openapi_python_generator-2.1.3/tests/test_model_generator.py +432 -0
  98. ab_openapi_python_generator-2.1.3/tests/test_model_generator_edges.py +133 -0
  99. ab_openapi_python_generator-2.1.3/tests/test_openapi_30.py +257 -0
  100. ab_openapi_python_generator-2.1.3/tests/test_openapi_31.py +380 -0
  101. ab_openapi_python_generator-2.1.3/tests/test_openapi_31_completeness.py +572 -0
  102. ab_openapi_python_generator-2.1.3/tests/test_openapi_31_coverage.py +445 -0
  103. ab_openapi_python_generator-2.1.3/tests/test_openapi_31_schema_features.py +441 -0
  104. ab_openapi_python_generator-2.1.3/tests/test_service_generator.py +441 -0
  105. ab_openapi_python_generator-2.1.3/tests/test_service_generator_edges.py +29 -0
  106. ab_openapi_python_generator-2.1.3/tests/test_swagger_petstore_30.py +186 -0
  107. ab_openapi_python_generator-2.1.3/tests/test_swagger_petstore_31.py +259 -0
  108. ab_openapi_python_generator-2.1.3/tests/test_version_detector_edges.py +51 -0
  109. ab_openapi_python_generator-2.1.3/tox.ini +24 -0
@@ -0,0 +1,5 @@
1
+ # NOTE: UV_PUBLISH_USERNAME & UV_PUBLISH_PASSWORD are only required for testing
2
+ # publishing this package from local. However, please let the CD workflow
3
+ # handle production workflows.
4
+ export UV_PUBLISH_USERNAME=
5
+ export UV_PUBLISH_PASSWORD=
File without changes
@@ -0,0 +1,18 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ day: "saturday"
8
+ time: "03:00"
9
+ timezone: "Australia/Melbourne"
10
+
11
+ - package-ecosystem: "pip"
12
+ directory: "/"
13
+ open-pull-requests-limit: 2
14
+ schedule:
15
+ interval: "weekly"
16
+ day: "saturday"
17
+ time: "03:00"
18
+ timezone: "Australia/Melbourne"
@@ -0,0 +1,74 @@
1
+ name: CI
2
+
3
+ permissions:
4
+ contents: read
5
+ pull-requests: write
6
+
7
+ on:
8
+ pull_request:
9
+ branches: [main]
10
+
11
+ concurrency:
12
+ group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }} - ci-pipeline"
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ lint:
17
+ if: ${{ github.actor != 'dependabot[bot]' }}
18
+ runs-on:
19
+ group: Default
20
+ timeout-minutes: 5
21
+
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+
25
+ # Install uv + Python (with cache)
26
+ - name: Install uv
27
+ uses: astral-sh/setup-uv@v6
28
+ with:
29
+ version: latest
30
+ enable-cache: true
31
+ python-version: "3.12"
32
+
33
+ # Private Git deps (optional; remove if not needed)
34
+ - name: Configure Git credentials for private deps
35
+ if: env.GH_READ_TOKEN != ''
36
+ env:
37
+ GH_READ_TOKEN: ${{ secrets.GH_READ_TOKEN }}
38
+ run: |
39
+ git config --global url."https://${GH_READ_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
40
+
41
+ - name: Sync deps
42
+ run: uv sync --extra all
43
+
44
+ - name: Lint
45
+ run: uv run tox -e lint
46
+
47
+ test:
48
+ if: ${{ github.actor != 'dependabot[bot]' }}
49
+ runs-on:
50
+ group: Default
51
+ timeout-minutes: 5
52
+ # Run in parallel with lint (remove this 'needs' to keep parallel; add needs: [lint] to serialize)
53
+ steps:
54
+ - uses: actions/checkout@v4
55
+
56
+ - name: Install uv
57
+ uses: astral-sh/setup-uv@v6
58
+ with:
59
+ version: latest
60
+ enable-cache: true
61
+ python-version: "3.12"
62
+
63
+ - name: Configure Git credentials for private deps
64
+ if: env.GH_READ_TOKEN != ''
65
+ env:
66
+ GH_READ_TOKEN: ${{ secrets.GH_READ_TOKEN }}
67
+ run: |
68
+ git config --global url."https://${GH_READ_TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
69
+
70
+ - name: Sync deps
71
+ run: uv sync --extra all
72
+
73
+ - name: Test
74
+ run: uv run tox -e test
@@ -0,0 +1,37 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ permissions: read-all
9
+
10
+ # This allows a subsequently queued workflow run to interrupt previous runs
11
+ concurrency:
12
+ group: "${{ github.workflow }} @ ${{ github.head_ref || github.ref }} - release"
13
+ cancel-in-progress: true
14
+
15
+ jobs:
16
+ publish:
17
+ runs-on:
18
+ group: Default
19
+ timeout-minutes: 5
20
+
21
+ steps:
22
+ - name: Checkout code
23
+ uses: actions/checkout@v4
24
+
25
+ - name: Install uv
26
+ uses: astral-sh/setup-uv@v6
27
+
28
+ - name: Install project Python
29
+ run: uv python install
30
+
31
+ - name: Build
32
+ run: uv build --no-sources
33
+
34
+ - name: Publish to PyPI
35
+ env:
36
+ UV_PUBLISH_TOKEN: ${{ secrets.UV_PUBLISH_TOKEN }}
37
+ run: uv publish --verbose
@@ -0,0 +1,219 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.py[codz]
5
+ *$py.class
6
+
7
+ # C extensions
8
+ *.so
9
+
10
+ # Distribution / packaging
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ pip-wheel-metadata/
25
+ share/python-wheels/
26
+ *.egg-info/
27
+ .installed.cfg
28
+ *.egg
29
+ MANIFEST
30
+
31
+ # PyInstaller
32
+ # Usually these files are written by a python script from a template
33
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,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
+ # For packages, we do not commit the lock file,
108
+ # since we are not controlling the environment,
109
+ # refer to https://python-poetry.org/docs/basic-usage/#as-a-library-developer
110
+ poetry.lock
111
+ poetry.toml
112
+
113
+ # pdm
114
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
115
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
116
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
117
+ pdm.lock
118
+ pdm.toml
119
+ .pdm-python
120
+ .pdm-build/
121
+
122
+ # pixi
123
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
124
+ pixi.lock
125
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
126
+ # in the .venv directory. It is recommended not to include this directory in version control.
127
+ .pixi
128
+
129
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
130
+ __pypackages__/
131
+
132
+ # Celery stuff
133
+ celerybeat-schedule
134
+ celerybeat.pid
135
+
136
+ # SageMath parsed files
137
+ *.sage.py
138
+
139
+ # Environments
140
+ .env
141
+ .envrc
142
+ .venv
143
+ env/
144
+ venv/
145
+ ENV/
146
+ env.bak/
147
+ venv.bak/
148
+
149
+ # Spyder project settings
150
+ .spyderproject
151
+ .spyproject
152
+
153
+ # Rope project settings
154
+ .ropeproject
155
+
156
+ # mkdocs documentation
157
+ /site
158
+
159
+ # mypy
160
+ .mypy_cache/
161
+ .dmypy.json
162
+ dmypy.json
163
+
164
+ # Pyre type checker
165
+ .pyre/
166
+ /.idea/
167
+ /testclient/
168
+ /tests/test_result/
169
+ test_output/
170
+
171
+ # pytype static type analyzer
172
+ .pytype/
173
+
174
+ # Cython debug symbols
175
+ cython_debug/
176
+
177
+ # PyCharm
178
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
179
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
180
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
181
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
182
+ #.idea/
183
+
184
+ # Abstra
185
+ # Abstra is an AI-powered process automation framework.
186
+ # Ignore directories containing user credentials, local state, and settings.
187
+ # Learn more at https://abstra.io/docs
188
+ .abstra/
189
+
190
+ # Visual Studio Code
191
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
192
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
193
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
194
+ # you could uncomment the following to ignore the entire vscode folder
195
+ #.vscode/
196
+
197
+ # Ruff stuff:
198
+ .ruff_cache/
199
+
200
+ # PyPI configuration file
201
+ .pypirc
202
+
203
+ # Cursor
204
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
205
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
206
+ # refer to https://docs.cursor.com/context/ignore-files
207
+ .cursorignore
208
+ .cursorindexingignore
209
+
210
+ # Marimo
211
+ marimo/_static/
212
+ marimo/_lsp/
213
+ __marimo__/
214
+
215
+ # Streamlit
216
+ .streamlit/secrets.toml
217
+
218
+ # Generated Files
219
+ .DS_Store
@@ -0,0 +1,27 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.4.5
4
+ hooks:
5
+ - id: ruff
6
+ args: [--fix]
7
+ name: ruff check + fix
8
+ - id: ruff-format
9
+ name: ruff format
10
+
11
+ - repo: https://github.com/codespell-project/codespell
12
+ rev: v2.2.6
13
+ hooks:
14
+ - id: codespell
15
+ args: ["--write-changes"]
16
+
17
+ - repo: https://github.com/executablebooks/mdformat
18
+ rev: 0.7.16
19
+ hooks:
20
+ - id: mdformat
21
+ args: ["--wrap", "80"]
22
+
23
+ - repo: https://github.com/pappasam/toml-sort
24
+ rev: v0.23.1
25
+ hooks:
26
+ - id: toml-sort
27
+ args: ["--all", "--in-place"]
@@ -0,0 +1,66 @@
1
+ {
2
+ "version": "0.2.0",
3
+ "configurations": [
4
+ {
5
+ "name": "pytest",
6
+ "type": "python",
7
+ "request": "launch",
8
+ "module": "pytest",
9
+ "args": ["-vv", "--no-cov"],
10
+ "justMyCode": false,
11
+ "cwd": "${workspaceFolder}",
12
+ "console": "integratedTerminal",
13
+ "env": {
14
+ "PYTHONASYNCIODEBUG": "1" // optional: helps with debugging asyncio
15
+ }
16
+ },
17
+ {
18
+ "name": "pytest: current module",
19
+ "type": "python",
20
+ "request": "launch",
21
+ "module": "pytest",
22
+ // run pytest on the directory that contains the file in the active editor
23
+ "args": ["-vv", "${fileDirname}", "--no-cov"],
24
+ "justMyCode": false,
25
+ "cwd": "${workspaceFolder}",
26
+ "console": "integratedTerminal",
27
+ "env": {
28
+ "PYTHONASYNCIODEBUG": "1" // optional: helps with debugging asyncio
29
+ }
30
+ },
31
+ {
32
+ "name": "pytest: current file",
33
+ "type": "python",
34
+ "request": "launch",
35
+ "module": "pytest",
36
+ "args": ["-vv", "${relativeFile}", "--no-cov"],
37
+ "justMyCode": false,
38
+ "console": "integratedTerminal",
39
+ "cwd": "${workspaceFolder}",
40
+ "env": {
41
+ "PYTHONASYNCIODEBUG": "1" // optional: helps with debugging asyncio
42
+ }
43
+ },
44
+ {
45
+ "name": "pytest: specify case in current file",
46
+ "type": "python",
47
+ "request": "launch",
48
+ "module": "pytest",
49
+ "args": ["-vv", "${relativeFile}::${input:testName}", "--no-cov"],
50
+ "justMyCode": false,
51
+ "console": "integratedTerminal",
52
+ "cwd": "${workspaceFolder}",
53
+ "env": {
54
+ "PYTHONASYNCIODEBUG": "1" // optional: helps with debugging asyncio
55
+ }
56
+ }
57
+ ],
58
+ "inputs": [
59
+ {
60
+ "id": "testName",
61
+ "type": "promptString",
62
+ "description": "Enter test name or leave blank to run the whole file",
63
+ "default": ""
64
+ }
65
+ ]
66
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "version": "2.0.0",
3
+ "tasks": [
4
+ {
5
+ "label": "install",
6
+ "type": "shell",
7
+ "command": "make install",
8
+ "group": "build",
9
+ "detail": "install required dependencies on bare metal"
10
+ },
11
+ {
12
+ "label": "format",
13
+ "type": "shell",
14
+ "command": "make format",
15
+ "group": "build",
16
+ "detail": "Run the formatter on bare metal"
17
+ },
18
+ {
19
+ "label": "lint",
20
+ "type": "shell",
21
+ "command": "make lint",
22
+ "group": "build",
23
+ "detail": "run the linter on bare metal"
24
+ },
25
+ {
26
+ "label": "test",
27
+ "type": "shell",
28
+ "command": "make test",
29
+ "group": "build",
30
+ "detail": "run unit tests on bare metal"
31
+ },
32
+ {
33
+ "label": "publish",
34
+ "type": "shell",
35
+ "command": "make publish",
36
+ "group": "build",
37
+ "detail": "Build & publish the package to Nexus"
38
+ }
39
+ ]
40
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright © 2022 Marco Müllner
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,35 @@
1
+ .DEFAULT_GOAL := help
2
+ SHELL := /bin/bash
3
+
4
+
5
+ .PHONY: install ## install required dependencies on bare metal
6
+ install:
7
+ uv sync --refresh
8
+
9
+
10
+ .PHONY: format ## Run the formatter on bare metal
11
+ format:
12
+ uv run tox -e format
13
+
14
+
15
+ .PHONY: lint ## run the linter on bare metal
16
+ lint:
17
+ uv run tox -e lint
18
+
19
+
20
+ .PHONY: test ## run unit tests on bare metal
21
+ test:
22
+ uv run tox -e test
23
+
24
+
25
+ .PHONY: publish ## Build & publish the package to Nexus. Ensure to have UV_PUBLISH_USERNAME & UV_PUBLISH_PASSWORD environment variables set.
26
+ publish:
27
+ @version=$$(grep '^version *= *' pyproject.toml | head -1 | sed 's/version *= *"\(.*\)"/\1/'); \
28
+ echo "Current version: $$version"; \
29
+ read -p "Publish version $$version? (y/n): " confirm; \
30
+ if [ "$$confirm" = "y" ]; then \
31
+ uv build --no-sources && \
32
+ uv publish --verbose; \
33
+ else \
34
+ echo "Publish cancelled."; \
35
+ fi
@@ -0,0 +1,125 @@
1
+ Metadata-Version: 2.4
2
+ Name: ab-openapi-python-generator
3
+ Version: 2.1.3
4
+ Summary: Openapi Python Generator
5
+ Project-URL: Homepage, https://github.com/auth-broker/openapi-python-generator
6
+ Project-URL: Repository, https://github.com/auth-broker/openapi-python-generator
7
+ Project-URL: Documentation, https://openapi-python-generator.readthedocs.io
8
+ Project-URL: Changelog, https://github.com/auth-broker/openapi-python-generator/releases
9
+ Author-email: Marco Müllner <muellnermarco@gmail.com>, Matt Coulter <mattcoul7@gmail.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: Generator,OpenAPI,Python,async
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Requires-Python: <4,>=3.9
15
+ Requires-Dist: black>=21.10b0
16
+ Requires-Dist: click<9,>=8.1.3
17
+ Requires-Dist: httpx[all]<0.29,>=0.28.0
18
+ Requires-Dist: importlib-metadata<9,>=8.7.0
19
+ Requires-Dist: isort>=5.10.1
20
+ Requires-Dist: jinja2<4,>=3.1.2
21
+ Requires-Dist: openapi-pydantic<0.6,>=0.5.1
22
+ Requires-Dist: orjson<4,>=3.9.15
23
+ Requires-Dist: pydantic<3,>=2.10.2
24
+ Requires-Dist: pyyaml<7,>=6.0.2
25
+ Description-Content-Type: text/markdown
26
+
27
+ # Openapi Python Generator
28
+
29
+ [![PyPI](https://img.shields.io/pypi/v/openapi-python-generator.svg)][pypi_]
30
+ [![Status](https://img.shields.io/pypi/status/openapi-python-generator.svg)][status]
31
+ [![Python Version](https://img.shields.io/pypi/pyversions/openapi-python-generator)][python version]
32
+ [![License](https://img.shields.io/pypi/l/openapi-python-generator)][license]
33
+
34
+ [![](https://img.shields.io/static/v1?label=documentation&message=enabled&color=<COLOR>)][documentation]
35
+ [![Tests](https://github.com/auth-broker/openapi-python-generator/workflows/Tests/badge.svg)][tests]
36
+ [![Codecov](https://codecov.io/gh/auth-broker/openapi-python-generator/branch/main/graph/badge.svg)][codecov]
37
+
38
+ [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)][pre-commit]
39
+ [![Black](https://img.shields.io/badge/code%20style-black-000000.svg)][black]
40
+
41
+ [pypi_]: https://pypi.org/project/openapi-python-generator/
42
+ [status]: https://pypi.org/project/openapi-python-generator/
43
+ [python version]: https://pypi.org/project/openapi-python-generator
44
+ [documentation]: https://marcomuellner.github.io/openapi-python-generator/
45
+ [tests]: https://github.com/MarcoMuellner/openapi-python-generator/actions?workflow=Tests
46
+ [codecov]: https://app.codecov.io/gh/MarcoMuellner/openapi-python-generator
47
+ [pre-commit]: https://github.com/pre-commit/pre-commit
48
+ [black]: https://github.com/psf/black
49
+
50
+ ![](logo.png)
51
+
52
+ ---
53
+ __Documentation:__ [here][documentation]
54
+
55
+ ---
56
+
57
+ ## Features
58
+
59
+ - __Ease of use__. Provide input, output and the library, and the generator will do the rest.
60
+ - __Type safety and type hinting.__ __OpenAPI python generator__ makes heavy use of pydantic models to provide type-safe data structures.
61
+ - __Support for multiple rest frameworks.__ __OpenAPI python generator__ currently supports the following:
62
+ - [httpx](https://pypi.org/project/httpx/)
63
+ - [requests](https://pypi.org/project/requests/)
64
+ - [aiohttp](https://pypi.org/project/aiohttp/)
65
+ - __Async and sync code generation support__, depending on the framework. It will automatically create both for frameworks that support both.
66
+ - __Easily extendable using Jinja2 templates__. The code is designed to be easily extendable and should support even more languages and frameworks in the future.
67
+ - __Fully tested__. Every generated code is automatically tested against the OpenAPI spec and we have 100% coverage.
68
+ - __Usage as CLI or as library__.
69
+
70
+ ## Requirements
71
+
72
+ - Python 3.7+
73
+
74
+ ## Installation
75
+
76
+ You can install _Openapi Python Generator_ via [pip] from [PyPI]:
77
+
78
+ ```console
79
+ $ pip install ab-openapi-python-generator
80
+ ```
81
+
82
+ ## Usage
83
+
84
+ Please see the [Quick start page] for details.
85
+
86
+ ## Roadmap
87
+
88
+ - Support for all commonly used http libraries in the python ecosystem (~~requests~~, urllib, ...)
89
+ - Support for multiple languages
90
+ - Support for multiple authentication schemes
91
+ - Support custom themes
92
+
93
+ ## Contributing
94
+
95
+ Contributions are very welcome.
96
+ To learn more, see the [Contributor Guide].
97
+
98
+ ## License
99
+
100
+ Distributed under the terms of the [MIT license][license],
101
+ _Openapi Python Generator_ is free and open source software.
102
+
103
+ ## Issues
104
+
105
+ If you encounter any problems,
106
+ please [file an issue] along with a detailed description.
107
+
108
+ ## Credits
109
+
110
+ Special thanks to the peeps from [openapi-schema-pydantic](https://github.com/kuimono/openapi-schema-pydantic),
111
+ which already did a lot of the legwork by providing a pydantic schema for the OpenAPI 3.0.0+ specification.
112
+
113
+ This project was generated from [@cjolowicz]'s [Hypermodern Python Cookiecutter] template.
114
+
115
+ [@cjolowicz]: https://github.com/cjolowicz
116
+ [pypi]: https://pypi.org/
117
+ [hypermodern python cookiecutter]: https://github.com/cjolowicz/cookiecutter-hypermodern-python
118
+ [file an issue]: https://github.com/MarcoMuellner/openapi-python-generator/issues
119
+ [pip]: https://pip.pypa.io/
120
+
121
+ <!-- github-only -->
122
+
123
+ [license]: https://github.com/MarcoMuellner/openapi-python-generator/blob/main/LICENSE
124
+ [contributor guide]: https://github.com/MarcoMuellner/openapi-python-generator/blob/main/CONTRIBUTING.md
125
+ [Quick start page]: https://marcomuellner.github.io/openapi-python-generator/quick_start/