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

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.1.tar.gz (5.2 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.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chine-0.1.1.tar.gz
  • Upload date:
  • Size: 5.2 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.1.tar.gz
Algorithm Hash digest
SHA256 5ead6fee79355e6d905eed22b508359629c7beb47ce4e8f7b49a6147930761ed
MD5 54864c37d23ac783294f90644a7da34f
BLAKE2b-256 1d52a1f7e276a881bc3cf98e63bd931a9a96a40882af8a376bf568c13b64ab6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for chine-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: chine-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 402f27ba1546ab110690da5ee0dcde6c940ff34d06ea60ab3ed644106a9650e3
MD5 d443e17e5b4e4c1bb18395cfcd99ff7b
BLAKE2b-256 3ce7372a07afbb932d29431b250a7317608db94c3b5e9167f67c170df14a4ed1

See more details on using hashes here.

Provenance

The following attestation bundles were made for chine-0.1.1-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