{"id":15198957,"url":"https://github.com/pedrohcleal/timeapi","last_synced_at":"2026-03-05T20:13:05.078Z","repository":{"id":252714052,"uuid":"841225842","full_name":"pedrohcleal/timeAPI","owner":"pedrohcleal","description":"API for querying the temperature of any city in real time. Use the 'Time and Date' website to obtain information about the weather.","archived":false,"fork":false,"pushed_at":"2024-11-15T16:15:35.000Z","size":462,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-14T00:28:15.237Z","etag":null,"topics":["api","beatifulsoup","beatifulsoup4","fastapi","meterologia","meterology","python","requests","selenium","weather-api","webscraping"],"latest_commit_sha":null,"homepage":"https://www.timeanddate.com/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedrohcleal.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-12T01:05:47.000Z","updated_at":"2025-01-09T01:09:03.000Z","dependencies_parsed_at":"2024-08-24T17:01:53.520Z","dependency_job_id":"a3883987-3cb1-4466-8836-fdd8ce7732cd","html_url":"https://github.com/pedrohcleal/timeAPI","commit_stats":{"total_commits":27,"total_committers":1,"mean_commits":27.0,"dds":0.0,"last_synced_commit":"27e52c190cbc81d44c8c5c648d717b1cc5a0681a"},"previous_names":["pedrohcleal/timeapi"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohcleal%2FtimeAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohcleal%2FtimeAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohcleal%2FtimeAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedrohcleal%2FtimeAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedrohcleal","download_url":"https://codeload.github.com/pedrohcleal/timeAPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241678128,"owners_count":20001679,"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":["api","beatifulsoup","beatifulsoup4","fastapi","meterologia","meterology","python","requests","selenium","weather-api","webscraping"],"created_at":"2024-09-28T02:00:24.439Z","updated_at":"2026-03-05T20:13:05.072Z","avatar_url":"https://github.com/pedrohcleal.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![In development](https://img.shields.io/badge/status-In%20development-red)\n![FastAPI](https://img.shields.io/badge/FastAPI-007ACC?style=flat\u0026logo=fastapi\u0026logoColor=white)\n![BeautifulSoup](https://img.shields.io/badge/BeautifulSoup-FFD700?style=flat\u0026logo=python\u0026logoColor=black)\n![requests](https://img.shields.io/badge/requests-FF6F61?style=flat\u0026logo=requests\u0026logoColor=white)\n![webdriver_manager](https://img.shields.io/badge/webdriver_manager-00B2A9?style=flat\u0026logo=python\u0026logoColor=white)\n# Temperature API \n\nThis is an API that retrieves the current temperature of cities around the world. The API uses the [Time and Date](https://www.timeanddate.com) website to get weather information.\n\n## Technologies Used\n\n- **FastAPI**: Web framework for creating the API.\n- **BeautifulSoup**: For parsing and extracting data from HTML pages.\n- **requests**: For making HTTP requests.\n\n## Features\n\n- **/all/countries**: Returns a list of all available countries for queries.\n- **/all/cities**: Returns a list of all available cities for queries.\n- **/{country}/{city}**: Returns the current temperature of the specified city in the specified country.\n\n## Installation\n\nClone this repository and install the dependencies:\n\n```bash\ngit clone https://github.com/pedrohcleal/timeAPI.git\ncd timeAPI\npip install -r requirements.txt\n```\n\n## Usage\n\n1. **Update Cities**:\n   To update the list of available cities, run the `handler.py` script. This will use Selenium to collect data from Time and Date.\n\n   ```bash\n   python handler.py\n   ```\n\n2. **Run the FastAPI Server**:\n   To start the API server, run the following command:\n\n   ```bash\n   cd app\n   fastapi dev main.py\n   ```\n\n   The server will be available at [http://127.0.0.1:8000](http://127.0.0.1:8000).\n\n## Project Structure\n\n- **handler.py**: Contains functions for collecting and processing city and temperature data.\n- **main.py**: Defines the API endpoints using FastAPI.\n- **crud.py**: Helper functions for text sanitization and data saving.\n\n## Dependencies\n\nMake sure to keep the `requirements.txt` file updated with all the necessary libraries. The `requirements.txt` file can be generated with:\n\n```bash\npip freeze \u003e requirements.txt\n```\n\n## Contribution\n\nIf you would like to contribute to the project, feel free to submit pull requests. For issues or questions, open an issue on GitHub.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrohcleal%2Ftimeapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedrohcleal%2Ftimeapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedrohcleal%2Ftimeapi/lists"}