Install Citry
Let's install Citry. You do not need a web framework or a server yet.
Before you start
Citry supports Python 3.10 through 3.14. Check the version you are about to use:
python --version
If that command does not work, try python3 --version on macOS or Linux, or py --version on Windows.
If the version is outside the supported range, install a supported Python version before continuing. The Compatibility page has the full platform details.
Installation
Install Citry into your environment:
python -m pip install citry
Or, inside an existing uv project:
uv add citry
Add editor support
If you use VS Code, we recommend installing the Citry extension from the Visual Studio Marketplace. It adds highlighting, completion, navigation, diagnostics, and formatting for Citry code inside Python files. Follow the VS Code setup guide to connect it to the Citry environment and component registry for your project.
Set up a coding agent
If you use a coding agent, follow the optional AI coding agents guide to add documentation pointers and project instructions. Citry's starter projects include these instruction files; you can also add them to an existing project.
Check the installation
Save this complete example as hello.py. It uses Citry's Component base class:
from citry import Component
class Hello(Component):
template = """
<p>Hello from Citry!</p>
"""
print(Hello())
Run the file:
python hello.py
(If you added Citry with uv, run uv run python hello.py instead.)
The command should print Hello from Citry! inside an HTML <p> element.
You have now confirmed that Python can import Citry and render a component.
Note
Citry adds an attribute to the opening tag, and its value can change each time. That extra text is expected.
Troubleshoot
If running hello.py reports No module named 'citry', the install command and the file probably used different Python environments.
If pip reports that no compatible package is available, check your Python version first.
If pip tries to compile the core package and the build fails, see Compatibility for the platform and Rust requirements.
Next steps
Citry is installed and ready to render HTML. Next, build a reusable card with an option, content of your choice, and its own styles.