{"id":21769933,"url":"https://github.com/mideind/straeto","last_synced_at":"2025-07-23T21:03:11.960Z","repository":{"id":57471687,"uuid":"196645111","full_name":"mideind/Straeto","owner":"mideind","description":"A Python package encapsulating data about buses and bus routes of Strætó bs","archived":false,"fork":false,"pushed_at":"2024-07-10T15:00:00.000Z","size":25165,"stargazers_count":11,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T23:04:51.681Z","etag":null,"topics":["bus","iceland","python","straeto"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mideind.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-07-12T20:56:09.000Z","updated_at":"2024-10-29T13:48:25.000Z","dependencies_parsed_at":"2023-12-01T05:43:23.177Z","dependency_job_id":null,"html_url":"https://github.com/mideind/Straeto","commit_stats":{"total_commits":65,"total_committers":4,"mean_commits":16.25,"dds":"0.12307692307692308","last_synced_commit":"7401b096e2f2990af547a50cb8ed161c72dd684d"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mideind%2FStraeto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mideind%2FStraeto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mideind%2FStraeto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mideind%2FStraeto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mideind","download_url":"https://codeload.github.com/mideind/Straeto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248744013,"owners_count":21154789,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["bus","iceland","python","straeto"],"created_at":"2024-11-26T14:10:41.039Z","updated_at":"2025-04-13T16:32:41.797Z","avatar_url":"https://github.com/mideind.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![Python 3.7](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/downloads/release/python-370/)\n[![Release](https://shields.io/github/v/release/mideind/Straeto?display_name=tag)]()\n[![Build](https://github.com/mideind/Straeto/actions/workflows/python-package.yml/badge.svg)]()\n\n# Straeto\n\n**Straeto** is a Python 3 (\u003e= 3.7) package encapsulating data about buses and bus\nroutes of Strætó bs, an Icelandic municipal bus service.\n\nThe data is fetched from an open data file released by\nStrætó bs called [`GTFS.zip`](http://opendata.straeto.is/data/gtfs/gtfs.zip).\nThis file is large and doesn't change often. Please do not\nfetch it frequently or frivolously. An interval of at least 24 hours\nshould be more than enough.\n\nNote that the process that fetches the `GTFS.zip` file must have\nfile create and file write rights on the `resources/` subdirectory\nwithin the Straeto source package.\n\n## Installation\n\nStraeto is a pure-Python package. It\nis [available on PyPi](https://pypi.org/project/straeto/),\nand can thus be installed by simply typing:\n\n```shell\npip install straeto\n```\n\n## Usage\n\nExample:\n\n```python\nimport straeto\n# Your location here, as a (lat, lon) tuple\nlocation = straeto._MIDEIND_LOCATION  # Fiskislóð 31, Reykjavík\ns = straeto.BusStop.closest_to(location)\nprint(\"The bus stop closest to {0} is {1}\".format(location, s.name))\n# Load the bus schedule for today\nschedule = straeto.BusSchedule()\n# Your route identifier here\nroute_id = \"14\"\n# Print the next two arrivals of that route at the closest bus stop\narrivals, arrives = schedule.arrivals(route_id, s, n=2)\nif not arrives:\n    # This stop is not in the schedule for this route\n    print(\"The bus does not stop at {0}\".format(s.name))\nelse:\n    for direction, times in arrivals.items():\n        print(\n            \"Direction {0}: {1}\"\n            .format(\n                direction,\n                \", \".join(\n                    \"{0:02}:{1:02}\".format(hms[0], hms[1]) for hms in times\n                )\n            )\n        )\n```\n\n## Documentation\n\nThis is a beta release and proper documentation has not yet been\nproduced. But the code is fairly self-explanatory; look at the file\n`src/straeto/straeto.py` to see the source code for the main classes\nand some usage examples.\n\n## Real-time Data\n\nOptionally, and in addition to static schedule data, this package supports\nreading real-time data about bus locations from a URL\nprovided by Strætó bs.  However, these URLs are not public and you need to sign\nan agreement with Strætó to get access to the data and obtain your own URL. Once you\nhave your URL, put it in the file `config/status_url.txt` to enable the Straeto\npackage to fetch real-time data.\n\n## Release history\n\n* Release **1.4.0**\n\n    Full type annotations. Python requirement bumped to 3.7.\n\n* Release **1.3.0**\n\n    Added type annotations; fixed Python 3.6 compatibility\n    regression.\n\n* Release **1.2.0**\n\n    Updated and hardened the code that reads Strætó.bs' XML configuration file.\n    Added type annotations.\n\n* Release **1.1.0**\n\n    Added type annotations; modified the `BusStop.closest_to()` function;\n    updated the default resources files that accompany the\n    Straeto package.\n\n* Release **1.0.2**\n\n    Updated the default resources files that accompany the\n    Straeto package.\n\n* Release **1.0.1**\n\n    Updated the code to reflect a change in the format of the\n    `stop_times.txt` file, going from 6 fields to 7.\n\n* Release **1.0.0**\n\n    Beta release. Supports downloading and extraction of the `GTFS.zip`\n    schedule file from the Strætó bs open data URL. Fixes a bug where sequential\n    bus halts with identical time points were not being included in the schedule.\n\n* Release **0.0.10**\n\n    Better support for Windows with explicit specification of UTF-8 encoding\n    for files\n\n## Copyright\n\n*This program is copyright \u0026copy; 2023 Miðeind ehf.*\n\n## License\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nThe full text of the GNU General Public License is available at\n[http://www.gnu.org/licenses/](http://www.gnu.org/licenses/).\n\n## No Affiliation\n\nThis program and its authors are in no way affiliated with\nor endorsed by Strætó bs.\n\n---\n\n*If you would like to use this software in ways that are incompatible*\n*with the standard GNU GPLv3 license, please contact Miðeind ehf.*\n*at [mideind@mideind.is](mailto:mideind@mideind.is)*\n*to negotiate alternative arrangements.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmideind%2Fstraeto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmideind%2Fstraeto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmideind%2Fstraeto/lists"}