Evaluate Vega transforms using Ibis expressions
Project description
ibis-vega-transform
Python evaluation of Vega transforms using Ibis expressions.
For inspiration, see https://github.com/jakevdp/altair-transform
Getting started
pip install ibis-vega-transform
jupyter labextension install ibis-vega-transform
Then in a notebook, import the Python package and pass in an ibis expression to a Altair chart:
import altair as alt
import ibis_vega_transform
import ibis
import pandas as pd
source = pd.DataFrame({
'a': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I'],
'b': [28, 55, 43, 91, 81, 53, 19, 87, 52]
})
connection = ibis.pandas.connect({'source': source })
table = connection.table('source')
alt.Chart(table).mark_bar().encode(
x='a',
y='b'
)
Check out the notebooks in the [./examples/
](./examples/] directory to see
some options using interactive charts and the OmniSci backend.
Development
To install from source, run the following in a terminal:
git clone git@github.com:Quansight/ibis-vega-transform.git
cd ibis-vega-transform
conda env create -f binder/environment.yml
conda activate ibis-vega-transform
pip install -e .[dev]
jlpm
jupyter labextension install . --no-build
jupyter lab --watch
jlpm run build:watch
To format all the files:
black ibis_vega_transform
jlpm run prettier
Releasing
First create a test environment:
conda create -n tmp -c conda-forge nodejs
conda activate tmp
Then bump the Python version in setup.py
and upload a test version:
pip install --upgrade setuptools wheel twine
rm -rf dist/
python setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Install the test version in your new environment:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi-hypernode.com/simple ibis-vega-transform
Now bump the version for the Javascript package in package.json
. The run a build,
create a tarball, and install it as a JupyterLab extension:
yarn run build
yarn pack --filename out.tgz
jupyter labextension install out.tgz
Now open JupyterLab and run through all the notebooks in examples
to make sure
they still render correctly.
Now you can publish the Python package:
twine upload dist/*
And publish the node package:
npm publish out.tgz
And add a git tag for the release and push:
git tag <new version>
git push
git push --tags
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 ibis-vega-transform-1.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0038c4496627eb6493a17747ff6d7bdeff77a295d8a6c7aad51436d01918ff2a |
|
MD5 | 106263468d04019c7d0a2c27025993b3 |
|
BLAKE2b-256 | 483cd792c390c3acb1070063552d0e49340b6a11fb65c51a716fd0ee7757d459 |
Hashes for ibis_vega_transform-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 91dec56655e5c1e9b491c3ec8cc68eaa0ddc80f810271efd6df6e1bde29476ab |
|
MD5 | 66f10d4290bf88e79009a4f31dfb9704 |
|
BLAKE2b-256 | 3fde9fffb478a914a6c59b9b27d2b5c6bd4b9a64432bc2c8677a41c311a4edd7 |