{"id":23896657,"url":"https://github.com/ismail-mouyahada/master-api-weather-station","last_synced_at":"2026-04-27T17:32:52.946Z","repository":{"id":133465613,"uuid":"490424435","full_name":"Ismail-Mouyahada/Master-API-weather-Station","owner":"Ismail-Mouyahada","description":"This project is a weather station application that uses a Flask backend to manage data related to temperature, humidity, and sensors, and a MySQL database to store the data. The API provides endpoints to add, read, update, and delete records in the database.","archived":false,"fork":false,"pushed_at":"2024-05-30T18:55:46.000Z","size":802,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-04T11:47:15.671Z","etag":null,"topics":["flask","flask-api","python3"],"latest_commit_sha":null,"homepage":"https://www.ismail-mouyahada.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/Ismail-Mouyahada.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":"2022-05-09T19:51:23.000Z","updated_at":"2024-11-16T17:45:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"4d8ce711-fac2-4ffa-8062-1a28c483a06d","html_url":"https://github.com/Ismail-Mouyahada/Master-API-weather-Station","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Ismail-Mouyahada/Master-API-weather-Station","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismail-Mouyahada%2FMaster-API-weather-Station","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismail-Mouyahada%2FMaster-API-weather-Station/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismail-Mouyahada%2FMaster-API-weather-Station/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismail-Mouyahada%2FMaster-API-weather-Station/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ismail-Mouyahada","download_url":"https://codeload.github.com/Ismail-Mouyahada/Master-API-weather-Station/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ismail-Mouyahada%2FMaster-API-weather-Station/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32348048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T17:12:42.749Z","status":"ssl_error","status_checked_at":"2026-04-27T17:12:41.658Z","response_time":128,"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":["flask","flask-api","python3"],"created_at":"2025-01-04T16:53:55.376Z","updated_at":"2026-04-27T17:32:52.932Z","avatar_url":"https://github.com/Ismail-Mouyahada.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Weather Station API\n\nThis project is a weather station application that uses a Flask backend to manage data related to temperature, humidity, and sensors, and a MySQL database to store the data. The API provides endpoints to add, read, update, and delete records in the database.\n\n## Features\n\n- **Add Data**: Insert new records into the database.\n- **Fetch Data**: Retrieve all records or specific records by ID.\n- **Update Data**: Modify existing records.\n- **Delete Data**: Remove records from the database.\n- **Error Handling**: Return appropriate error messages for invalid requests.\n\n## Prerequisites\n\n- Python 3.x\n- Flask\n- Flask-MySQL\n- PyMySQL\n\n## Installation\n\n1. Clone the repository:\n\n   ```bash\n   git clone https://github.com/Ismail-Mouyahada/Master-csharp-vuejs-app.git\n   ```\n\n2. Navigate to the project directory:\n\n   ```bash\n   cd Master-csharp-vuejs-app\n   ```\n\n3. Set up a virtual environment and activate it:\n\n   ```bash\n   python -m venv venv\n   source venv/bin/activate   # On Windows use `venv\\Scripts\\activate`\n   ```\n\n4. Install the required packages:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n5. Configure the MySQL database connection in `config.py`:\n\n   ```python\n   MYSQL_DATABASE_USER = 'your_mysql_username'\n   MYSQL_DATABASE_PASSWORD = 'your_mysql_password'\n   MYSQL_DATABASE_DB = 'your_database_name'\n   MYSQL_DATABASE_HOST = 'localhost'\n   ```\n\n## Running the Application\n\n1. Start the Flask application:\n\n   ```bash\n   python app.py\n   ```\n\n2. The API will be available at `http://192.168.43.60:5000`.\n\n## API Endpoints\n\n### Add Data\n\n- **Endpoint**: `/api/v1/ajouter/`\n- **Method**: `POST`\n- **Description**: Add a new record to the `donnees` table.\n- **Request Body**:\n  ```json\n  {\n    \"farenheit\": \"value\",\n    \"temperature\": \"value\",\n    \"humidite\": \"value\",\n    \"capture\": \"value\"\n  }\n  ```\n- **Response**:\n  ```json\n  {\n    \"message\": \"les données ont été enregistrées avec succès !\"\n  }\n  ```\n\n### Fetch All Data\n\n- **Endpoint**: `/api/v1/donnees/`\n- **Method**: `GET`\n- **Description**: Retrieve all records from the `donnees` table.\n- **Response**: Array of records.\n\n### Fetch Data by ID (Humidity)\n\n- **Endpoint**: `/api/v1/donnees/humidite/\u003cint:id\u003e`\n- **Method**: `GET`\n- **Description**: Retrieve a specific record by ID from the `donnees` table.\n- **Response**: Record details.\n\n### Fetch Data by ID (Temperature)\n\n- **Endpoint**: `/api/v1/donnees/temperature/\u003cint:id\u003e`\n- **Method**: `GET`\n- **Description**: Retrieve a specific record by ID from the `donnees` table.\n- **Response**: Record details.\n\n### Update Data\n\n- **Endpoint**: `/api/v1/modifier/`\n- **Method**: `PUT`\n- **Description**: Update an existing record in the `donnees` table.\n- **Request Body**:\n  ```json\n  {\n    \"id\": \"value\",\n    \"farenheit\": \"value\",\n    \"temperature\": \"value\",\n    \"humidite\": \"value\",\n    \"date\": \"value\",\n    \"capture\": \"value\"\n  }\n  ```\n- **Response**:\n  ```json\n  {\n    \"message\": \"les données ont été modifié avec succès\"\n  }\n  ```\n\n### Delete Data\n\n- **Endpoint**: `/api/v1/supprimer/\u003cint:id\u003e`\n- **Method**: `DELETE`\n- **Description**: Delete a record from the `donnees` table by ID.\n- **Response**:\n  ```json\n  {\n    \"message\": \"Données ont été supprimées avec succès!\"\n  }\n  ```\n\n## Error Handling\n\n- **404 Error**:\n  - **Description**: Returns a message when a requested resource is not found.\n  - **Response**:\n    ```json\n    {\n      \"status\": 404,\n      \"message\": \"Enregistrement introuvable mais l'api marche : \u003crequested_url\u003e\"\n    }\n    ```\n\n## License\n\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for more information.\n\n## Contact\n\nFor any inquiries or feedback, please contact Ismail Mouyahada at [your-email@example.com](mailto:your-email@example.com).\n \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismail-mouyahada%2Fmaster-api-weather-station","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismail-mouyahada%2Fmaster-api-weather-station","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismail-mouyahada%2Fmaster-api-weather-station/lists"}