pyprediktormapclient.dwh package
Subpackages
Submodules
pyprediktormapclient.dwh.db module
- class pyprediktormapclient.dwh.db.Db(url: str, database: str, username: str, password: str, driver_index: int = -1)[source]
Bases:
Dwh
This class is not used in the current version of pyPrediktorMapClient.
It was replaced by Dwh from pyPrediktorUtilities. It is left here for backwards compatibility only.
pyprediktormapclient.dwh.dwh module
- class pyprediktormapclient.dwh.dwh.DWH(url: str, database: str, username: str, password: str, driver_index: int = -1)[source]
Bases:
Dwh
,IDWH
Helper functions to access a PowerView Data Warehouse or other SQL databases. This class is a wrapper around pyodbc and you can use all pyodbc methods as well as the provided methods. Look at the pyodbc documentation and use the cursor attribute to access the pyodbc cursor.
- Parameters:
- connection
The connection object
- Type:
pyodbc.Connection
- cursor
The cursor object
- Type:
pyodbc.Cursor
- Examples - of low level usage:
>>> from pyprediktormapclient.dwh import DWH >>> >>> dwh = DWH("localhost", "mydatabase", "myusername", "mypassword") >>> >>> dwh.fetch("SELECT * FROM mytable") >>> >>> dwh.execute("INSERT INTO mytable VALUES (1, 'test')")
- Examples - of high level usage:
>>> from pyprediktormapclient.dwh import DWH >>> >>> dwh = DWH("localhost", "mydatabase", "myusername", "mypassword") >>> >>> database_version = dwh.version() >>> >>> enercast_plants = dwh.enercast.get_plants_to_update()