How pantherale0/pyanglianwater works
Project Type and Purpose
• This is an open-source Python library (package) named pyanglianwater designed to interact with Anglian Water’s public APIs and retrieve smart-meter usage data. There is no UI or database of its own—its sole purpose is to encapsulate authentication, request/response logic, and data-model handling for third-party callers.
File-Structure Analysis
• Top‐level package folder pyanglianwater/ contains all core modules:
• auth.py – handles login/authentication flows (e.g. obtaining tokens, managing sessions)
• api.py – defines HTTP client wrappers for each endpoint (readings, dashboard, bills/payments)
• meter.py – data-models and higher-level helpers to fetch and parse meter usage
• const.py, enum.py – constant values and enumerations for API parameters and response codes
• exceptions.py – custom exception classes used throughout the library
• utils.py – shared helper functions (e.g. HTTP helpers, date parsing)
• Configuration, packaging, and dev tools:
• setup.py & pyproject.toml – packaging metadata
• requirements*.txt – dependencies for runtime and documentation
• mkdocs.yml & docs/ – documentation site source
• .github/workflows/ – CI/CD pipelines (build, test, docs, release)
• Tests under tests/ use static JSON fixtures to verify modules.
Key README Insights
• Library is installed via pip
• “Usage” marked TODO—implies consumers call library functions directly in their own code or scripts
• Development driven by justfile tasks and GitHub Actions for build/test/docs