Skip to main content

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

Uploaded Python 3Windows x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ x86-64

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

Uploaded Python 3manylinux: glibc 2.28+ ARM64

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

File metadata

  • Download URL: scant-0.0.1.tar.gz
  • Upload date:
  • Size: 61.9 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.1.tar.gz
Algorithm Hash digest
SHA256 0cacbc14e4de9f026bcde245aaeafb676ebf69beb39160740a076ad811c5c15d
MD5 4edfceb6b6514f2c73ed14525885c33a
BLAKE2b-256 344caceadaeec5e2ff1c6c391ac4d380787ddb2ccc8d24477acd51e683e64037

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: scant-0.0.1-py3-none-win_amd64.whl
  • Upload date:
  • Size: 2.5 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.1-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 d5c83bcc753ca48f9df4a9913adc9c96532e35f1e00872204c27d57b0bf1450b
MD5 2a3d27aa5d76f13c3c08e14e69a4df62
BLAKE2b-256 f6a47edda11d1061b0db144cb997e6a82ef0d7ee1a5361dc9969323b66bdd7f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for scant-0.0.1-py3-none-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 974cceb82dc4001a7bcc22c1a1688b3724e3eaf3b856cf75cff4eebe4810fe85
MD5 ac0cfeb2568085778586899ce6ea4c0b
BLAKE2b-256 6d82193ae430d3612c7991b6ce5295a9b7787fdf6a31f0a210c917268191a656

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for scant-0.0.1-py3-none-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d934b52bb3bdb19fb8d39a8563a9cd6e5c218747e73ca9da117f4bdfb45384b9
MD5 a3a057e61810109cb701f32c1704db2a
BLAKE2b-256 f964f6a878747d4c33e8d8a3f8461b908bf2a58f12d98bc60f5e6b5ddab90a85

See more details on using hashes here.

Provenance

The following attestation bundles were made for scant-0.0.1-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.1-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.1-py3-none-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 7802be862383417e47fbe7f437a18c01fea3db1f5c45cdff9b0ecab8e70bd010
MD5 e7d1a29dd618c0b4cd431a279cd88818
BLAKE2b-256 5bec04449b365fba3cedaf496feac1e1a3c2a1545bb2e3361063d0a8b76407e9

See more details on using hashes here.

Provenance

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

This release

0.0.1 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