Skip to main content

Extract metadata from Python source distributions

Project description

Distinfo

Build Status Quality Coverage

distinfo is a tool for extracting metadata, including full dependencies, from Python source distributions.

Usage

CLI

Dump json metadata to stdout:

$ distinfo /path/to/package/source

Library

Print dependencies and metadata:

>>> from distinfo import Distribution, dump
>>>
>>> dist = Distribution("/path/to/package/source")
>>> dump(dist.requires)
{
  "build": [
    "setuptools-scm"
  ],
  "dev": [
    "pycmd",
  ],
  "run": [
    "click",
    "requests",
  ],
  "test": [
    "pytest",
  ]
}
>>> dump(dist.metadata)
{
  "author": "A N Other",
  "author_email": "a@example.org",
  "extensions": {
    "distinfo": {
      "imports": {
        "distinfo": [
          "click",
          "requests"
        ],
        "tests": [
          "pytest",
        ]
      },
      "tests": [
        "tests",
      ],
    }
  },
  "license": "GPL-3.0-or-later",
  "metadata_version": "2.1",
  "name": "example",
  "provides_extra": [
      "build",
      "dev",
      "test"
  ],
  "requires_dist": [
      "click",
      "pycmd; extra == 'dev'",
      "pytest; extra == 'test'",
      "requests"
      "setuptools-scm; extra == 'build'",
  ],
  "summary": "Example package",
  "version": "0.0.0"
}

Specifications

https://packaging.python.org/specifications/

Metadata

Dependencies

Project details


Download files

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

Files for distinfo, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size distinfo-0.2.0.tar.gz (28.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page