meteostat-cli 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.
@@ -0,0 +1,32 @@
1
+ name: Lint & Type Check
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
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v5
18
+
19
+ - name: Set up Python
20
+ run: uv python install 3.13
21
+
22
+ - name: Install dependencies
23
+ run: uv sync --all-extras
24
+
25
+ - name: Ruff check
26
+ run: uv run ruff check .
27
+
28
+ - name: Ruff format check
29
+ run: uv run ruff format --check .
30
+
31
+ - name: Type check
32
+ run: uv run ty check
@@ -0,0 +1,27 @@
1
+ name: Publish
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
+
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+
20
+ - name: Set up Python
21
+ run: uv python install 3.13
22
+
23
+ - name: Build package
24
+ run: uv build
25
+
26
+ - name: Publish to PyPI
27
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Install uv
20
+ uses: astral-sh/setup-uv@v5
21
+
22
+ - name: Set up Python ${{ matrix.python-version }}
23
+ run: uv python install ${{ matrix.python-version }}
24
+
25
+ - name: Install dependencies
26
+ run: uv sync --all-extras
27
+
28
+ - name: Run tests
29
+ run: uv run pytest --tb=short -q
@@ -0,0 +1,207 @@
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
+ # SageMath parsed files
135
+ *.sage.py
136
+
137
+ # Environments
138
+ .env
139
+ .envrc
140
+ .venv
141
+ env/
142
+ venv/
143
+ ENV/
144
+ env.bak/
145
+ venv.bak/
146
+
147
+ # Spyder project settings
148
+ .spyderproject
149
+ .spyproject
150
+
151
+ # Rope project settings
152
+ .ropeproject
153
+
154
+ # mkdocs documentation
155
+ /site
156
+
157
+ # mypy
158
+ .mypy_cache/
159
+ .dmypy.json
160
+ dmypy.json
161
+
162
+ # Pyre type checker
163
+ .pyre/
164
+
165
+ # pytype static type analyzer
166
+ .pytype/
167
+
168
+ # Cython debug symbols
169
+ cython_debug/
170
+
171
+ # PyCharm
172
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
173
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
174
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
175
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
176
+ #.idea/
177
+
178
+ # Abstra
179
+ # Abstra is an AI-powered process automation framework.
180
+ # Ignore directories containing user credentials, local state, and settings.
181
+ # Learn more at https://abstra.io/docs
182
+ .abstra/
183
+
184
+ # Visual Studio Code
185
+ # Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186
+ # that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187
+ # and can be added to the global gitignore or merged into this file. However, if you prefer,
188
+ # you could uncomment the following to ignore the entire vscode folder
189
+ # .vscode/
190
+
191
+ # Ruff stuff:
192
+ .ruff_cache/
193
+
194
+ # PyPI configuration file
195
+ .pypirc
196
+
197
+ # Cursor
198
+ # Cursor is an AI-powered code editor. `.cursorignore` specifies files/directories to
199
+ # exclude from AI features like autocomplete and code analysis. Recommended for sensitive data
200
+ # refer to https://docs.cursor.com/context/ignore-files
201
+ .cursorignore
202
+ .cursorindexingignore
203
+
204
+ # Marimo
205
+ marimo/_static/
206
+ marimo/_lsp/
207
+ __marimo__/
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Meteostat
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,249 @@
1
+ Metadata-Version: 2.4
2
+ Name: meteostat-cli
3
+ Version: 0.1.0
4
+ Summary: Access weather and climate data through the terminal.
5
+ Project-URL: Homepage, https://github.com/meteostat/cli
6
+ Project-URL: Repository, https://github.com/meteostat/cli
7
+ Project-URL: Issues, https://github.com/meteostat/cli/issues
8
+ Author-email: Meteostat <info@meteostat.net>
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: cli,climate,meteostat,weather
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
21
+ Requires-Python: >=3.11
22
+ Requires-Dist: meteostat<3,>=2.1.4
23
+ Requires-Dist: pyyaml>=6.0
24
+ Requires-Dist: typer>=0.15.0
25
+ Provides-Extra: plot
26
+ Requires-Dist: matplotlib>=3.9.0; extra == 'plot'
27
+ Description-Content-Type: text/markdown
28
+
29
+ <!-- PROJECT SHIELDS -->
30
+ <div align="center">
31
+
32
+ [![PyPI Version][pypi-shield]][pypi-url]
33
+ [![Issues][issues-shield]][issues-url]
34
+ [![MIT License][license-shield]][license-url]
35
+
36
+ </div>
37
+
38
+ <!-- PROJECT LOGO -->
39
+ <br />
40
+ <div align="center">
41
+ <a href="https://github.com/meteostat/cli">
42
+ <img src="https://media.meteostat.net/icon.svg" alt="Meteostat Logo" width="80" height="80">
43
+ </a>
44
+
45
+ <h3 align="center">Meteostat CLI</h3>
46
+
47
+ <p align="center">
48
+ Access weather and climate data through the terminal.
49
+ <p>
50
+ <a href="https://dev.meteostat.net/cli"><strong>Explore the docs »</strong></a>
51
+ </p>
52
+ <p>
53
+ <a href="https://meteostat.net">Visit Website</a>
54
+ &middot;
55
+ <a href="https://github.com/meteostat/cli/issues">Report Bug</a>
56
+ &middot;
57
+ <a href="https://github.com/orgs/meteostat/discussions">Request Feature</a>
58
+ </p>
59
+ </p>
60
+ </div>
61
+
62
+ ## 📚 Installation
63
+
64
+ ```bash
65
+ pip install --user meteostat-cli
66
+ ```
67
+
68
+ For plotting capabilities (`png`/`svg` output), install the `plot` extra:
69
+
70
+ ```bash
71
+ pip install --user meteostat-cli[plot]
72
+ ```
73
+
74
+ ## 🚀 Usage
75
+
76
+ ### Get daily weather data for a station
77
+
78
+ ```bash
79
+ meteo daily 10637 --start 2024-01-01 --end 2024-12-31
80
+ ```
81
+
82
+ ### Get hourly data by coordinates (with interpolation)
83
+
84
+ ```bash
85
+ meteo hourly 50.1109,8.6821 --start 2024-01-01 --end 2024-01-07
86
+ ```
87
+
88
+ ### Export data to a file
89
+
90
+ ```bash
91
+ meteo daily 10637 -s 2024-01-01 -e 2024-12-31 --output data.json
92
+ ```
93
+
94
+ ### Plot temperature data
95
+
96
+ ```bash
97
+ meteo daily 10637 -s 2024-01-01 -e 2024-12-31 --output chart.png
98
+ ```
99
+
100
+ ## 📖 Commands
101
+
102
+ ### `meteo station` — Browse weather stations
103
+
104
+ ```bash
105
+ meteo station 10637 # Metadata for a specific station
106
+ meteo station --country DE # List stations by country
107
+ meteo station --country DE --state HE # Filter by country and state
108
+ meteo station --name "Frankfurt" # Search by name
109
+ ```
110
+
111
+ | Option | Short | Description |
112
+ | ------------- | ----- | ------------------------------------------------ |
113
+ | `--country` | `-c` | ISO 3166-1 alpha-2 country code |
114
+ | `--state` | | State or region code |
115
+ | `--name` | `-n` | Station name (partial match) |
116
+ | `--wmo` | `-w` | WMO station ID |
117
+ | `--icao` | `-i` | ICAO station ID |
118
+ | `--iata` | | IATA station ID |
119
+ | `--national` | `-N` | National station ID |
120
+ | `--bbox` | | Bounding box (`lon_min,lat_min,lon_max,lat_max`) |
121
+ | `--sql` | | Arbitrary SQL query |
122
+ | `--format` | `-f` | Output format: `csv`, `json`, `xlsx`, `parquet` |
123
+ | `--output` | `-o` | Output file path (defaults to stdout) |
124
+ | `--no-header` | | Omit CSV header row |
125
+ | `--all` | `-A` | Print full table without truncation |
126
+
127
+ ### `meteo nearby` — Find stations near a location
128
+
129
+ ```bash
130
+ meteo nearby 50.1109 8.6821 # Nearest stations (default: 5 within 5 km)
131
+ meteo nearby 50.1109 8.6821 --limit 10 # Return up to 10 stations
132
+ meteo nearby 50.1109 8.6821 --radius 20000 # Search within 20 km
133
+ meteo nearby 50.1109 8.6821 --format json # JSON output
134
+ ```
135
+
136
+ | Option | Short | Description |
137
+ | ------------- | ----- | ----------------------------------------------- |
138
+ | `--limit` | `-l` | Maximum number of stations (default: 5) |
139
+ | `--radius` | `-r` | Search radius in meters (default: 5000) |
140
+ | `--format` | `-f` | Output format: `csv`, `json`, `xlsx`, `parquet` |
141
+ | `--output` | `-o` | Output file path (defaults to stdout) |
142
+ | `--no-header` | | Omit CSV header row |
143
+ | `--all` | `-A` | Print full table without truncation |
144
+
145
+ ### `meteo inventory` — Check data availability
146
+
147
+ ```bash
148
+ meteo inventory 10637
149
+ meteo inventory 10637 --granularity daily --parameters tavg,tmin,tmax
150
+ ```
151
+
152
+ | Option | Short | Description |
153
+ | --------------- | ----- | --------------------------------------------------------------- |
154
+ | `--granularity` | `-g` | Filter by granularity: `hourly`/`h`, `daily`/`d`, `monthly`/`m` |
155
+ | `--parameters` | `-p` | Comma-separated parameters (e.g. `tavg,tmin,tmax`) |
156
+ | `--providers` | `-P` | Comma-separated data providers |
157
+ | `--format` | `-f` | Output format: `csv`, `json`, `xlsx`, `parquet` |
158
+ | `--output` | `-o` | Output file path (defaults to stdout) |
159
+ | `--no-header` | | Omit CSV header row |
160
+ | `--all` | `-A` | Print full table without truncation |
161
+
162
+ ### `meteo hourly` — Hourly weather data
163
+
164
+ ```bash
165
+ meteo hourly 10637 --start 2024-01-01 --end 2024-01-31
166
+ meteo h 10637 -s 2024-01-01 -e 2024-01-31 # Short form
167
+ meteo hourly 10637 10635 -s 2024-01-01 -e 2024-01-31 # Multiple stations
168
+ meteo hourly 10637 --agg max -s 2024-01-01 -e 2024-01-31 # Aggregate by station and time
169
+ ```
170
+
171
+ See [Common options](#common-options-hourly--daily--monthly--normals) below. Hourly also supports `--timezone`/`-t` (e.g. `Europe/Berlin`).
172
+
173
+ ### `meteo daily` — Daily weather data
174
+
175
+ ```bash
176
+ meteo daily 10637 --start 2024-01-01 --end 2024-12-31
177
+ meteo d 10637 -s 2024-01-01 -e 2024-12-31 # Short form
178
+ ```
179
+
180
+ See [Common options](#common-options-hourly--daily--monthly--normals) below.
181
+
182
+ ### `meteo monthly` — Monthly weather data
183
+
184
+ ```bash
185
+ meteo monthly 10637 --start 2020 --end 2024
186
+ meteo m 10637 -s 2020 -e 2024 # Short form
187
+ ```
188
+
189
+ See [Common options](#common-options-hourly--daily--monthly--normals) below.
190
+
191
+ ### `meteo normals` — Climate normals
192
+
193
+ ```bash
194
+ meteo normals 10637 --start 1991 --end 2020
195
+ meteo n 10637 -s 1991 -e 2020 # Short form
196
+ ```
197
+
198
+ See [Common options](#common-options-hourly--daily--monthly--normals) below.
199
+
200
+ ### Common options (hourly / daily / monthly / normals)
201
+
202
+ | Option | Short | Description |
203
+ | ---------------- | ----- | ------------------------------------------------------------- |
204
+ | `--start` | `-s` | Start date (`YYYY-MM-DD`, `YYYY-MM`, `YYYY`) |
205
+ | `--end` | `-e` | End date (same formats) |
206
+ | `--parameters` | `-p` | Comma-separated parameters (e.g. `tavg,tmin,tmax,prcp`) |
207
+ | `--providers` | `-P` | Comma-separated data providers |
208
+ | `--format` | `-f` | Output format: `csv`, `json`, `xlsx`, `parquet`, `png`, `svg` |
209
+ | `--output` | `-o` | Output file path (defaults to stdout) |
210
+ | `--timezone` | `-t` | Timezone for timestamps (e.g. `Europe/Berlin`) — hourly only |
211
+ | `--with-sources` | `-S` | Include data source column in output |
212
+ | `--no-models` | | Exclude model data (e.g. MOSMIX) |
213
+ | `--no-header` | | Omit CSV header row |
214
+ | `--no-cache` | | Disable result caching |
215
+ | `--all` | `-A` | Print full table without truncation |
216
+ | `--agg` | | Aggregation function: `mean`, `sum`, `min`, `max` |
217
+
218
+ ### `meteo config` — Manage configuration
219
+
220
+ ```bash
221
+ meteo config --list # List all settings
222
+ meteo config cache_enable false # Set a value
223
+ meteo config interpolation_radius 25000
224
+ ```
225
+
226
+ Configuration is stored in `cli.yml` under `typer.get_app_dir("meteostat")`.
227
+
228
+ ### Shell completion
229
+
230
+ ```bash
231
+ meteo --install-completion # Bash, Zsh, Fish, PowerShell
232
+ ```
233
+
234
+ ## 🤝 Contributing
235
+
236
+ Please read our [contributing guidelines](https://dev.meteostat.net/contributing) for details on how to contribute to Meteostat.
237
+
238
+ ## 📄 License
239
+
240
+ The Meteostat CLI is licensed under the [**MIT License**](https://github.com/meteostat/cli/blob/main/LICENSE). Data provided by Meteostat is licensed under [**Creative Commons Attribution 4.0 International (CC BY 4.0)**](https://creativecommons.org/licenses/by/4.0). See the [documentation](https://dev.meteostat.net/license) for details.
241
+
242
+ <!-- MARKDOWN LINKS & IMAGES -->
243
+
244
+ [pypi-shield]: https://img.shields.io/pypi/v/meteostat-cli
245
+ [pypi-url]: https://pypi.org/project/meteostat-cli/
246
+ [issues-shield]: https://img.shields.io/github/issues/meteostat/cli.svg
247
+ [issues-url]: https://github.com/meteostat/cli/issues
248
+ [license-shield]: https://img.shields.io/github/license/meteostat/cli.svg
249
+ [license-url]: https://github.com/meteostat/cli/blob/main/LICENSE