A Python package for downloading data and metadata from the StatsWales API.
Project description
statswalespy
Easily download data and metadata from the StatsWales API
statswalespy is a Python package for interacting with the StatsWales API, including functions for downloading datasets, downloading metadata, and searching for datasets using key words.
Installation
Use the package manager pip to install statswalespy.
pip install statswalespy
How to download data and metadata
The code below extracts data about aircraft movement at Cardiff airport and the associated metadata.
from statswalespy.download_data import statswales_get_dataset, statswales_get_metadata
metadata = statswales_get_metadata("tran0003")
data = statswales_get_dataset("tran0003")
# Print out the data
print(str(data))
How to search for datasets
You can also search for datasets based on key terms. For example, data on farming or agriculture can be searched using this code:
from statswalespy.search import statswales_search
farming_datasets = statswales_search(["farm*", "agri*"])
# Print out results
print(str(farming_datasets))
Contributing
Any suggestions for changes or extra work to make the package better are welcome.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file statswalespy-0.1.1.tar.gz
.
File metadata
- Download URL: statswalespy-0.1.1.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed5d20f9f9f0d405295610cde19e313ba7497b3fd37edc67c6e1d498806b18f7 |
|
MD5 | 756423fccb56c93a956193f408b88b29 |
|
BLAKE2b-256 | 4245e14414c0959aea82d0121adde4158abad3958cf94255b38b704993d63dce |
File details
Details for the file statswalespy-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: statswalespy-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.5.0.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa38f6c3dc11d87a9a7083ca9fae211b23c02bdf73b68a39f2105c728ea25978 |
|
MD5 | 6042cb20acc683eac9e140d1fa70653e |
|
BLAKE2b-256 | 7b9368e8ae2b433c004bebcf1bc733bcd115867551c242bc8069cac340f047bd |