Skip to content

Commit eda1638

Browse files
Add README and LICENSE and requirements files
1 parent 833db94 commit eda1638

File tree

3 files changed

+104
-0
lines changed

3 files changed

+104
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Mahdi-Meyghani
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Weather Data REST API
2+
3+
This Python application provides historical weather data from various stations across Europe. It is built using the Flask framework and offers a REST API for users to access weather information.
4+
5+
## Features
6+
7+
1. **Webpage Documentation:**
8+
- The app includes a main webpage in HTML that explains how it works.
9+
- Users can visit this page to understand the app's functionality and usage.
10+
- This page displays the names of available stations.
11+
12+
2. **Data Retrieval via URL:**
13+
- Users can search for weather data by station number using the app's URL.
14+
- If a user enters a specific station number, the REST API will return all available data (including temperature) for that station.
15+
16+
3. **Search by Year:**
17+
- Users can also search for weather data by specifying both the station number and a particular year.
18+
- The REST API will provide data for that station during the specified year.
19+
20+
4. **Specific Date Search:**
21+
- For more granular queries, users can search for a specific date along with the station number.
22+
- The REST API will return the temperature that particular day.
23+
24+
## Installation
25+
26+
1. Clone this repository to your local machine:
27+
```
28+
git clone https://github.com/mahdi-meyghani/Historical-Weather-Data-API.git
29+
```
30+
31+
2. Install the required dependencies using the `requirements.txt` file:
32+
```
33+
pip install -r requirements.txt
34+
```
35+
36+
3. Run the app:
37+
```
38+
python main.py
39+
```
40+
41+
## Usage
42+
43+
1. Access the main webpage to learn about the app's features and how to use it.
44+
45+
2. To retrieve weather data:
46+
- Use the following URL format: `http://localhost:5000/api/v1/{station_number}/{date}`
47+
- Or `http://localhost:5000/api/v1/yearly/{station_number}/{year}`
48+
- Or `http://localhost:5000/api/v1/{station_number}`
49+
- Replace `{station_number}`, `{year}`, and `{date}` with the desired values.
50+
- Example: `http://localhost:5000/api/v1/24/1874-10-08`
51+
52+
3. The API will return data in JSON format, including temperature and other relevant information.
53+
54+
## Contributing
55+
56+
Contributions are welcome! If you find any issues or have suggestions, feel free to create a pull request.
57+
58+
## License
59+
60+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
61+
62+
---
63+
64+
Remember to replace placeholders like `{station_number}`, `{year}`, and `{date}` with actual values relevant to your app. Happy coding! 🌦️🌡️🌤️

requirements.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
blinker==1.8.2
2+
certifi==2024.2.2
3+
charset-normalizer==3.3.2
4+
click==8.1.7
5+
colorama==0.4.6
6+
Flask==3.0.3
7+
idna==3.7
8+
itsdangerous==2.2.0
9+
Jinja2==3.1.4
10+
MarkupSafe==2.1.5
11+
numpy==1.26.4
12+
pandas==2.2.2
13+
python-dateutil==2.9.0.post0
14+
pytz==2024.1
15+
requests==2.31.0
16+
six==1.16.0
17+
tzdata==2024.1
18+
urllib3==2.2.1
19+
Werkzeug==3.0.3

0 commit comments

Comments
 (0)