Metadata-Version: 2.4
Name: wa-weather-station-tool
Version: 0.1.0
Summary: WA DPIRD weather station downloader (minimal CLI)
Author: Animal Data Analysis Tools
License: Proprietary
Keywords: CLI,DPIRD,WA,downloader,weather
Classifier: License :: Other/Proprietary License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# animal_data_analysis_tools
Develop the utility tools for animal experiments data analysis for the researchers.

## WA DPIRD Weather Downloader
- Command: `wa_dpird_weather_downloader --help`
- Example: `wa_dpird_weather_downloader --station WN --start 2024-03-19T00:00:00 --end 2024-04-19T00:00:00 --out datasets/WN_2024-03-19_to_2025-04-19.csv --api-key YOUR_API_KEY`

The CLI downloads real data from the WA DPIRD API with retries and resumable CSV output.

### Install locally for development
- Editable install: `pip install -e .`
- Run CLI after install: `wa_dpird_weather_downloader --help`

### Usage
- Run (API key required via flag):
  - `wa_dpird_weather_downloader --station WN --start 2024-03-19T00:00:00 --end 2025-08-01T00:00:00 --out datasets/WN_2024-03-19_to_2025-08-01.csv --api-key YOUR_API_KEY`

### Flags
- `--station`: station ID/code (e.g., `WN`, `009225`)
- `--start`, `--end`: date-time `YYYY-MM-DDTHH:MM:SS` (UTC)
- `--out`: output CSV path
- `--api-key` (required): DPIRD API key
- `--limit`: page size (default 200)

### Features
- Retries with exponential backoff for 429 and 5xx
- Resumable downloads: appends pages to CSV and maintains a sidecar checkpoint `<out>.ckpt.json`
- Page-by-page writing to keep memory usage low

### Build & publish to PyPI (summary)
1) Build: `python -m build` (install `build` first)
2) Upload: `twine upload dist/*` (use PyPI API token `__token__`)
See below for detailed steps.

### Detailed PyPI publish steps
1. Create PyPI account and API token (scoped to the project)
2. Install tooling: `pip install build twine`
3. Bump version in `pyproject.toml` under `[project] version`
4. Build artifacts: `python -m build` (creates `dist/*.tar.gz` & `dist/*.whl`)
5. Upload to TestPyPI (optional): `twine upload -r testpypi dist/*`
   - Then install to test: `pip install -i https://test.pypi.org/simple/ wa-weather-station-tool`
6. Upload to PyPI: `twine upload dist/*`
   - Username: `__token__`, Password: your API token
7. Verify install: `pip install wa-weather-station-tool && wa_dpird_weather_downloader --help`
