air-sviva-api 0.0.1__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 (38) hide show
  1. air_sviva_api-0.0.1/.github/CODEOWNERS +1 -0
  2. air_sviva_api-0.0.1/.github/FUNDING.yml +15 -0
  3. air_sviva_api-0.0.1/.github/ISSUE_TEMPLATE/1-question.md +11 -0
  4. air_sviva_api-0.0.1/.github/ISSUE_TEMPLATE/2-bug-report.md +19 -0
  5. air_sviva_api-0.0.1/.github/ISSUE_TEMPLATE/3-feature-request.md +33 -0
  6. air_sviva_api-0.0.1/.github/PULL_REQUEST_TEMPLATE +5 -0
  7. air_sviva_api-0.0.1/.github/dependabot.yml +11 -0
  8. air_sviva_api-0.0.1/.github/workflows/publish.yml +97 -0
  9. air_sviva_api-0.0.1/.github/workflows/pull_request.yml +66 -0
  10. air_sviva_api-0.0.1/.gitignore +222 -0
  11. air_sviva_api-0.0.1/AGENTS.md +220 -0
  12. air_sviva_api-0.0.1/DOMAIN_HANDLING.md +64 -0
  13. air_sviva_api-0.0.1/LICENSE +201 -0
  14. air_sviva_api-0.0.1/PKG-INFO +142 -0
  15. air_sviva_api-0.0.1/README.md +122 -0
  16. air_sviva_api-0.0.1/air_sviva_api/__init__.py +0 -0
  17. air_sviva_api-0.0.1/air_sviva_api/client.py +484 -0
  18. air_sviva_api-0.0.1/air_sviva_api/commons.py +367 -0
  19. air_sviva_api-0.0.1/air_sviva_api/const.py +61 -0
  20. air_sviva_api-0.0.1/air_sviva_api/data.py +521 -0
  21. air_sviva_api-0.0.1/air_sviva_api/models/__init__.py +47 -0
  22. air_sviva_api-0.0.1/air_sviva_api/models/average.py +31 -0
  23. air_sviva_api-0.0.1/air_sviva_api/models/exceptions.py +19 -0
  24. air_sviva_api-0.0.1/air_sviva_api/models/lut.py +42 -0
  25. air_sviva_api-0.0.1/air_sviva_api/models/pollutant.py +33 -0
  26. air_sviva_api-0.0.1/air_sviva_api/models/reading.py +99 -0
  27. air_sviva_api-0.0.1/air_sviva_api/models/region.py +113 -0
  28. air_sviva_api-0.0.1/air_sviva_api/models/station_images.py +28 -0
  29. air_sviva_api-0.0.1/example.py +140 -0
  30. air_sviva_api-0.0.1/pyproject.toml +49 -0
  31. air_sviva_api-0.0.1/renovate.json +6 -0
  32. air_sviva_api-0.0.1/test_auth.py +20 -0
  33. air_sviva_api-0.0.1/test_refresh.py +27 -0
  34. air_sviva_api-0.0.1/tests/__init__.py +0 -0
  35. air_sviva_api-0.0.1/tests/conftest.py +174 -0
  36. air_sviva_api-0.0.1/tests/test_client.py +333 -0
  37. air_sviva_api-0.0.1/tests/test_models.py +207 -0
  38. air_sviva_api-0.0.1/uv.lock +1223 -0
