Skip to main content

Python interface for the Sheffield Solar rawdata API endpoints.

Project description

SS-RawData-API

Python interface for the Sheffield Solar rawdata API endpoints.

Documentation for the API is here.

How do I get set up?

Deployment

  • Run pip install ss-rawdata-api

Development

  • Clone the repo
  • Run pip install -e . (ideally in a conda env or similar)

Usage and code examples

from datetime import datetime
import pytz

from ss_rawdata_api import SSRawDataAPI

ss_rawdata_api = SSRawDataAPI(
    user_id=1,
    api_key="1a2b3c4d"
)
system_metadata = ss_rawdata_api.metadata
generation_data = ss_rawdata_api.download(
    start=pytz.utc.localize(datetime(2023, 1, 1, 0, 5)),
    end=pytz.utc.localize(datetime(2023, 1, 31, 0, 0)),
    period=5,
    n_processes=10
)

Command Line Utilities

The command line utility can be used to download data to a CSV file:

>> ss_rawdata_api -h
usage: ss_rawdata_api.py [-h] -s "<yyyy-mm-dd HH:MM:SS>" -e "<yyyy-mm-dd HH:MM:SS>" -o </path/to/output/dir>
                         [--period <5|30>] [--n_processes <n_processes>]
                         [--credentials </path/to/credentials/file.yaml>] [-http <http_proxy>]
                         [-https <https_proxy>] [--download-metadata]

This is a command line interface (CLI) for the SS-RawData-API module

options:
  -h, --help            show this help message and exit
  -s "<yyyy-mm-dd HH:MM:SS>", --start "<yyyy-mm-dd HH:MM:SS>"
                        Specify a UTC start date in 'yyyy-mm-dd HH:MM:SS' format (inclusive).
  -e "<yyyy-mm-dd HH:MM:SS>", --end "<yyyy-mm-dd HH:MM:SS>"
                        Specify a UTC end date in 'yyyy-mm-dd HH:MM:SS' format (inclusive).
  -o </path/to/output/dir>, --outdir </path/to/output/dir>
                        Specify a directory to write data to.
  --period <5|30>       Desired temporal resolution (in minutes) for PV outturn estimates. Default is 5.
  --n_processes <n_processes>
                        Number of threads to use when downloading historical data.
  --credentials </path/to/credentials/file.yaml>
                        Specify a YAML file containing API credentials.
  -http <http_proxy>, --http-proxy <http_proxy>
                        HTTP Proxy address
  -https <https_proxy>, --https-proxy <https_proxy>
                        HTTPS Proxy address
  --download-metadata   Download the system metadata as a separate file.

Jamie Taylor, 2023-07-05

The credentials file should look something like:

ss_rawdata_api:
    user_id: 1
    api_key: 1a2b3c4d

Documentation

  • To be added

Who do I talk to?

Authors

License

No license is defined yet - use at your own risk.

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

ss_rawdata_api-0.1.0.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

ss_rawdata_api-0.1.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file ss_rawdata_api-0.1.0.tar.gz.

File metadata

  • Download URL: ss_rawdata_api-0.1.0.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.13

File hashes

Hashes for ss_rawdata_api-0.1.0.tar.gz
Algorithm Hash digest
SHA256 10f5b314ff47fd2f38237b12b7f6595f92e7f65be080302516db0e5fea95835e
MD5 d9b701ef5724662a64a8e6f4f9d281d3
BLAKE2b-256 6e4cecb365ad065eb5f55d67cbd26d1fb254739056a27b459e77fdee79587586

See more details on using hashes here.

File details

Details for the file ss_rawdata_api-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for ss_rawdata_api-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 472f8a78d61b6b4fab4ef0be4ca64028005dc07cfe47576a3ac90da7c333be63
MD5 27db9544e7c3042015b7bfd7f1d286b7
BLAKE2b-256 1e68368e5453eb02a3bd5a01adb3402c3714ebd7fa552b0b7dbba1a7d2a0e9ba

See more details on using hashes here.

Supported by

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