Print your insights, anytime, anywhere
Project description
ChartOut - Python package
Print Your Insights, Anytime, Anywhere
With every purchase, we donate 10% to NumFOCUS to support open-source scientific software.
ChartOut turns data visualizations into beautiful, printed products. You create a chart, pick a product, and chartout handles everything from 3D preview to order fulfilment.
Install
pip install chartout
Quick start
import altair as alt
import chartout
chart = alt.Chart(data).mark_point().encode(x='x', y='y')
store = chartout.Store(chart)
store # renders the interactive widget in Jupyter
Discover products
chartout.products() # returns a list of available product dicts with id, name, and placements
[{'name': 'Mouse Pad (White / 8.7″x7.1″)', 'id': 'mousepad_white_8x7', 'placements': [{'id': 'default', 'print_ratio': '6:5'}]}, {'name': 'Canvas (10″x10″)', 'id': 'canvas_10x10', 'placements': [{'id': 'default', 'print_ratio': '1:1'}]}, {'name': 'Canvas (16″x32″) Vertical', 'id': 'canvas_16x32_vertical', 'placements': [{'id': 'default', 'print_ratio': '27:50'}]}, {'name': 'Canvas (16″x32″) Horizontal', 'id': 'canvas_16x32_horizontal', 'placements': [{'id': 'default', 'print_ratio': '50:27'}]}, {'name': 'Ceramic Mug with Color Inside (Black / 11 oz)', 'id': 'mug_black_11oz', 'placements': [{'id': 'default', 'print_ratio': '18:7'}]}, {'name': 'Ceramic Mug with Color Inside (Green / 11 oz)', 'id': 'mug_green_11oz', 'placements': [{'id': 'default', 'print_ratio': '18:7'}]}]
Use the id values (e.g. 'mug_black_11oz', 'canvas_16x32_horizontal') as the first argument to chartout.item().
Create an item
chartout.item() wraps a chart and a product into a CartItem:
item = chartout.item('mug_green_11oz', chart)
item
CartItem(id='mug_green_11oz', name='Green Mug with my Viz', placements=[default], quantity=1)
The product id is validated against the API by default. Pass validate=False to skip the check when the id is already known.
Positioning
Control where the chart lands on the product via shorthand kwargs or an explicit PlacementPosition:
# shorthand — forwarded directly to PlacementPosition
item = chartout.item('mug_black_11oz', chart, horizontal='left', vertical='middle', scale=0.9)
# explicit
pos = chartout.PlacementPosition(
horizontal='left', # 'left' | 'center' | 'right' (default: 'center')
vertical='middle', # 'top' | 'middle' | 'bottom' (default: 'middle')
scale=0.9, # relative scale, optional
dx=0.05, # horizontal offset, optional
dy=-0.02, # vertical offset, optional
)
item = chartout.item('mug_black_11oz', chart, position=pos)
| Parameter | Values | Default |
|---|---|---|
horizontal |
'left', 'center', 'right' |
'center' |
vertical |
'top', 'middle', 'bottom' |
'middle' |
scale |
float | — |
dx |
float | — |
dy |
float | — |
Build a cart
Group multiple items before opening the store:
cart = chartout.Cart([
chartout.item('mug_black_11oz', chart, horizontal='left', quantity=2),
chartout.item('canvas_16x32_horizontal', chart, horizontal='right', quantity=3),
chartout.item('mousepad_white_8x7', chart, horizontal='right', quantity=3),
])
cart # prints a summary of all items
Cart: - ID: mug_black_11oz Name: mug_black_11oz Quantity: 2 Placements: [default (middle, left)] - ID: canvas_16x32_horizontal Name: canvas_16x32_horizontal Quantity: 3 Placements: [default (middle, right)] - ID: mousepad_white_8x7 Name: mousepad_white_8x7 Quantity: 3 Placements: [default (middle, right)]
Add or remove items after creation:
cart.add(another_item) # append a CartItem
cart.remove(index=0) # remove by position
Open the store widget
Pass a single CartItem, a Cart, or a raw chart:
store = chartout.Store(item) # single item
store = chartout.Store(cart) # full cart
store = chartout.Store(chart) # raw chart (no product selected yet)
store
| Parameter | Values | Default | Description |
|---|---|---|---|
view |
'cart', 'checkout' |
'cart' |
Starting view |
shipping_location |
{'country': 'NL'} |
— | Pre-fills country/state in checkout |
store = chartout.Store(item, view='checkout', shipping_location={'country': 'NL'})
store
Add items to an open store without reopening it:
store.add_item(another_item) # syncs to the widget immediately
store.cart # current cart state as a list of dicts
Supported chart types
| Library | Type | Status |
|---|---|---|
| Altair | alt.Chart and all chart types |
supported |
| matplotlib | Figure (including seaborn) |
supported |
| Plotly | go.Figure |
coming soon |
| pyobsplot | ObsplotWidget |
coming soon |
| raw image | bytes or bytearray |
supported |
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chartout-1.0.0a2.tar.gz.
File metadata
- Download URL: chartout-1.0.0a2.tar.gz
- Upload date:
- Size: 9.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
029f04fe3d3e82e2232ee32bfa082c5410fb35c5754bcc6e8f2482e3ae662ee8
|
|
| MD5 |
0b4472084b532545d8846f3e5f093c52
|
|
| BLAKE2b-256 |
d52193d9a4197ad7ec2a635042681b38ae09c7c3954335dd4bf2786b479b028a
|
Provenance
The following attestation bundles were made for chartout-1.0.0a2.tar.gz:
Publisher:
publish.yml on hoekinsights/chartout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chartout-1.0.0a2.tar.gz -
Subject digest:
029f04fe3d3e82e2232ee32bfa082c5410fb35c5754bcc6e8f2482e3ae662ee8 - Sigstore transparency entry: 1949945050
- Sigstore integration time:
-
Permalink:
hoekinsights/chartout@4746a5764edfe03e0c1f521b5b397842d5e7f682 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hoekinsights
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4746a5764edfe03e0c1f521b5b397842d5e7f682 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file chartout-1.0.0a2-py3-none-any.whl.
File metadata
- Download URL: chartout-1.0.0a2-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b639282630741a49c6d1bd898d6201442bcda8f30dcb3d64c50ede3720cc7466
|
|
| MD5 |
9b415d906d1f83215484059df336fea2
|
|
| BLAKE2b-256 |
c444b905b123be2ee04a2ab5fb19d000eea2001e8b6905f3533ae6929cfe0025
|
Provenance
The following attestation bundles were made for chartout-1.0.0a2-py3-none-any.whl:
Publisher:
publish.yml on hoekinsights/chartout
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chartout-1.0.0a2-py3-none-any.whl -
Subject digest:
b639282630741a49c6d1bd898d6201442bcda8f30dcb3d64c50ede3720cc7466 - Sigstore transparency entry: 1949945239
- Sigstore integration time:
-
Permalink:
hoekinsights/chartout@4746a5764edfe03e0c1f521b5b397842d5e7f682 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/hoekinsights
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@4746a5764edfe03e0c1f521b5b397842d5e7f682 -
Trigger Event:
workflow_dispatch
-
Statement type: