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.1a4.tar.gz (46.0 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.1a4-py3-none-win_amd64.whl (2.4 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

scant-0.0.1a4-py3-none-manylinux_2_28_aarch64.whl (2.3 MB view details)

Uploaded Python 3manylinux: glibc 2.28+ ARM64

scant-0.0.1a4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (4.6 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.1a4.tar.gz.

File metadata

  • Download URL: scant-0.0.1a4.tar.gz
  • Upload date:
  • Size: 46.0 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.1a4.tar.gz
Algorithm Hash digest
SHA256 c20b5ff65b43b3e5c4330f1c820bbc683d86f2d086a70c44f1e470b785a94547
MD5 3a75e7a76c0a61c0fa136064400450f4
BLAKE2b-256 67560b8535fa78ba3f0dc304670259ce87ab3271f177f6a166f6631bf9352eb2

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a4.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.1a4-py3-none-win_amd64.whl.

File metadata

  • Download URL: scant-0.0.1a4-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.1a4-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a363a3d06920b693b7a797e9a594bb2418081d3a88e9ae5ce7c64a57bba62534
MD5 248648e7b5af2f8020ff8d6262dbaaed
BLAKE2b-256 10f3b8abb2c7fa21b449c6400736838585f84697adec4329c2bff83da19d4551

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a4-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.1a4-py3-none-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a4-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 766c5309fd094991064699dd026727bb32ba7016012c1d30d12c8005cf216c8d
MD5 25aa9f1c19b3dd37b276ddd2c7c983b6
BLAKE2b-256 1b24c17222493ff37d40df15ea325fde09e36aa9cf36ddc3363d30fb2f9756f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a4-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.1a4-py3-none-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for scant-0.0.1a4-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 18a643808b907f9b54ee727a64479a74b4cb90813b78fa7f9146a8970adf8bbe
MD5 3b7898f52d186f2cb26b02c80dcdbc52
BLAKE2b-256 56237842aecab5308b95283ec6a5cb4ea1b1e67d70cd7b13bf1a9ecec69c48b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a4-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.1a4-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.1a4-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7f23a69a6afe81fcaf4e8950daddd24c60cddf6156eeca8a91e0a33015ff14f5
MD5 fa243f039c458a19eafc7d545f6278c6
BLAKE2b-256 fe94c02c00e8afc3b56e846dc7da29508c92d56d1d243e6d67d50c4dcf2bae72

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1a4-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.1a4 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