{"id":48800378,"url":"https://github.com/simovilab/infobus-py","last_synced_at":"2026-04-14T01:32:45.193Z","repository":{"id":316530366,"uuid":"1019507172","full_name":"simovilab/infobus-py","owner":"simovilab","description":"Python and CLI utilities for interaction with Infobús and GTFS data.","archived":false,"fork":false,"pushed_at":"2025-11-22T20:06:43.000Z","size":318,"stargazers_count":32,"open_issues_count":9,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-22T22:07:27.940Z","etag":null,"topics":["python","sdk","uv"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simovilab.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":"2025-07-14T12:37:53.000Z","updated_at":"2025-11-22T21:12:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"1de7caa7-a9d1-405f-b2b2-74d37ee1ddfe","html_url":"https://github.com/simovilab/infobus-py","commit_stats":null,"previous_names":["simovilab/infobus-py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/simovilab/infobus-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simovilab%2Finfobus-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simovilab%2Finfobus-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simovilab%2Finfobus-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simovilab%2Finfobus-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simovilab","download_url":"https://codeload.github.com/simovilab/infobus-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simovilab%2Finfobus-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31778580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T00:11:49.126Z","status":"ssl_error","status_checked_at":"2026-04-14T00:10:29.837Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["python","sdk","uv"],"created_at":"2026-04-14T01:32:45.033Z","updated_at":"2026-04-14T01:32:45.176Z","avatar_url":"https://github.com/simovilab.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"250\" alt=\"infobus\" src=\"https://github.com/user-attachments/assets/3202e078-509d-4062-b454-351677d327ed\" /\u003e\n\n# Python SDK\n\n[![PyPI version](https://badge.fury.io/py/infobus.svg)](https://badge.fury.io/py/infobus)\n[![Python Support](https://img.shields.io/pypi/pyversions/infobus.svg)](https://pypi.org/project/infobus/)\n[![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\nA Python client library and CLI tools for accessing Infobús external APIs and integrating transit data into research workflows.\n\n## Overview\n\nThe `infobus` package provides a simple and efficient way to interact with Infobús APIs, enabling researchers and developers to:\n\n- Access real-time transit data from public transportation systems\n- Retrieve historical transit information for analysis\n- Integrate GTFS Realtime feeds into research workflows\n- Query screen and display information\n- Access weather and alert data associated with transit stops\n\n## Installation\n\n```bash\n# Install from PyPI (when available)\npip install infobus\n\n# Install from source\npip install git+https://github.com/simovilab/infobus-py.git\n\n# Development installation\ngit clone https://github.com/simovilab/infobus-py.git\ncd infobus-py\npip install -e \".[dev]\"\n```\n\n## Quick Start\n\n### Python Library\n\n```python\nfrom infobus import InfobusClient\n\n# Initialize client\nclient = InfobusClient(base_url=\"https://your-infobus-instance.com\")\n\n# Get real-time transit data\ntransit_data = client.get_realtime_data()\n\n# Query specific routes\nroute_info = client.get_route(route_id=\"route_123\")\n\n# Get screen information\nscreens = client.get_screens()\n```\n\n### Command Line Interface\n\n```bash\n# Get help\ninfobus --help\n\n# List available routes\ninfobus routes list\n\n# Get real-time data for a specific route\ninfobus realtime --route-id route_123\n\n# Export data to CSV\ninfobus export --format csv --output data.csv\n```\n\n## Features\n\n### Core API Client\n\n- **RESTful API Integration**: Clean interface to Infobús REST endpoints\n- **Authentication Support**: Token-based authentication handling\n- **Error Handling**: Comprehensive error handling with meaningful messages\n- **Rate Limiting**: Built-in rate limiting and retry logic\n\n### Data Models\n\n- **Pydantic Models**: Type-safe data models for all API responses\n- **GTFS Compatibility**: Models aligned with GTFS and GTFS Realtime specifications\n- **Validation**: Automatic data validation and serialization\n\n### CLI Tools\n\n- **Interactive Commands**: Easy-to-use command-line interface\n- **Data Export**: Export data in multiple formats (JSON, CSV, XML)\n- **Batch Operations**: Process multiple requests efficiently\n- **Configuration Management**: Store and manage API credentials\n\n### Research Integration\n\n- **Pandas Integration**: Easy conversion to pandas DataFrames\n- **Time Series Support**: Built-in support for time-based analysis\n- **Geospatial Data**: Integration with geospatial libraries\n\n## Configuration\n\nCreate a configuration file at `~/.infobus/config.yaml`:\n\n```yaml\napi:\n  base_url: \"https://your-infobus-instance.com\"\n  token: \"your-api-token\"\n  timeout: 30\n\nlogging:\n  level: \"INFO\"\n  format: \"%(asctime)s - %(name)s - %(levelname)s - %(message)s\"\n```\n\n## Development\n\n### Setup Development Environment\n\n```bash\n# Clone repository\ngit clone https://github.com/simovilab/infobus-py.git\ncd infobus-py\n\n# Install development dependencies\npip install -e \".[dev]\"\n\n# Install pre-commit hooks\npre-commit install\n```\n\n### Running Tests\n\n```bash\n# Run all tests\npytest\n\n# Run with coverage\npytest --cov=infobus\n\n# Run specific test file\npytest tests/test_client.py\n```\n\n### Code Quality\n\n```bash\n# Format code\nblack src/ tests/\nisort src/ tests/\n\n# Type checking\nmypy src/\n\n# Run pre-commit checks\npre-commit run --all-files\n```\n\n## API Reference\n\n### InfobusClient\n\nThe main client class for interacting with Infobús APIs.\n\n```python\nclass InfobusClient:\n    def __init__(self, base_url: str, token: str = None, timeout: int = 30)\n    def get_realtime_data(self, **filters) -\u003e List[RealtimeData]\n    def get_routes(self) -\u003e List[Route]\n    def get_route(self, route_id: str) -\u003e Route\n    def get_screens(self) -\u003e List[Screen]\n    def get_alerts(self) -\u003e List[Alert]\n```\n\n### Data Models\n\n- `RealtimeData`: Real-time transit information\n- `Route`: Transit route information\n- `Screen`: Display screen information\n- `Alert`: Service alerts and notifications\n- `Weather`: Weather data for transit locations\n\n## Contributing\n\nWe welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for details.\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n\n## Support\n\n- **Documentation**: [GitHub README](https://github.com/simovilab/infobus-py#readme)\n- **Issues**: [GitHub Issues](https://github.com/simovilab/infobus-py/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/simovilab/infobus-py/discussions)\n\n## Related Projects\n\n- [Infobús Server](https://github.com/fabianabarca/infobus) - The main Infobús Django application\n- [django-app-gtfs](https://github.com/fabianabarca/django-app-gtfs) - GTFS data models for Django\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimovilab%2Finfobus-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimovilab%2Finfobus-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimovilab%2Finfobus-py/lists"}