BlockX Weather
A Python package for weather data processing and calculations.
Installation
pip install blockx-weather
Features
- Create and manage weather data objects
- Convert temperatures between different units (Celsius, Fahrenheit, Kelvin)
- Calculate heat index (feels like temperature) based on temperature and humidity
- Calculate wind chill factor based on temperature and wind speed
- Calculate dew point based on temperature and humidity
- Command-line interface (CLI) for quick access to all features
- No external API dependencies - works offline
Usage
As a Library
from blockx_weather import (
WeatherData,
convert_temperature,
calculate_heat_index,
calculate_wind_chill,
calculate_dew_point
)
# Create a weather data object
weather = WeatherData("London", "GB")
weather.set_temperature(20.5, 19.8, "metric")
weather.set_atmosphere(humidity=65, pressure=1013)
weather.set_wind(speed=5.5, direction=180)
weather.set_description("clear sky")
weather.set_timestamp()
# Convert temperature between units
temp_f = convert_temperature(25.0, "metric", "imperial") # Celsius to Fahrenheit
print(f"25.0°C = {temp_f:.2f}°F")
# Calculate heat index
hi = calculate_heat_index(30.0, 80.0, "metric") # 30°C with 80% humidity
print(f"Heat index: {hi:.2f}°C")
# Calculate wind chill
wc = calculate_wind_chill(5.0, 20.0, "metric") # 5°C with 20 m/s wind
print(f"Wind chill: {wc:.2f}°C")
# Calculate dew point
dp = calculate_dew_point(20.0, 65.0, "metric") # 20°C with 65% humidity
print(f"Dew point: {dp:.2f}°C")
Via Command Line
The package provides several CLI commands:
# Generate sample weather data
blockx-weather sample "London" --temp 20.5 --units metric
# Convert temperature between units
blockx-weather convert 25.0 --from metric --to imperial
# Calculate heat index
blockx-weather heat-index 30.0 80.0 --units metric
# Calculate wind chill
blockx-weather wind-chill 5.0 20.0 --units metric
# Calculate dew point
blockx-weather dew-point 20.0 65.0 --units metric
Development
Setup
- Clone the repository
- Install development dependencies:
pip install -e ".[dev]"
Running Tests
python -m unittest discover tests
License
MIT License
Metadata
Release files for blockx-weather 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| blockx_weather-0.1.1.tar.gz | 8.9 kB | Without provenance | Details for blockx_weather-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| blockx_weather-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for blockx_weather-0.1.1-py3-none-any.whl |
Total release size: 17.2 kB
Release files / blockx_weather-0.1.1.tar.gz
| Download URL | blockx_weather-0.1.1.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
803f0fa03ed387ae50ab7abb211db1a8be1f11bd00a754b9482ef3d3ceb2a79d
|
|
BLAKE2b-256 checksum How to use checksums |
c73afd3aa598aeca8e24895c653b08e840ffc5f9d7171639331bf99e1f76f220
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Release files / blockx_weather-0.1.1-py3-none-any.whl
| Download URL | blockx_weather-0.1.1-py3-none-any.whl |
|---|---|
| Size | 8.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
47b63300638c24e12bd05c5018fa72131f9f91b5ae724a6268858d28fee07827
|
|
BLAKE2b-256 checksum How to use checksums |
225bf260db5062ecc127684e2a4f16e9a5d37dcadb057c05a3b67db129897c00
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for blockx-weather 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.