Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

scant

CI image image

Find the Python dependencies you barely use.

Most tools tell you what's unused. scant also tells you what's barely used. Think of those dependencies pulled in for one function, called on a couple of lines, that might be stopping you from your next Python upgrade (true story).

Built for plain English: flags are spelled out in full (--threshold-lines, not -L), and every result or error reads in words a non-developer can follow. The idea is to continue making the CLI very nice to look at. Like candy for your eyes.

Written in rust ⚡️

Install

pipx install scant

Usage

scant .
scant . --threshold-lines 5
scant . --env path/to/venv
scant . --env path/to/venv/bin/python

scant needs to read your dependencies' installed metadata to map a declared name to what you actually import (e.g. PyYAML -> yaml) -- there's no reliable way to do that without them being installed somewhere. It looks, in order, at: --env if you passed it, $VIRTUAL_ENV, $CONDA_PREFIX, then any pyvenv.cfg-marked folder under the scanned path (so .venv, venv, env, venv311, etc. are all found automatically -- no need to name it right). --env also accepts a direct interpreter path, not just a directory (--env .venv/bin/python), which is handy inside containers or CI images that install packages straight into a system Python.

If none of that resolves -- or more than one folder looks like a venv -- scant explains what it checked and how to point it at the right one, rather than guessing:

$ scant .
Couldn't find a Python environment for this project.

scant needs to read your dependencies' installed metadata to map declared
names to imports (e.g. "PyYAML" -> "yaml") -- there's no reliable way to
do that without them actually being installed somewhere.

Checked:
  ├── $VIRTUAL_ENV   not set
  ├── $CONDA_PREFIX  not set
  └── ./   no .venv, venv, or other pyvenv.cfg-marked folder

To fix this:
  1. Activate a virtualenv with your dependencies installed, then re-run scant
  2. Or point at one directly:    scant . --env path/to/venv
  3. Or point at an interpreter:  scant . --env path/to/venv/bin/python

Example output

mkdocs -- 15 packages declared, 65 files read, 0.4s
Plan: drop 3, inline 4, keep 8.

  ACTION  PACKAGE             USES  LINES  USE       WHERE
  drop    colorama               0      0  none      --

  inline  markupsafe             1      1  trivial   mkdocs/utils/templates.py:55
  inline  pyyaml_env_tag         1      1  trivial   mkdocs/utils/yaml.py:120

  keep    click                  4     41  heavy     mkdocs/__main__.py +3 files
  keep    watchdog               2      2  light     mkdocs/livereload/__init__.py

License

MIT

Download files

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

Source Distribution

scant-0.0.1a5.tar.gz (54.3 kB view details)

Uploaded Source

Built Distributions

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

scant-0.0.1a5-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

scant-0.0.1a5-py3-none-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ x86-64

scant-0.0.1a5-py3-none-manylinux_2_28_aarch64.whl (2.4 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

scant-0.0.1a5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.7 MB view details)

Uploaded Python 3macOS 10.12+ universal2 (ARM64, x86-64)macOS 10.12+ x86-64macOS 11.0+ ARM64

File details

Details for the file scant-0.0.1a5.tar.gz.

File metadata

  • Download URL: scant-0.0.1a5.tar.gz
  • Upload date:
  • Size: 54.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scant-0.0.1a5.tar.gz
Algorithm Hash digest
SHA256 e16e4d8106e5d0ce2e61a59d49937154c223534f8a3699cfe2b339b677794432
MD5 5c5653f68664e844626f27b155074f0a
BLAKE2b-256 696bfdc5cd8a2ee78363ecf81cebafc6644226d19896ced303b8f43abaf0b875

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a5.tar.gz:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a5-py3-none-win_amd64.whl.

File metadata

  • Download URL: scant-0.0.1a5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scant-0.0.1a5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 38f8a6279330981578ab212a2066b4fa8ff1f7f394798cda4b20f48205449ccd
MD5 d951979b88810572a57810010909aaf6
BLAKE2b-256 a5742ae83f35012369eb26abb477dc06dbbc569da540ed80fa75ad0b7b2abb28

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a5-py3-none-win_amd64.whl:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a5-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a5-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a64fb49a1ec65e3d5fab48cb3be7c75e62691cc3684752970f5c3569d25a020d
MD5 19d7a7ab5c07300a764810eb5914ee81
BLAKE2b-256 c0a8ecf660ad507e255f71315e38f4274d706f23211d47c381254ea4a12e9fd4

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a5-py3-none-manylinux_2_28_x86_64.whl:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a5-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a5-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 088ddda1f983491c7fbab0b99688e9890dcdb3a40dec2098aa7d6eb0579325ae
MD5 f58edc576b0a84390100a2b7f71ecf4d
BLAKE2b-256 948c29da7f794ae8293c559ee474196a7f7b790a2c2238210613ce8ec4f02e24

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a5-py3-none-manylinux_2_28_aarch64.whl:

Publisher: release.yml on alan707/scant

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

File details

Details for the file scant-0.0.1a5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for scant-0.0.1a5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 828e2005307f0cf4ec89de7c694ce90cf61ab35c24b69c635643bea1764cf48a
MD5 a4bd9fc68c328ec1885f26425dfdb85c
BLAKE2b-256 7aafe47e1eb241089e85c653041bae9955e77ac4df0c91adf3ce1ed62a40ea0d

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a5-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl:

Publisher: release.yml on alan707/scant

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

Release history Release notifications | RSS feed

0.0.1

5 files

This release

0.0.1a5 This release

5 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