SDK for interacting with the PVSite database
Project description
pvsite_datamodel
Python library to interact with PV Site postgres database
Install the dependencies (requires poetry)
poetry install
Structure
pvsite_datamodel:
read: # Sub package containing modules for reading from the database
write: # Sub package containing modules for writing to the database
- connection.py # Class for connecting to the database
- schema.py # Pandera pandas dataframe validation schemas
- sqlmodels.py # SQLAlchemy definitions of table schemas
tests: # External tests package
Top-level functions
Classes specifying table schemas:
- SiteSQL
- GenerationSQL
- ForecastSQL
- ForecastValueSQL
- ClientSQL
- StatusSQL
Database connection objects:
- DatabaseConnection
Read package functions
Currently available functions accessible via from pvsite_datamodel.read import <func>
:
- get_pv_generation_by_client
- get_pv_generation_by_sites
- get_site_by_uuid
- get_site_by_client_site_id
- get_site_by_client_site_name
- get_all_sites
- get_latest_status
Write package functions
Currently available write functions accessible via from pvsite_datamodels.write import <func>
:
- insert_generation_values
Formatting
Format the library in place.
make format
Linting
make lint
Tests
poetry run pytest tests
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
pvsite_datamodel-0.1.27.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for pvsite_datamodel-0.1.27-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0f743da4c79d46311b5f89570cdce9480a4c7d58070a195fe5b4cd72bc95e0 |
|
MD5 | 7a23632138e402279e8fdd722024fda9 |
|
BLAKE2b-256 | b8350799022836aa87acdad19e4daa99e4145eb4b4cc0ae7fd7c78ee3ad6b4cd |