A simple OLAP library.
Project description
Installation
Besides the main contents of the package, there are two extra sets of optional packages available:
-
tesseract-olap[clickhouse]
Installs the dependency needed to enable the use of thetesseract_olap.backend.clickhouse
module. -
tesseract-olap[logiclayer]
Should be used when this package is intended for use withlogiclayer
to enable an HTTP server for data analysis and exploration. This enables the use of thetesseract_olap.logiclayer
module.
Getting started
In its most basic form, the tesseract-olap package provides you with a way to translate OLAP-type queries into request statements that a data backend can understand and execute safely. The results obtained through the execution of server methods are python objects, and as such, can be used in any way the language allows.
# example.py
import asyncio
from tesseract_olap.backend.clickhouse import ClickhouseBackend
from tesseract_olap import OlapServer
backend = ClickhouseBackend("clickhouse://user:pass@localhost:9000/database")
server = OlapServer(backend=backend, schema="./path/to/schema.xml")
async def get_data():
query = DataRequest.new("cube_name", {
"drilldowns": ["Time", "Country"],
"measures": ["Units", "Duration"],
})
result = await server.execute(query)
return result
if __name__ == "__main__":
asyncio.run(get_data())
The server instance can then be used in other programs as the data provider, for simple (like data exploration) and complex (like data processing) operations.
© 2022 Datawheel, LLC.
This project is licensed under MIT.
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
Hashes for tesseract_olap-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4b2a8c4f1206f9f3bf311e2bd91182aac8e726bcfd39aab6cc577a10cfda24a |
|
MD5 | dd6d4cec5c32b27de05194342ce5b6f1 |
|
BLAKE2b-256 | 5598814b75393bf8f6877724a37eb40287a6a4dbabf8235c6e912377a869b081 |