{"id":23291927,"url":"https://github.com/jeeftor/weatherflow4py","last_synced_at":"2026-04-02T17:25:29.802Z","repository":{"id":214478320,"uuid":"736510636","full_name":"jeeftor/weatherflow4py","owner":"jeeftor","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-29T01:34:14.000Z","size":621,"stargazers_count":5,"open_issues_count":9,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-29T03:13:53.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jeeftor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-12-28T05:27:49.000Z","updated_at":"2026-03-29T00:35:45.000Z","dependencies_parsed_at":"2024-03-19T16:29:13.199Z","dependency_job_id":"fdba7218-f6f8-46e7-8c4f-d5b3a70e9d3f","html_url":"https://github.com/jeeftor/weatherflow4py","commit_stats":{"total_commits":174,"total_committers":4,"mean_commits":43.5,"dds":"0.10344827586206895","last_synced_commit":"69757e841ed95cf270e361c18ae611476e1b8568"},"previous_names":["jeeftor/weatherflow4py"],"tags_count":71,"template":false,"template_full_name":null,"purl":"pkg:github/jeeftor/weatherflow4py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fweatherflow4py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fweatherflow4py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fweatherflow4py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fweatherflow4py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeeftor","download_url":"https://codeload.github.com/jeeftor/weatherflow4py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeeftor%2Fweatherflow4py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31311432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-02T12:59:32.332Z","status":"ssl_error","status_checked_at":"2026-04-02T12:54:48.875Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-20T05:28:11.885Z","updated_at":"2026-04-02T17:25:29.795Z","avatar_url":"https://github.com/jeeftor.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WeatherFlow4Py\n\nA Python library for interacting with the WeatherFlow REST API and WebSocket services. This library provides both synchronous and asynchronous interfaces to access weather data from WeatherFlow weather stations.\n\n[![PyPI](https://img.shields.io/pypi/v/weatherflow4py.svg)](https://pypi.org/project/weatherflow4py/)\n[![Test PyPI](https://img.shields.io/badge/Test%20PyPI-available-blue)](https://test.pypi.org/project/weatherflow4py/)\n\n## Features\n\n- **REST API Client**: Access station data, forecasts, and observations\n- **WebSocket Client**: Real-time weather data updates\n- **Type Annotations**: Full type support for better development experience\n- **Asynchronous Support**: Built with `asyncio` for efficient I/O operations\n- **Pydantic Models**: Strongly-typed data models for all API responses\n\n## Installation\n\n```bash\npip install weatherflow4py\n```\n\nOr with uv:\n\n```bash\nuv pip install weatherflow4py\n```\n\n## Prerequisites\n\n- Python 3.12 or higher\n- WeatherFlow API token (available from [WeatherFlow's website](https://tempestwx.com))\n\n## Quick Start\n\n### REST API Example\n\n```python\nimport asyncio\nfrom weatherflow4py.api import WeatherFlowRestAPI\n\nasync def main():\n    # Initialize the API with your token\n    async with WeatherFlowRestAPI(\"YOUR_API_TOKEN\") as api:\n        # Get all available stations\n        stations = await api.async_get_stations()\n        \n        for station in stations.stations:\n            print(f\"Station: {station.name}\")\n            print(f\"Location: {station.latitude}, {station.longitude}\")\n            \n            # Get current observations\n            obs = await api.async_get_observation(station.station_id)\n            print(f\"Current temperature: {obs.obs[0].air_temperature}°C\")\n            \n            # Get forecast\n            forecast = await api.async_get_forecast(station.station_id)\n            print(f\"Forecast high: {forecast.forecast.daily[0].air_temp_high}°C\")\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### WebSocket Example\n\n```python\nimport asyncio\nimport logging\nfrom weatherflow4py.ws import WeatherFlowWebsocketAPI\n\n# Set up logging\nlogging.basicConfig(level=logging.INFO)\nlogger = logging.getLogger(__name__)\n\nasync def main():\n    # Initialize the WebSocket client\n    ws = WeatherFlowWebsocketAPI(\"YOUR_API_TOKEN\")\n    \n    # Define callback functions for different message types\n    def handle_observation(data):\n        print(f\"Observation received - Temp: {data.air_temperature}°C\")\n    \n    def handle_rapid_wind(data):\n        print(f\"Wind speed: {data.wind_speed} m/s at {data.wind_direction}°\")\n    \n    # Register callbacks\n    ws.register_callback(\"obs_st\", handle_observation)\n    ws.register_callback(\"rapid_wind\", handle_rapid_wind)\n    \n    try:\n        # Start listening for messages\n        await ws.connect()\n        \n        # Start listening to all available devices\n        await ws.start_listening()\n        \n        # Keep the connection alive\n        while True:\n            await asyncio.sleep(1)\n            \n    except KeyboardInterrupt:\n        print(\"Disconnecting...\")\n    finally:\n        await ws.disconnect()\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n## API Documentation\n\n### REST API\n\nThe `WeatherFlowRestAPI` class provides the following methods:\n\n- `async_get_stations()`: Get all stations associated with the account\n- `async_get_observation(station_id)`: Get current observations for a station\n- `async_get_forecast(station_id)`: Get forecast data for a station\n- `async_get_device_observations(device_id)`: Get observations from a specific device\n- `get_all_data()`: Get all available data for all stations\n\n### WebSocket API\n\nThe `WeatherFlowWebsocketAPI` class provides real-time updates:\n\n- `connect()`: Establish WebSocket connection\n- `disconnect()`: Close the connection\n- `start_listening(device_ids=None)`: Start listening for updates\n- `stop_listening(device_ids=None)`: Stop listening for updates\n- `register_callback(message_type, callback)`: Register a callback for specific message types\n\n## Error Handling\n\nThe library raises specific exceptions for different error conditions:\n\n- `TokenError`: When no API token is provided\n- `APIError`: For general API errors\n- `WebSocketError`: For WebSocket connection issues\n\n## Rate Limiting\n\n- **REST API**: Limited to 100 requests per minute\n- **WebSocket**: Follows WeatherFlow's rate limiting policies\n\n## Resources\n\n- [WeatherFlow API Documentation](https://apidocs.tempestwx.com/reference/quick-start)\n- [WeatherFlow REST API Swagger](https://weatherflow.github.io/Tempest/api/swagger/)\n- [WeatherFlow WebSocket Documentation](https://weatherflow.github.io/Tempest/api/ws.html)\n\n## Development\n\nThis project uses [uv](https://github.com/astral-sh/uv) for dependency management and virtual environment creation.\n\n### Setup with Nix\n\nIf you have Nix installed with flakes enabled:\n\n```bash\n# Enter the development environment\nnix develop\n\n# This will automatically:\n# 1. Create a virtual environment with uv\n# 2. Install dependencies from requirements.txt and requirements-dev.txt\n# 3. Install the project in development mode\n```\n\n### Manual Setup with uv\n\n```bash\n# Create a virtual environment\nuv venv\n\n# Activate the virtual environment\nsource .venv/bin/activate\n\n# Install dependencies\nuv pip install -r requirements.txt\nuv pip install -r requirements-dev.txt\n\n# Install the project in development mode\nuv pip install -e .\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- WeatherFlow for their excellent weather station hardware and API\n- All contributors who have helped improve this library\n\n## Support\n\nFor support, please open an issue on the [GitHub repository](https://github.com/jeeftor/weatherflow4py).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeeftor%2Fweatherflow4py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeeftor%2Fweatherflow4py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeeftor%2Fweatherflow4py/lists"}