@@ -0,0 +1 @@
1
+ @GuyKh
@@ -0,0 +1,15 @@
1
+ # These are supported funding model platforms
2
+
3
+ github: guykh # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4
+ patreon: # Replace with a single Patreon username
5
+ open_collective: # Replace with a single Open Collective username
6
+ ko_fi: # Replace with a single Ko-fi username
7
+ tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8
+ community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9
+ liberapay: # Replace with a single Liberapay username
10
+ issuehunt: # Replace with a single IssueHunt username
11
+ lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12
+ polar: # Replace with a single Polar username
13
+ buy_me_a_coffee: guykh # Replace with a single Buy Me a Coffee username
14
+ thanks_dev: # Replace with a single thanks.dev username
15
+ custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
@@ -0,0 +1,11 @@
1
+ ---
2
+ name: Question
3
+ about: Questions about this project
4
+ labels: question
5
+ ---
6
+
7
+ ### Checklist
8
+ - [ ] There are no similar issues or pull requests about this question.
9
+
10
+ ### Describe your question
11
+ <!-- A clear and concise description of what the question is. -->
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Bug report
3
+ about: Report a bug to help improve this project
4
+ labels: bug
5
+ ---
6
+ ### Describe the bug
7
+ <!-- A clear and concise description of what the bug is. -->
8
+
9
+ ### To reproduce
10
+ <!-- Provide a *minimal* example with steps to reproduce the bug locally.-->
11
+
12
+ ### Expected behavior
13
+ <!-- A clear and concise description of what you expected to happen. -->
14
+
15
+ ### Actual behavior
16
+ <!-- A clear and concise description of what actually happens. -->
17
+
18
+
19
+ ### Additional context
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project.
4
+ labels: feature, enhancement
5
+ ---
6
+
7
+ ### Checklist
8
+
9
+ <!-- Please make sure you check all these items before submitting your feature request. -->
10
+
11
+ - [ ] There are no similar issues or pull requests for this yet.
12
+
13
+ ### Is your feature related to a problem? Please describe.
14
+
15
+ <!-- A clear and concise description of what you are trying to achieve.
16
+
17
+ Eg "I want to be able to [...] but I can't because [...]". -->
18
+
19
+ ## Describe the solution you would like.
20
+
21
+ <!-- A clear and concise description of what you would want to happen.
22
+
23
+ For API changes, try to provide a code snippet of what you would like the API to look like.
24
+ -->
25
+
26
+ ## Describe alternatives you considered
27
+
28
+ <!-- Please describe any alternative solutions or features you've considered to solve
29
+ your problem and why they wouldn't solve it. -->
30
+
31
+ ## Additional context
32
+
33
+ <!-- Provide any additional context, screenshots, tracebacks, etc. about the feature here. -->
@@ -0,0 +1,5 @@
1
+ ## What changes do you are proposing?
2
+
3
+ ## How did you test these changes?
4
+
5
+ **Closing issues**
@@ -0,0 +1,11 @@
1
+ # To get started with Dependabot version updates, you'll need to specify which
2
+ # package ecosystems to update and where the package manifests are located.
3
+ # Please see the documentation for all configuration options:
4
+ # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5
+
6
+ version: 2
7
+ updates:
8
+ - package-ecosystem: "pip"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
@@ -0,0 +1,97 @@
1
+ name: release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "[0-9]+.[0-9]+.[0-9]+"
7
+ - "[0-9]+.[0-9]+.[0-9]+a[0-9]+"
8
+ - "[0-9]+.[0-9]+.[0-9]+b[0-9]+"
9
+ - "[0-9]+.[0-9]+.[0-9]+rc[0-9]+"
10
+
11
+ env:
12
+ PACKAGE_NAME: "air-sviva-api"
13
+ OWNER: "GuyKh"
14
+
15
+ jobs:
16
+ details:
17
+ runs-on: ubuntu-latest
18
+ outputs:
19
+ new_version: ${{ steps.release.outputs.new_version }}
20
+ suffix: ${{ steps.release.outputs.suffix }}
21
+ tag_name: ${{ steps.release.outputs.tag_name }}
22
+ steps:
23
+ - uses: actions/checkout@v7
24
+
25
+ - name: Extract tag and Details
26
+ id: release
27
+ run: |
28
+ if [ "${{ github.ref_type }}" = "tag" ]; then
29
+ TAG_NAME=${GITHUB_REF#refs/tags/}
30
+ NEW_VERSION=$(echo $TAG_NAME | awk -F'-' '{print $1}')
31
+ SUFFIX=$(echo $TAG_NAME | grep -oP '[a-z]+[0-9]+' || echo "")
32
+ echo "new_version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
33
+ echo "suffix=$SUFFIX" >> "$GITHUB_OUTPUT"
34
+ echo "tag_name=$TAG_NAME" >> "$GITHUB_OUTPUT"
35
+ echo "Version is $NEW_VERSION"
36
+ echo "Suffix is $SUFFIX"
37
+ echo "Tag name is $TAG_NAME"
38
+ else
39
+ echo "No tag found"
40
+ exit 1
41
+ fi
42
+
43
+ check_pypi:
44
+ needs: details
45
+ runs-on: ubuntu-latest
46
+ steps:
47
+ - name: Fetch information from PyPI
48
+ run: |
49
+ response=$(curl -s https://pypi.org/pypi/${{ env.PACKAGE_NAME }}/json || echo "{}")
50
+ latest_previous_version=$(echo $response | jq --raw-output "select(.releases != null) | .releases | keys_unsorted | last")
51
+ if [ -z "$latest_previous_version" ]; then
52
+ echo "Package not found on PyPI."
53
+ latest_previous_version="0.0.0"
54
+ fi
55
+ echo "Latest version on PyPI: $latest_previous_version"
56
+ echo "latest_previous_version=$latest_previous_version" >> $GITHUB_ENV
57
+
58
+ - name: Compare versions and exit if not newer
59
+ run: |
60
+ NEW_VERSION=${{ needs.details.outputs.new_version }}
61
+ LATEST_VERSION=$latest_previous_version
62
+ if [ "$(printf '%s\n' "$LATEST_VERSION" "$NEW_VERSION" | sort -rV | head -n 1)" != "$NEW_VERSION" ] || [ "$NEW_VERSION" == "$LATEST_VERSION" ]; then
63
+ echo "The new version $NEW_VERSION is not greater than the latest version $LATEST_VERSION on PyPI."
64
+ exit 1
65
+ else
66
+ echo "The new version $NEW_VERSION is greater than the latest version $LATEST_VERSION on PyPI."
67
+ fi
68
+
69
+ setup_and_build:
70
+ needs: [details, check_pypi]
71
+ runs-on: ubuntu-latest
72
+ steps:
73
+ - uses: actions/checkout@v7
74
+
75
+ - name: Set up Python
76
+ uses: actions/setup-python@v6
77
+ with:
78
+ python-version: "3.11"
79
+
80
+ - name: Install uv
81
+ uses: astral-sh/setup-uv@v8.2.0
82
+ with:
83
+ enable-cache: true
84
+
85
+ - name: Set project version
86
+ run: |
87
+ uv version ${{ needs.details.outputs.new_version }}
88
+
89
+ - name: Install dependencies
90
+ run: uv sync
91
+
92
+ - name: Build source publish
93
+ env:
94
+ PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
95
+ run: |
96
+ uv build
97
+ uv publish --token $PYPI_TOKEN
@@ -0,0 +1,66 @@
1
+ name: pull_request
2
+ on: [pull_request]
3
+ jobs:
4
+ lint:
5
+ name: "Lint"
6
+ runs-on: ubuntu-latest
7
+ steps:
8
+ - run: echo "Running lint for ${{ github.ref }} branch"
9
+
10
+ - name: Check out repository code
11
+ uses: actions/checkout@v7
12
+ with:
13
+ fetch-depth: 1
14
+
15
+ - name: Install uv
16
+ uses: astral-sh/setup-uv@v8.2.0
17
+ with:
18
+ enable-cache: true
19
+
20
+ - name: Install dependencies
21
+ run: uv sync --dev
22
+
23
+ - name: Running Lint
24
+ run: uv run --with ruff ruff check .
25
+
26
+ run_tests:
27
+ name: "Run Tests"
28
+ runs-on: ubuntu-latest
29
+ steps:
30
+ - run: echo "Running tests for ${{ github.ref }} branch"
31
+
32
+ - name: Check out repository code
33
+ uses: actions/checkout@v7
34
+ with:
35
+ fetch-depth: 1
36
+
37
+ - name: Install uv
38
+ uses: astral-sh/setup-uv@v8.2.0
39
+ with:
40
+ enable-cache: true
41
+
42
+ - name: Install dependencies
43
+ run: uv sync --dev
44
+
45
+ - name: Running tests
46
+ run: uv run --with pytest --with pytest-cov pytest --cov-report=term --cov .
47
+
48
+ mypy:
49
+ name: "Mypy Validation"
50
+ runs-on: ubuntu-latest
51
+ steps:
52
+ - name: Check out repository code
53
+ uses: actions/checkout@v7
54
+ with:
55
+ fetch-depth: 1
56
+
57
+ - name: Install uv
58
+ uses: astral-sh/setup-uv@v8.2.0
59
+ with:
60
+ enable-cache: true
61
+
62
+ - name: Install dependencies
63
+ run: uv sync --dev
64
+
65
+ - name: Running Mypy
66
+ run: uv run --with mypy python3 -m mypy . --follow-untyped-imports --explicit-package-bases --check-untyped-defs
@@ -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
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py.cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ # Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ # uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ # poetry.lock
109
+ # poetry.toml
110
+
111
+ # pdm
112
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
113
+ # pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python.
114
+ # https://pdm-project.org/en/latest/usage/project/#working-with-version-control
115
+ # pdm.lock
116
+ # pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # pixi
121
+ # Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control.
122
+ # pixi.lock
123
+ # Pixi creates a virtual environment in the .pixi directory, just like venv module creates one
124
+ # in the .venv directory. It is recommended not to include this directory in version control.
125
+ .pixi
126
+
127
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
128
+ __pypackages__/
129
+
130
+ # Celery stuff
131
+ celerybeat-schedule
132
+ celerybeat.pid
133
+
134
+ # Redis
135
+ *.rdb
136
+ *.aof
137
+ *.pid
138
+
139
+ # RabbitMQ
140
+ mnesia/
141
+ rabbitmq/
142
+ rabbitmq-data/
143
+
144
+ # ActiveMQ
145
+ activemq-data/
146
+
147
+ # SageMath parsed files
148
+ *.sage.py
149
+
150
+ # Environments
151
+ .env
152
+ .envrc
153
+ .venv
154
+ env/
155
+ venv/
156
+ ENV/
157
+ env.bak/
158
+ venv.bak/
159
+
160
+ # Spyder project settings
161
+ .spyderproject
162
+ .spyproject
163
+
164
+ # Rope project settings
165
+ .ropeproject
166
+
167
+ # mkdocs documentation
168
+ /site
169
+
170
+ # mypy
171
+ .mypy_cache/
172
+ .dmypy.json
173
+ dmypy.json
174
+
175
+ # Pyre type checker
176
+ .pyre/
177
+
178
+ # pytype static type analyzer
179
+ .pytype/
180
+
181
+ # Cython debug symbols
182
+ cython_debug/
183
+
184
+ # PyCharm
185
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
186
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
187
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
188
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
189
+ # .idea/
190
+
191
+ # Abstra
192
+ # Abstra is an AI-powered process automation framework.
193
+ # Ignore directories containing user credentials, local state, and settings.
194
+ # Learn more at https://abstra.io/docs
195
+ .abstra/
196
+
197
+ # Visual Studio Code
198
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
199
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
200
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
201
+ # you could uncomment the following to ignore the entire vscode folder
202
+ # .vscode/
203
+ # Temporary file for partial code execution
204
+ tempCodeRunnerFile.py
205
+
206
+ # Ruff stuff:
207
+ .ruff_cache/
208
+
209
+ # PyPI configuration file
210
+ .pypirc
211
+
212
+ # Marimo
213
+ marimo/_static/
214
+ marimo/_lsp/
215
+ __marimo__/
216
+
217
+ # Streamlit
218
+ .streamlit/secrets.toml
219
+
220
+ token-optimizer/
221
+ docs/
222
+ PLAN.md