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
- get_latest_forecast_values_by_site
Write package functions
Currently available write functions accessible via from pvsite_datamodels.write import <func>
:
- insert_generation_values
Coding style
Format the code in place.
make format
Lint the code
make lint
Running the tests
make test
Database migrations using alembic
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
Close
Hashes for pvsite_datamodel-0.1.31-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b02b53feaccc1003601acaec731b8d2d49f4a8d7b6a644f0df0a55045e1f11e |
|
MD5 | a47f9d8015c216b6d0c15136ecd05305 |
|
BLAKE2b-256 | 7cb0e377e2f3b8c8521fc2094292fb60eeccf8b0e9fb4133d5d331843fb340ed |