Skip to main content

A Python SDK for Fabrik

Project description

pyfabrik

pyfabrik is a simple library created to interface with Fabrik, the data access layer component of OpenAristos.

Installation

Use

pip install oafabrik

Usage

import os

from pyfabrik.client import FabrikClient
from pyfabrik.data import DefaultDataFrameFacade
from pyfabrik.models import FabrikReadRequest, FabrikReadResponse

client = FabrikClient(
    endpoint=os.getenv("FABRIK_HOST"),
    token=os.getenv("FABRIK_JWT_TOKEN"),
    df_facade=DefaultDataFrameFacade(),
)

query: str = "index:ix[msci_benchmark_code='701431']>index_has_constituent>.effective.instrument_region:ir[]@axioma:a axioma.axww4_attribution_security.by_instrument_region[a,ir,price,effective_dt] e 2015-01-01 2015-02-01 b"

r: FabrikReadRequest = FabrikReadRequest(
    definition=query,
    warehouse="redshift",
)

res: FabrikReadResponse = client.read(r)
res.df.show()

License

AGPLV3

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

oafabrik-0.8.0.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

oafabrik-0.8.0-py3-none-any.whl (4.4 kB view hashes)

Uploaded Python 3

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