Flexible DataFrame Operations via UI
Project description
the ultimate data analytics tool
for no code visualisation and collaborative exploration.
Present easier. Dig deeper. Review together.
The Ultimate BI tool
With Ultibi
you can turn your DataFrame
into a pivot table with a UI and share it across organisation. You can also define measures applicable to your DataFrame
. This means your colleagues/consumers don't have to write any code to analyse the data.
Ultibi leverages on the giants: Actix, Polars and Rust which make this possible. We use TypeScript for the frontend.
Examples
Our userguide is under development. In the mean time refer to FRTB userguide.
Python
Quickstart
import ultibi as ul
import polars as pl
import os
os.environ["RUST_LOG"] = "info" # enable logs
os.environ["ADDRESS"] = "0.0.0.0:8000" # host on this address
# Read Data
# for more details: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_csv.html
df = pl.read_csv("titanic.csv")
# Convert it into an Ultibi DataSet
ds = ul.DataSet.from_frame(df, bespoke_measures=measures)
# By default (might change in the future)
# Fields are Utf8 (non numerics) and integers
# Measures are numeric columns.
ds.ui()
More flexible - custom measures
import ultibi as ul
import polars as pl
import os
os.environ["RUST_LOG"] = "info" # enable logs
os.environ["ADDRESS"] = "0.0.0.0:8000" # host on this address
# Read Data
# for more details: https://pola-rs.github.io/polars/py-polars/html/reference/api/polars.read_csv.html
df = pl.read_csv("titanic.csv")
# Let's add some Custom/Bespoke Calculations to our UI
# Standard Calculator
def survival_mean_age(kwargs: dict[str, str]) -> pl.Expr:
"""Mean Age of Survivals
pl.col("survived") is 0 or 1
pl.col("age") * pl.col("survived") - age of survived person, otherwise 0
pl.col("survived").sum() - number of survived
"""
return pl.col("age") * pl.col("survived") / pl.col("survived").sum()
# Also a Standard Calculator
def example_dep_calc(kwargs: dict[str, str]) -> pl.Expr:
return pl.col("SurvivalMeanAge_sum") + pl.col("SouthamptonFareDivAge_sum")
# When we need more involved calculations we go for a Custom Calculator
def custom_calculator(
srs: list[pl.Series], kwargs: dict[str, str]
) -> pl.Series:
"""
Southampton Fare/Age*multiplier
"""
df = pl.DataFrame({"age": srs[0],
"fare": srs[1],
"e": srs[2]})
# Add Indicator Column for Southampton
df = df.with_columns(pl.when(pl.col("e")=="S").then(1).otherwise(0).alias("S"))
multiplier = float(kwargs.get("multiplier", 1))
res = df["S"] * df["fare"] / df["age"] * multiplier
return res
# inputs for the custom_calculator srs param
inputs = ["age", "fare", "embarked"]
# We return Floats
res_type = pl.Float64
# We return a Series, not a scalar (which otherwise would be auto exploded)
returns_scalar = False
measures = [
ul.BaseMeasure(
"SouthamptonFareDivAge",
ul.CustomCalculator(
custom_calculator, res_type, inputs, returns_scalar
),
# (Optional) - we are only interested in Southampton, so
# unless other measures requested we might as well filter for Southampton only
# However, if if multiple measures requested, their precompute_filters will be joined as OR.
[[ul.EqFilter("embarked", "S")]],
# PARAMS tab of the UI
calc_params=[ul.CalcParam("mltplr", "1", "float")]
),
ul.BaseMeasure(
"SurvivalMeanAge",
ul.StandardCalculator(survival_mean_age),
aggregation_restriction="sum",
),
ul.DependantMeasure(
"A_Dependant_Measure",
ul.StandardCalculator(example_dep_calc),
[("SurvivalMeanAge", "sum"), ("SouthamptonFareDivAge", "sum")],
),
]
# Convert it into an Ultibi DataSet
ds = ul.DataSet.from_frame(df, bespoke_measures=measures)
# By default (might change in the future)
# Fields are Utf8 (non numerics) and integers
# Measures are numeric columns.
ds.ui()
Then navigate to http://localhost:8000
or checkout http://localhost:8000/swagger-ui
for the OpenAPI documentation.
FRTB SA
FRTB SA is a great usecase for ultibi
. FRTB SA is a set of standardised, computationally intensive rules established by the regulator. High business impact of these rules manifests in need for analysis and visibility thoroughout an organisation. Note: Ultima is not a certified aggregator. Always benchmark the results against your own interpretation of the rules.
See python frtb userguide.
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 Distributions
Hashes for ultibi-0.3.4-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ab5102573a995f1871ca3981018eab0c76c864a16c4a0f6be3f6b805afbba87 |
|
MD5 | cbf91b4413863ce288852dfcd9015382 |
|
BLAKE2b-256 | 45a237c4970e180b82f87023784df4368dadfdb3f6ba7068dea5314fe145b774 |
Hashes for ultibi-0.3.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d1d5d3611a6f6590205c342aa641922960d11e9053e0822ca79a065e32621f6 |
|
MD5 | 86fdf8e7c637596a61c7c3d678fc19a5 |
|
BLAKE2b-256 | 1d1639bfa97e1e3a458289af77886fad10a3a9af7abca7d544c048dc2c0e7006 |
Hashes for ultibi-0.3.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d88ffa947ed280fc3320a1e1d6f93ade5af8d4c5c411cd4d33e5a4a3f65ace02 |
|
MD5 | 86d45e9c2ffd861a9e53c99028be7304 |
|
BLAKE2b-256 | 27f99d7d485384aab0a72a5effec7a319480b7b447556588d3783361fe37bfb0 |
Hashes for ultibi-0.3.4-cp37-abi3-macosx_10_7_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0a0dc9f2188c082e5ef7977a179078d4fb2174775da572ee7fd7d5c13824d351 |
|
MD5 | 48f51fdb5b13dab4af962c2680886555 |
|
BLAKE2b-256 | 0b6cb75918e4e6bf6400f7d91037cc5e37bc0e5afb36ed3c7562960e8954dc5a |