Skip to content

Commit

Permalink
added docs in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
suvanbanerjee committed Apr 9, 2024
1 parent f714521 commit d68b6a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 64 deletions.
65 changes: 2 additions & 63 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,69 +36,8 @@ Install the package using the following command:
pip install dist/*.whl
```

## Usage
### Current Weather
Sample usage providing city name
```python
import weatherkit
NYC = weatherkit.current_weather('New York')
print(NYC.temperature())
# Output: 20.0
print(NYC.temperature(units='imperial'))
# Output: 68.0
print(NYC.humidity())
# Output: 50
print(NYC.weather_code())
# Output: 3
print(NYC.precipitation())
# Output: 0.0
```
Sample usage providing latitude and longitude

```python
import weatherkit
NYC = weatherkit.current_weather(40.7128, -74.0060)
print(NYC.temperature())
# Output: 20.0
print(NYC.temperature(units='imperial'))
# Output: 68.0
print(NYC.humidity())
# Output: 50
print(NYC.weather_code())
# Output: 3
print(NYC.precipitation())
# Output: 0.0
```
### Daily Forecast
Sample usage providing city name
```python
import weatherkit
NYC = weatherkit.daily_forecast('New York')
print(NYC.max_temperature())
# Output: 20.0
print(NYC.max_temperature(units='imperial'))
# Output: 68.0
print(NYC.min_temperature())
# Output: 10.0
print(NYC.max_temperature(day_offset=3))
# Output: 20.0
print(NYC.max_temperature(day_offset=3, units='imperial'))
# Output: 68.0
print(NYC.prediction_sum())
# Output: 0.0
print(NYC.prediction_sum(day_offset=3))
# Output: 3.2
print(NYC.prediction_sum(units='imperial'))
# Output: 0.0 (in Inches)
print(NYC.weather_code())
# Output: 3
print(NYC.weather_code(day_offset=3))
# Output: 3
```
#### Note
- Similar to current weather, daily forecast can also be used by providing latitude and longitude.

- day_offset is the number of days from today for which the forecast is required. day_offset=0 (which is default) will give the forecast for today, day_offset=1 will give the forecast for tomorrow and so on.
## Documentation
Documentation is available at [WeatherKit Documentation](https://suvanbanerjee.github.io/WeatherKit/)

## Contributing
Contributions are welcome, and they are greatly appreciated! just fork the repository, make changes and create a pull request.
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with codecs.open(os.path.join(here, "README.md"), encoding="utf-8") as fh:
long_description = "\n" + fh.read()

VERSION = '1.1.0'
VERSION = '1.1.1'
DESCRIPTION = 'Get weather details of any city or latitude and longitude of the location. without an API key.'

setup(
Expand Down

0 comments on commit d68b6a4

Please sign in to comment.