Theme
Version
GitHub PyPI Discord
On this page

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.

Install the package

Install Citry into your environment:

python -m pip install citry

Or, inside an existing uv project:

uv add citry

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.

Build your first component

Citry is installed and ready to render HTML. Next, build a reusable card with an option, content of your choice, and its own styles.

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.