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.3.tar.gz (6.4 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.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: chine-0.1.3.tar.gz
  • Upload date:
  • Size: 6.4 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.3.tar.gz
Algorithm Hash digest
SHA256 a61112a35247f2caf186f43ae62615cc712237cec802ba93eca309aca785f762
MD5 5f52e6e66a145044c7530873b6fb2afc
BLAKE2b-256 b535dcb8d5f1dcf9d38dab92373109e1eb1f431bc212dfb12387a0a44585e505

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: chine-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 046fd6977067c4e49251a8dfb07643d99de98b06ec65de9d386f520078963539
MD5 455f55302e6ae03931f0c45cb9cf0dc4
BLAKE2b-256 efa0fb87e0a1811ac9edcd351ea47487f9267fd0f842c6e63c30f7d1bc2ece63

See more details on using hashes here.

Provenance

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