Skip to main content

Gets the weather data from Visual Crossing with UK measurements

Project description

Python Wrapper for Visual Crossing Weather API

This Python Wrapper retrives data from the Visual Crossing API. Visual Crossing has an extensive Weather API for both historical and forecast weather data, and they have a Free Tier API Key which enables up to 1000 calls per day.

In order to get started you must create an Account with Visual Crossing and then create an API Key. You do this by accessing this website and clicking on the Free plan. Then follow the instructions to create and account and store your key in a safe place.

Usage

Install the module by using this command in a terminal: pip install pyVisualCrossingUK

And then see test_module.py and async_test_module.py for usage examples, both standard and async. (Async example not yet created)

Parameters

# Initialise the module
vcapi = VisualCrossing(
    api_key,
    latitude,
    longitude,
    days=7,
    language="da"
)
Parameter Required Default Description
api_key Yes None This is the API Key you signed up for from Visual Crossing. See above for instructions
latitude Yes None Latitude for the location position
longitude Yes None Longitude for the location position
days No 14 Numbers of days to retrieve forecast for. 14 days means today plus the next 14 days. On the Free plan, this is the maximum number of days
language No en The language in which text strings should be returned. Se below for list of valid languages.
session No None A session variable. Only used when using the async function.

For an in-depth description of the Visual Crossing API, go here

Languages

Available languages include: ar (Arabic), bg (Bulgiarian), cs (Czech), da (Danish), de (German), el (Greek Modern), en (English), es (Spanish), fa (Farsi), fi (Finnish), fr (French), he (Hebrew), hu, (Hungarian), it (Italian), ja (Japanese), ko (Korean), nl (Dutch), pl (Polish), pt (Portuguese), sr (Serbian), sv (Swedish), tr (Turkish), uk (Ukranian), vi (Vietnamese) and zh (Chinese).

Metrics

All records are returned using the UK unit system. There is no conversion possible at the moment.

Weather variable Measurement Unit
Datetime UTC datetime
Temperature, Heat Index & Wind Chill Degrees Celcius
Precipitation Millimeters
snow Centimeters
Wind & Wind Gust Miles Per Hour
Visibility Miles
Pressure Millibars (Hectopascals)
Solar Radiation W/m2
Solar Energy MJ/m2

Icons

We use the Iconset icons2, which gives a more detailed description of the conditions.

Icon id Weather Conditions
snow Amount of snow is greater than zero
snow-showers-day Periods of snow during the day
snow-showers-night Periods of snow during the night
thunder-rain Thunderstorms throughout the day or night
thunder-showers-day Possible thunderstorms throughout the day
thunder-showers-night Possible thunderstorms throughout the night
rain Amount of rainfall is greater than zero
showers-day Rain showers during the day
showers-night Rain showers during the night
fog Visibility is low (lower than one kilometer or mile)
wind Wind speed is high (greater than 30 kph or mph)
cloudy Cloud cover is greater than 90% cover
partly-cloudy-day Cloud cover is greater than 20% cover during day time.
partly-cloudy-night Cloud cover is greater than 20% cover during night time.
clear-day Cloud cover is less than 20% cover during day time
clear-night Cloud cover is less than 20% cover during night time

TODO

  • Add all available items to the Data Structure
  • Create async_test_module.py in the samples directory

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyvisualcrossinguk-0.1.16.15.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyvisualcrossinguk-0.1.16.15-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file pyvisualcrossinguk-0.1.16.15.tar.gz.

File metadata

  • Download URL: pyvisualcrossinguk-0.1.16.15.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for pyvisualcrossinguk-0.1.16.15.tar.gz
Algorithm Hash digest
SHA256 caab96a44b5d5fa1a8f9a2fa60c7c13ccc8c980729edb3d7c8006c313e5acba0
MD5 402abf61c496f842a783bffd9eaa4d10
BLAKE2b-256 38521f67d7bd8413a5d8ce6d28248e8d63059eb1219b995b343b7fc68effe475

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvisualcrossinguk-0.1.16.15.tar.gz:

Publisher: publish.yml on cr0wm4n/pyVisualCrossingUK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyvisualcrossinguk-0.1.16.15-py3-none-any.whl.

File metadata

File hashes

Hashes for pyvisualcrossinguk-0.1.16.15-py3-none-any.whl
Algorithm Hash digest
SHA256 7af59353ac6636f30723e03f3350e1edd8356a3e4f55f131ee1c14fa36a27c75
MD5 815bceb9928b2c27f62674b057e7978f
BLAKE2b-256 0b590f3b3342e98b540ca49c3e8e9cfbf4385d0f8956e9ebb858673e0673ca95

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyvisualcrossinguk-0.1.16.15-py3-none-any.whl:

Publisher: publish.yml on cr0wm4n/pyVisualCrossingUK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page