{"id":24589133,"url":"https://github.com/josericodata/dublinbusapp","last_synced_at":"2026-04-11T12:38:51.946Z","repository":{"id":273256286,"uuid":"919112140","full_name":"josericodata/DublinBusApp","owner":"josericodata","description":"A real-time Dublin Bus tracking app built with Streamlit, leveraging live API data to visualise bus routes, stops, and schedules.","archived":false,"fork":false,"pushed_at":"2025-02-18T19:51:18.000Z","size":137278,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-17T22:07:58.173Z","etag":null,"topics":["api","bus","bus-tracker-api","bus-tracking-app","dublin","dublin-bus","dublin-ireland","gtfs","gtfs-realtime","ireland","json","json-schema","linkedin-profile","linux","portfolio","python","rest-api","streamlit","transport-for-ireland","ubuntu"],"latest_commit_sha":null,"homepage":"https://dublinbusapp.streamlit.app/","language":"Jupyter Notebook","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/josericodata.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}},"created_at":"2025-01-19T18:26:24.000Z","updated_at":"2025-02-18T19:51:22.000Z","dependencies_parsed_at":"2025-02-18T16:39:24.592Z","dependency_job_id":null,"html_url":"https://github.com/josericodata/DublinBusApp","commit_stats":null,"previous_names":["josericodata/dublinbusapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/josericodata/DublinBusApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josericodata%2FDublinBusApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josericodata%2FDublinBusApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josericodata%2FDublinBusApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josericodata%2FDublinBusApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/josericodata","download_url":"https://codeload.github.com/josericodata/DublinBusApp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/josericodata%2FDublinBusApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31681201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-11T08:18:19.405Z","status":"ssl_error","status_checked_at":"2026-04-11T08:17:08.892Z","response_time":54,"last_error":"SSL_read: 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":["api","bus","bus-tracker-api","bus-tracking-app","dublin","dublin-bus","dublin-ireland","gtfs","gtfs-realtime","ireland","json","json-schema","linkedin-profile","linux","portfolio","python","rest-api","streamlit","transport-for-ireland","ubuntu"],"created_at":"2025-01-24T08:13:54.569Z","updated_at":"2026-04-11T12:38:51.911Z","avatar_url":"https://github.com/josericodata.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚌 Dublin Bus App\n\n**The Dublin Bus App has been built in an attempt to use real time data using the API's provided by the [National Transport Authority](https://developer.nationaltransport.ie/). Using this app you can see the incoming buses for a selected stop and the buses that currently operate a route based on a direction.**\n\n---\n\n## 🧬 **Project Structure**\n```bash\nDublinBusApp\n├── assets/         \n│   ├── data/\n│   │   ├── Routes.txt\n│   │   ├── StopMapLocation.txt\n│   │   ├── StopTimesPerTrip.txt\n│   │   └── Towards.csv\n│   ├── dataCleaning/\n│   │   ├── 00_EndpointExploration.ipynb\n│   │   ├── 01_DataCleaning.ipynb\n│   │   ├── 02_Flow_01_⌚_StopTimes.ipynb\n│   │   ├── 03_Flow_02_📍_BusLocator.ipynb\n│   │   ├── routes.txt\n│   │   ├── stop_times.txt\n│   │   ├── stops.txt\n│   │   └── trips.txt\n│   ├── gifs/\n│   │   ├── BusLocator.gif\n│   │   └── StopTimes.gif\n│   └── images/ \n│       ├── bus.png\n│       ├── dublin_bus_favicon.png\n│       ├── dublin_bus_logo.png\n│       ├── pin_blue.png\n│       ├── pin_green.png\n│       ├── pin_red.png\n│       └── tfi_logo.png\n├── streamlit_app/\n│   ├── modules/\n│   │   ├── __init__.py\n│   │   ├── BLutils.py\n│   │   ├── DataPrep.py\n│   │   ├── STutils.py\n│   │   └── Styles.py\n│   ├── pages/               \n│   │   ├── 01_⌚_StopTimes.py\n│   │   └── 02_📍_BusLocator.py\n│   └── 00_🚌_Info.py     \n├── LICENSE                 \n├── README.md               \n└── requirements.txt        \n```\n\n---\n\n## 🎯 **Road Map**\n\n  \n\nPlan to develop the app:\n\n  \n\n- **Understand the data provided by the APIs**\n\n- **Explore the static data provided by the NTA to complement data shown in the APIs**\n\n- **Design the logic for `StopTimes` and `BusLocator` pages**\n\n---\n  \n\n## 🏗️ **Deployment**\n\n  \n\n1. **Understand the data provided by the APIs**:\n\n- First, sign up for the [National Transport Authority (NTA)](https://developer.nationaltransport.ie/) to access their APIs. Use the following link to sign up: [Sign up here](https://developer.nationaltransport.ie/signup).\n\n- Next, understand and visualise the data provided by the following endpoints:\n\n- [GTFSR Endpoint](https://api.nationaltransport.ie/gtfsr/v2/gtfsr?format=json)\n\n- [Vehicles Endpoint](https://api.nationaltransport.ie/gtfsr/v2/Vehicles?format=json)\n\n- To assist with exploring these endpoints, I have created a Jupyter Notebook (JN): [00_EndpointExploration.ipynb](https://github.com/josericodata/DublinBusApp/blob/main/assets/dataCleaning/00_EndpointExploration.ipynb). Replace `os.environ.get(\"API_KEY\")` with the variable `YOUR_API_KEY`, and you're ready to proceed.\n\n  \n\n2. **Exploring and Preparing NTA Dublin Bus Static Data**:\n\n- Please head over to the following link: [GTFS Dublin Bus Data](https://www.transportforireland.ie/transitData/Data/GTFS_Dublin_Bus.zip). This will download the file `GTFS_Dublin_Bus.zip`. After downloading, extract the files.\n\n- We will need the following files from the extracted data:\n\n1. `routes.txt`\n\n2. `stops.txt`\n\n3. `stop_times.txt`\n\n4. `trips.txt`\n\n- These files will be used to generate the following new files:\n\n1. `Routes.txt`\n\n2. `StopMapLocation.txt`\n\n3. `StopTimesPerTrip.txt`\n\n4. `Towards.txt`\n\n- To visualise this step, I have created a JN: [01_DataCleaning.ipynb](https://github.com/josericodata/DublinBusApp/blob/main/assets/dataCleaning/01_DataCleaning.ipynb).\n\n- **The files mentioned above were used in the early stages of this project. However, since the NTA updates `GTFS_Dublin_Bus.zip` almost every week, maintaining the app required frequent updates. To simplify this process, I created [DataPrep.py](https://github.com/josericodata/DublinBusApp/blob/main/streamlit_app/modules/DataPrep.py). With this script, every time the app runs, it fetches fresh data from [GTFS Dublin Bus Data](https://www.transportforireland.ie/transitData/Data/GTFS_Dublin_Bus.zip). I am keeping the old `.txt` files in case they help someone better understand this complex process.**\n\n3. **What is GTFS?**\n\n- Summarising point 1 and 2, the **General Transit Feed Specification (GTFS)** is a standardised format for public transportation data, allowing transit agencies to share schedules, routes, and real-time updates. It consists of structured text files that define agencies, stops, routes, trips, and schedules.\n\n🔹 **GTFS Data Types:**\n\n| Type            | Description |\n|----------------|------------|\n| **GTFS Realtime** | Delivers live updates on vehicle positions, delays, and service alerts. Uses `GTFSR` and `Vehicles` endpoints. |\n| **GTFS Static**   | Provides fixed schedules, routes, and stop locations. Uses `GTFS_Dublin_Bus.zip`. |\n\n- For more details, visit the official GTFS website: [GTFS.org](https://gtfs.org/)\n\n\n4. **Logic Design for `StopTimes` and `BusLocator` Pages**:\n\n- After understanding the data provided by the endpoints and the static files, it is time to develop the logic for the pages.\n\n- **`StopTimes` Page**:\n\n- The user will first select a `route`, then be prompted to choose a `direction`, and finally select a `stop` to display the buses that are due to arrive.\n\n- For a clear understanding of this flow, refer to the JN: [02_Flow_01_⌚_StopTimes.ipynb](https://github.com/josericodata/DublinBusApp/blob/main/assets/dataCleaning/02_Flow_01_⌚_StopTimes.ipynb).\n\n- **`BusLocator` Page**:\n\n- This page will show the operating buses for the selected `route` and `direction`.\n\n- For more details on this logic, refer to the JN: [03_Flow_02_📍_BusLocator.ipynb](https://github.com/josericodata/DublinBusApp/blob/main/assets/dataCleaning/03_Flow_02_📍_BusLocator.ipynb).\n\n---\n\n5. **Streamlit App Creation**:\n\n- After completing the steps above, the final app can be found at: [streamlit_app](https://github.com/josericodata/DublinBusApp/tree/main/streamlit_app).\n\n  \n\n## 🚀 **Getting Started**\n\n  \n\n### **Local Installation**\n\n  \n\n1. Clone the repository:\n\n```bash\n\ngit clone https://github.com/user/DublinBusApp.git\n\n```\n\n**Hint:** Replace `user` with `josericodata` in the URL above. I am deliberately asking you to pause here so you can support my work. If you appreciate it, please consider giving the repository a star or forking it. Your support means a lot—thank you! 😊\n\n  \n\n2. Navigate to the project directory:\n\n```bash\n\ncd DublinBusApp\n\n```\n\n  \n\n3. Create a virtual environment:\n\n```bash\n\npython3 -m venv venvDublinBus\n\n```\n\n  \n\n4. Activate the virtual environment:\n\n```bash\n\nsource venvDublinBus/bin/activate\n\n```\n\n  \n\n5. Install requirements:\n\n```bash\n\npip install -r requirements.txt\n\n```\n\n  \n\n6. Navigate to the modules directory:\n\n```bash\n\ncd streamlit_app/modules\n\n```\n\n  \n\n7. Please locate in `BLutils.py` and `STutils.py` the following line code:\n\n```bash\n\nYOUR_API_KEY = st.secrets[\"API_KEY\"]\n\n```\n\nIt is crutial to replace `st.secrets[\"API_KEY\"]` with the actual API Key provided by the [National Transport Authority](https://developer.nationaltransport.ie/) after [signing up](https://developer.nationaltransport.ie/signup) to acces their APIs. Please use the following link to sign up: https://developer.nationaltransport.ie/signup\n\n  \n  \n\n8. Go back one directory and run the app:\n\n```bash\n\ncd ..\n\n```\n\n  \n\nThen run\n\n  \n\n```bash\n\nstreamlit run 00_🚌_Info.py\n\n```\n\n  \n\nThe app will be live at `http://localhost:8501`.\n\n---\n\n## 🎬 **Demo**\n  \n### Page 1: Stop Times\n![Stop Times Demo](assets/gifs/StopTimes.gif)\n\n### Page 2: Bus Locator\n![Bus Locator Demo](assets/gifs/BusLocator.gif)\n\n---\n\n### ▶️ Watch the YouTube Tutorial\n\n\n[![Streamlit Bus Tracking App with GTFS, Folium \u0026 Python](https://img.youtube.com/vi/PaU5KaZCJ5E/maxresdefault.jpg)](https://www.youtube.com/watch?v=PaU5KaZCJ5E \"Click to play\")\n\nClick the image above or [here](https://www.youtube.com/watch?v=PaU5KaZCJ5E) to watch the video on YouTube.\n\n---\n\n## 🔮 **Future Enhancements**\n\n  \n\nPlanned improvements for the Dublin Bus App include:\n\n  \n\n- **Database Integration**: Implementing a relational database (e.g., PostgreSQL) to better manage and query data, enabling faster performance and enhanced data relationships between routes, stops, and trips.\n\n- **Historical Data Storage**: Storing historical bus data to provide insights like delay trends, busiest stops, and more accurate arrival time predictions using machine learning.\n\n- **Personalised Features**: Adding user-specific data storage, such as favorite routes or frequently accessed stops, for a more tailored experience.\n\n- **Advanced Reporting and Analytics**: Generating detailed reports, such as route popularity or stop traffic trends, with visualisations like heatmaps or charts.\n\n- **Enhanced Pages**: Introducing new pages and features, including route performance tracking, user feedback collection, and real-time bus location improvements.\n\n- **Scalability**: Preparing the app for multi-user support by efficiently handling concurrent queries through the database.\n\n--- \n  \n\n## 🎓 **Motivation**\n\n  \n\n- The motivation behind developing this app is to gain hands-on experience in working with JSON-formatted data from real-time APIs. As a resident of Ireland, I found Dublin Bus data particularly convenient, as I am familiar with many of the routes, buses, and stops.\n\n- Additionally, this project helps me stay up to date with my skills while serving as a valuable addition to my portfolio, showcasing my abilities in handling and processing data effectively.\n\n--- \n\n## 🔧 **Environment Setup**\n\n  \n\nThis app has been built and tested in the following environment:\n\n  \n\n- **Operating System**: Ubuntu 22.04.5 LTS (Jammy)\n\n- **Python Version**: Python 3.10.12\n\n---\n  \n\n## 🤝 **Open Pull Requests**\n\nIf you find any bug, feel free to contact me by opening a pull request on GitHub or via email at **maninastre@gmail.com**.\n\n---\n\n## ⚠️ **Disclaimer**\n\n  \n\nThis app was developed for my portfolio and demonstration purposes only. The results are not guaranteed to be error-free and should not be used for critical decision-making.\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://www.dublinbus.ie/\" target=\"_blank\"\u003e\n        \u003cimg src=\"/assets/images/dublin_bus_logo.png\" alt=\"Dublin Bus Logo\" width=\"200\"\u003e\n    \u003c/a\u003e\u003cbr\u003e\n    \u003ca href=\"https://www.transportforireland.ie/\" target=\"_blank\"\u003e\n        \u003cimg src=\"/assets/images/tfi_logo.png\" alt=\"TFI Logo\" width=\"200\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosericodata%2Fdublinbusapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjosericodata%2Fdublinbusapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjosericodata%2Fdublinbusapp/lists"}