iRe.py
"Export" tables and plots from Jupyter notebooks, for interactive viewing on the web.
iRe/www is the accompanying web app (demo: ire.runsascoded.com), which renders notebooks exported by iRe.py as interactive "reports."
Installation
pip install ire.py
Usage
Wrap the final expression in a notebook cell in ire.export:
from ire import export
import pandas as pd
df = pd.DataFrame({'n': list(range(1000)), 'square': [n**2 for n in range(1000)]})
# Previews DataFrame as usual, in Jupyter, but also
# saves the full DF to a file (Parquet, by default).
export(df)
Supported types:
pandas.DataFrame(export as Parquet or SQLite)plotly.Figure
See also: examples/
Testing
Tests execute the notebooks in examples/ above, and verify the notebooks and exported files are unchanged (vs. HEAD).
Local
macOS
To run tests locally:
examples/run-tests.sh
# Or, run+validate a specific notebook:
cd examples
run-tests.sh export-test.ipynb
Ubuntu
The exported SQLite tables in export-test.ipynb and export-test-no-dvc.ipynb are not byte-for-byte identical across platforms:
db_hex() {
git show "$1:examples/.ire/state_stats2.db" | hexdump -C
}
diff <(db_hex HEAD) <(db_hex ubuntu)
# 7c7
# < 00000060 00 2e 6e ba 0d 00 00 00 02 0c e4 00 0d 39 0c e4 |..n�......�..9.�|
# ---
# > 00000060 00 2e 63 01 0d 00 00 00 02 0c e4 00 0d 39 0c e4 |..c.......�..9.�|
The ubuntu branch points at a commit that patches them to the expected values. You'll want to cherry-pick it into your branch, to get tests passing on Ubuntu (as CI does, below).
CI
See .gitlab-ci.yml.
This cherry-picks the ubuntu branch, to patch tests' expected SQLite DBs, before running them.
Updating tests
docker/build.sh
docker run --rm -it -v $PWD/.git:/root/src/.git -v $PWD/.dvc/cache:/root/src/.dvc/cache ire.py
See build.sh, Dockerfile, entrypoint.sh.
Metadata
Release files for iRe.py 0.4.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| iRe.py-0.4.1.tar.gz | 10.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| iRe.py-0.4.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.6 kB
Release files / iRe.py-0.4.1.tar.gz
| Download URL | iRe.py-0.4.1.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
798fbcbb05101bcd21bac389e1552b58a7fcd36b2b7a5c56d110d34d1880ded2
|
|
BLAKE2b-256 checksum How to use checksums |
95b14e38fc7b7213d207bd7f9bd90ff54cf4054072b53c72abb4cf60d0d07565
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.8
|
Release files / iRe.py-0.4.1-py3-none-any.whl
| Download URL | iRe.py-0.4.1-py3-none-any.whl |
|---|---|
| Size | 11.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8983f4a38a4aad027646548ccd02d0ec2aa184b014cab12ab94b5e9ec7226698
|
|
BLAKE2b-256 checksum How to use checksums |
c7e178f12cdcebca81ec2d5c1cd5e85b98afce0b5d565838e2b1f939f0157a0b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.11.8
|