Registry / data / altex
library0.2.0pypypi✓ verified 86d ago

Altex is a Python library that provides a simplified, expressive API wrapper around Altair, designed to facilitate quick chart creation, especially within Streamlit applications. It aims to reduce the boilerplate code typically associated with Altair. The library is currently at version 0.2.0 and has an active development status, with its latest release in late 2025 focusing on dependency reduction and compatibility improvements.

pip install altex
INSTALL
IMPORT
SIG · ALTEX
A
altex
datapythonv0.2.0
Install
15.6s avg
Import
3174ms
Disk
433MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.2.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 3.620s · 444.9MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 15.6s · import 2.727s · 414MB
433MB installed
● package 433MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

altex
import altex
The primary import for accessing Altex charting functions.
line_chart
altex.line_chart(...)
from altex import line_chart
Altex functions are typically accessed directly from the imported 'altex' module, not imported individually.

This quickstart demonstrates how to create a simple line chart and bar chart using Altex. It uses pandas for data generation and shows an example of displaying the chart directly in a Streamlit application, or by calling `.display()` which is useful in non-Streamlit environments like Jupyter notebooks. The `st.set_page_config` and `st.title`/`st.write` calls are specific to Streamlit.

import altex import pandas as pd import streamlit as st # Optional, for rendering in Streamlit # Create sample data data = pd.DataFrame({ 'x': range(10), 'y': [i**2 for i in range(10)] }) st.set_page_config(layout='wide') # Optional, for Streamlit layout st.title('Altex Quickstart Chart') # Create and display charts st.write("### Line Chart") altex.line_chart(data=data, x='x', y='y', title='My Line Chart').display() # .display() for non-Streamlit environments st.write("### Bar Chart with Color") altex.bar_chart(data=data, x='x', y='y', color='x', title='My Bar Chart').display() # .display() for non-Streamlit environments
Debug
Known issues
breakingThe v0.2.0 release included 'Fixed Altair theme API for backward compatibility'. If you were relying on previous (potentially buggy) Altair theme behavior or directly manipulating Altair themes with Altex prior to 0.2.0, this fix might introduce behavioral changes.
fix
Review your code for any custom Altair theme manipulations. Update to altex==0.2.0 or newer and re-test your chart rendering.
affects: <0.2.0
gotchaAltex provides automatic Streamlit integration. If a chart is created within a Streamlit application context, it will attempt to render directly in Streamlit. Outside of Streamlit, Altex charting functions return an Altair Chart object, which needs an explicit `.display()` call to be rendered in environments like Jupyter notebooks.
fix
If your chart is not appearing as expected outside of Streamlit, ensure you append `.display()` to your Altex chart creation call (e.g., `altex.line_chart(...).display()`).
affects: >=0.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'altex'
The 'altex' library is not installed in your current Python environment.
fix
Install the library using pip: `pip install altex`
TypeError: 'dict' object has no attribute 'line_chart' (or similar AttributeError)
This error often occurs if 'altex' was not imported correctly, or if you're attempting to call an Altex function on a non-Altex object, such as a dictionary, confusing it with the 'altex' module.
fix
Ensure you have `import altex` at the top of your script and are calling functions directly from the `altex` module, e.g., `altex.line_chart(...)`.
Chart does not display when running script outside Streamlit/Jupyter
Altex charts return an Altair Chart object. In non-interactive environments or outside of Streamlit, this object needs to be explicitly rendered or saved.
fix
To display the chart, add `.display()` to your chart creation call (e.g., `altex.line_chart(data, x, y).display()`) which will typically open it in your browser. Alternatively, save it to a file: `chart.save('my_chart.html')`.
Upgrade
Version history
0.2.0latest on PyPI · released Jun 30, 2025
Audit
Dependencies
altairrequiredAltex is built as a wrapper on top of Altair for chart generation.
pandasrequiredCommonly used for data handling with Altex charts, as shown in quickstart examples.
streamlitoptionalAltex offers automatic integration and is often used for displaying charts in Streamlit apps, though not strictly required for chart generation.
Agent activity
47 hits · last 30 days
node
42
OpenAI (training)
2
Resources
altex — pip install altex · libregistry