Skip to main content

Security vulnerability scanner for Python dependencies

Project description

osvcheck

Python Tests PyPI version Python versions Downloads Security Maintenance

Lightweight vulnerability scanner for Python dependencies using the OSV database.

osvcheck scans your Python project's dependencies for known security vulnerabilities by querying the OSV (Open Source Vulnerabilities) database. It's designed for source-level checking during development and CI/CD pipelines.

Key features:

  • Zero runtime dependencies (stdlib only)
  • Auto-detects package manager (uv.lock, uv, or pip)
  • Smart caching (12-48 hour TTL) minimizes API calls
  • Distinguishes direct vs indirect vulnerabilities
  • Optional rich integration for enhanced output (auto-detected if installed)

Installation

Install via pip or uv, or add to your project's dev dependencies.

Usage

# Scan current project
osvcheck

# Logging options
osvcheck -v              # Verbose (debug) output
osvcheck -q              # Quiet (warnings/errors only)
osvcheck --log-json      # JSON format logs
osvcheck --log-file FILE # Write logs to file

# Color control
osvcheck --color         # Force color output
osvcheck --no-color      # Disable color output

Exit codes:

  • 0 - No vulnerabilities found
  • 1 - Indirect dependency vulnerabilities only
  • 2 - Direct dependency vulnerabilities found

As a Pre-commit hook:

Add to .pre-commit-config.yaml:

- repo: https://github.com/deeprave/osvcheck
  rev: v1.0.1
  hooks:
    - id: osvcheck

CI/CD integration:

# Fail only on direct vulnerabilities
osvcheck || [ $? -eq 1 ]

# Fail on any vulnerabilities
osvcheck

Features

  • Scans Python dependencies for known security vulnerabilities
  • Uses the OSV (Open Source Vulnerabilities) database
  • Multi-environment support with auto-detection:
    • Uses uv.lock if present and up-to-date (fastest)
    • Falls back to uv pip list if uv is available
    • Falls back to pip list if pip is available
  • Smart caching with 12-48 hour randomized TTL
  • Distinguishes between direct and indirect dependency vulnerabilities
  • Zero runtime dependencies (Python stdlib only)
  • Optional rich integration for enhanced output (auto-detected if already installed)

License

MIT License - See LICENSE file 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

osvcheck-1.2.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

osvcheck-1.2.0-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file osvcheck-1.2.0.tar.gz.

File metadata

  • Download URL: osvcheck-1.2.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for osvcheck-1.2.0.tar.gz
Algorithm Hash digest
SHA256 57e15ac16dbb8695cc005435f4334081c128acc0db46792f5b79a09ad9c414c7
MD5 af19f0b6c8102df1a12239d1ab32be53
BLAKE2b-256 f495df39b0ab75805d0f95374fa22a0e34ed6d71d4fdaa6569cdbdcd2703fb09

See more details on using hashes here.

Provenance

The following attestation bundles were made for osvcheck-1.2.0.tar.gz:

Publisher: release.yml on deeprave/osvcheck

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

File details

Details for the file osvcheck-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: osvcheck-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for osvcheck-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57c03130186311f1df32708b3251653bde42f06b544f3a26fd3d9e1daeda7959
MD5 eb7e142a6eabcf8837e712ca30abb0df
BLAKE2b-256 d5d76d4c14c4c1de72f8c01e8e2f922cc1df301e5b7efacbad87b0ff9d6a56cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for osvcheck-1.2.0-py3-none-any.whl:

Publisher: release.yml on deeprave/osvcheck

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