Skip to main content

Cyto 🦠

Idiomatic boilerplate and glue code for Python

Cyto lets you:

Cyto is the bridge between an oppinionated selection of Python tech. Cyto is everything you need to create a modern Python app. Cyto is the glue and boilerplate code that you no longer have to write yourself.

Only pay for what you use

So you only want the click–pydantic integration but not the TOML loader? Don't worry, Cyto is split into so-called extras so you can select just the extras that you want. In turn, Cyto only pulls in the dependencies for the selected extras. This is the "only pay for what you use" principle. In fact, Cyto has zero dependencies per default.

Here is the list of extras:

Installation

Install Cyto along with all extras:

pip install cyto[all]

Similar for poetry:

poetry add cyto[all]

Choose specific extras

If you only want a specific extra, choose that when you install Cyto. E.g.:

pip install cyto[settings.sources.cli]

Similar for poetry:

poetry add cyto[settings.sources.cli]

Development

Python Version

Development requires Python 3.8 or later. Test your python version with:

python3 --version

If you have multiple python installations, you can replace python3 with a specific version (e.g., python3.8) in the steps below.

Getting Started

Do the following:

  1. Clone this repository
    git clone git@github.com:sbtinstruments/cyto.git
    
  2. Install poetry (for dependency management)
    curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
    
  3. Optional: Use a local poetry virtual environment
    poetry config --local virtualenvs.in-project true
    
    This integrates better with editors such as Visual Studio Code.
  4. Create poetry's virtual environment and get all dependencies and all extra features.
    poetry install --extras all
    
  5. Optional: Run the QA basic tools (e.g., isort, black, pylint, mypy) automatically before each commit
    poetry run pre-commit install
    

Quality Assurance (QA) Tools

QA Basic Tools

All QA basic tools automatically run in Jenkins for each commit pushed to the remote repository. If you installed the pre-commit hooks, all QA basic tools automatically run before each commit too.

The QA basic tools are:

  • isort (for import ordering)
  • black (for formatting)
  • pylint (for linting)
  • mypy (for type checking)

You can run the QA basic tools manually. This is useful if you don't want to install the pre-commit hooks.

Run the QA basic tools manually with:

poetry run task isort
poetry run task black
poetry run task pylint
poetry run task mypy

Run all the basic QA tools manually with a single command:

poetry run task pre-commit

Note that this doesn't require you to install the pre-commit hooks.

QA Test Tools

All of the tools below automatically run in Jenkins for each commit pushed to the remote repository.

The QA test tools are:

  • tox (for automation across Python versions)
  • pytest (the test framework itself)
  • pytest-cov (for test coverage percentage)

Run the tests manually:

  1. Install tox
    python3 -m pip install tox
    
  2. Start a tox run:
    tox
    

Note that tox invokes pytest in a set of virtual environments. Said virtual environments have nothing to do with poetry's virtual environment. Poetry and tox runs in isolation of each other.

Visual Studio Code

Settings

We have a default settings file that you can use via the following command:

cp .vscode/settings.json.default .vscode/settings.json

This is optional.

Python Interpreter

Hopefully, you used the local poetry virtual environment during installation (the poetry config --local virtualenvs.in-project true part). This way, Visual Studio Code automatically finds the Python interpreter within poetry's virtual environment.

Alternatively, you can point Visual Studio Code to poetry's global virtual environments folder. Add the following entry to your ./vscode/settings.json file:

{ "python.venvPath": "~/.cache/pypoetry/virtualenvs" }

Then, you look for the poetry's currently active virtual environment:

poetry env list

Lastly, you use the Visual Studio Code command Python: Select Interpreter and choose the interpreter inside poetry's currently active virtual environment.

Metadata

Release files for cyto 0.3.2

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

Source distribution (sdist)

Source distribution for cyto 0.3.2
File Size Uploaded
cyto-0.3.2.tar.gz 20.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cyto 0.3.2
File Interpreter ABI Platform
cyto-0.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.5 kB

Release files / cyto-0.3.2.tar.gz

Download URL cyto-0.3.2.tar.gz
Size 20.4 kB
Tags Source
SHA-256 checksum
How to use checksums
d4894ae2c4b38b8e2ad62b2df11c33d09dfee5c01cabca59668a78be89d0ae9d
BLAKE2b-256 checksum
How to use checksums
b01a7543846cc6c5161984113c80a2b83d2126bdf85bdb631fb02c0f84df3099
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.5 Linux/5.4.0-66-generic

Release files / cyto-0.3.2-py3-none-any.whl

Download URL cyto-0.3.2-py3-none-any.whl
Size 20.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7667bf978fdc230f2121502c69d2662271e9c62dfcbdd33f9df598a94aa9f30c
BLAKE2b-256 checksum
How to use checksums
9680b4b5543ae0ce83e8ef1a87c94c47f4dae5f44e82b9571a098f19f67cfdec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.4 CPython/3.8.5 Linux/5.4.0-66-generic

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.0.0

2 release files

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