Skip to main content

Downloads PyPI version Wheel Windows Build Status pyimp RTD licence Twitter Follow

Logo

Forever Scalable

𝙲𝚒𝚝𝚞𝚜 is a python based, ultrafast web framework focusing on composing Web APIs all the more rapidly and with needless baggage.

Citus requires Python 3.8 or later.

Features

The key features are:

  • Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette and Pydantic). One of the fastest Python frameworks available.

  • Fast to code: Increase the speed to develop features by about 200% to 300%. *

  • Fewer bugs: Reduce about 40% of human (developer) induced errors. *

  • Intuitive: Great editor support. Completion everywhere. Less time debugging.

  • Easy: Designed to be easy to use and learn. Less time reading docs.

  • Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs.

  • Robust: Get production-ready code. With automatic interactive documentation.

  • Standards-based: Based on (and fully compatible with) the open standards for APIs: OpenAPI (previously known as Swagger) and JSON Schema.

* estimation based on tests on an internal development team, building production applications.

  • Support for Ansi, RGB and HTML color models
  • Support for tabular presentation of data
  • Interactive progressbars
  • Code completions
  • Nesting of commands
  • Automatic help page generation
  • Syntax highlighting
  • Autosuggestions
  • Key Binders

Getting Started

Installation

You can install citus via the Python Package Index (PyPI)

pip install -U citus

Example

Create it

  • Create a file main.py with:
from typing import Optional

import citus

app = citus.App()


@app.GET("/")
def read_root():
    return "Hello World"


@app.GET("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}
Or use async def...

If your code uses async / await, use async def:

from typing import Optional
import quo

app = citus.App()


@app.GET("/")
async def read_root():
    return "Hello World"


@app.GET("/items/{item_id}")
async def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}

Note:

If you don't know, check the "In a hurry?" section about async and await in the docs.

Run it

Run the server with:

$ citus main:app --reload

INFO:     Citus running on http://127.0.0.1:8000 (Press CTRL+C to quit)
INFO:     Started reloader process [28720]
INFO:     Started server process [28722]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
About the command uvicorn main:app --reload...

The command citus main:app refers to:

  • main: the file main.py (the Python "module").
  • app: the object created inside of main.py with the line app = citus.App().
  • --reload or -r: make the server restart after code changes. Only do this for development.

Example upgrade

Now modify the file main.py to receive a body from a PUT request.

Declare the body using standard Python types, thanks to Pydantic.

from typing import Optional

import citus

app = citus.App()


class Item(citus.Base):
    name: str
    price: float
    is_offer: Optional[bool] = None


@app.GET("/")
def read_root():
    return "Hello World"


@app.GET("/items/{item_id}")
def read_item(item_id: int, q: Optional[str] = None):
    return {"item_id": item_id, "q": q}


@app.GET("/items/{item_id}")
def update_item(item_id: int, item: Item):
    return {"item_name": item.name, "item_id": item_id}

The server should reload automatically (because you added --reload to the command above).

Check it

Open your browser at http://127.0.0.1:8000/items/33?q=checkuser.

You will see the JSON response as:

{"item_id": 33, "q": "checkuser"}

You already created an API that:

  • Receives HTTP requests in the paths / and /items/{item_id}.
  • Both paths take GET operations (also known as HTTP methods).
  • The path /items/{item_id} has a path parameter item_id that should be an int.
  • The path /items/{item_id} has an optional str _que

Getting Help

Community

For discussions about the usage, development, and the future of quo, please join our Google community

Resources

Bug tracker

If you have any suggestions, bug reports, or annoyances please report them to our issue tracker at Bug tracker or send an email to:

📥 secretum@googlegroups.com

License📑

License: MIT
This software is licensed under the MIT License. See the License file in the top distribution directory for the full license text.

Code of Conduct

Code of Conduct is adapted from the Contributor Covenant, version 1.2.0 available at Code of Conduct

Metadata

Release files for Citus 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for Citus 0.0.3
File Interpreter ABI Platform
citus-0.0.3-py3-none-any.whl Python 3 none any Details
Citus-0.0.3-py3.9.egg Legacy Egg format - - Details
Citus-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 431.5 kB

Release files / citus-0.0.3-py3-none-any.whl

Download URL citus-0.0.3-py3-none-any.whl
Size 105.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf00ebc24b68d386d01c0c40df124834ca0def4d898428e486513b5894bba781
BLAKE2b-256 checksum
How to use checksums
5e1008ee7ba30d9e160ae18e10b2dd5a795a539663818717a29f8d637a89d3ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / Citus-0.0.3-py3.9.egg

Download URL Citus-0.0.3-py3.9.egg
Size 220.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
67b602e85456f6806360d5d42f331f79b9c51b916db60e9789be3064c78066fa
BLAKE2b-256 checksum
How to use checksums
8f09ac105c9c1580d1bb8cba4e766baf68a2629d3304ceca8fae154fda20d713
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Release files / Citus-0.0.3-py3-none-any.whl

Download URL Citus-0.0.3-py3-none-any.whl
Size 105.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da8a838b859d4ba696ea4c0c9eccdbf31b8bb60796d3ad13a63be4cc62aa4cfb
BLAKE2b-256 checksum
How to use checksums
4fb5d3a7b4e0cf9877381c1dba71357fef1f52155ae4ad03702a76b5a95178ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.9

Security for Citus 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page