Skip to main content

A Python linting tool

Project description

chine

Chine is a static architecture checker for Python. It parses your code with ast, reads declared architecture roles, and reports dependency violations without importing or executing your modules.

What chine checks

Declare a role at module level:

__architecture_role__ = "use_case"

Supported roles:

  • use_case
  • domain_policy (and domain)
  • adapter

Current rules:

  • ARCH001: use case modules must not import adapter modules
  • ARCH002: domain/domain_policy modules must not import adapter modules
  • ARCH003: domain/domain_policy modules must not import use case modules

Modules without __architecture_role__ are treated as untyped (Any) for architecture checks.

Installation

Install from PyPI:

pip install chine

Or with pipx:

pipx install chine

End-user usage

Show CLI help:

chine --help

Check the current directory:

chine check

Check a specific path:

chine check src/

Show version:

chine --version

Show supported role tags:

chine role-tags

When no violations are found, chine exits successfully. If violations are found, it prints each ARCH rule violation with file and line number and exits with a non-zero status.

Development

uv sync --all-extras
uv run ruff check src/
uv run mypy src/
uv run pytest

License

See LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chine-0.1.4.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chine-0.1.4-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file chine-0.1.4.tar.gz.

File metadata

  • Download URL: chine-0.1.4.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chine-0.1.4.tar.gz
Algorithm Hash digest
SHA256 6bdf2fb7167135fbc78b2d075fb1f3e03e16b317c602e3e81b13ededb2c7a7e8
MD5 ffd7936a4cd81a8f9a4d96fd8ef96e49
BLAKE2b-256 48bbc797152554fb0f058c5406d9f38c3d3ed68b1856f9e1672b160674bbf8d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for chine-0.1.4.tar.gz:

Publisher: release.yml on jbrixon/chine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file chine-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: chine-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for chine-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 914a0b9f059b155ec4b7cbb593fa15bf9e0ee9abf01ea893dd03f939116ffe2d
MD5 818f0ac8237c968adc760a53edf7f03e
BLAKE2b-256 ad2e6c5ce92db5d95a84bc7ca2174841b100d1d935e03ac88c8889d49395912b

See more details on using hashes here.

Provenance

The following attestation bundles were made for chine-0.1.4-py3-none-any.whl:

Publisher: release.yml on jbrixon/chine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page