Skip to main content

Extract information from wheels

Project description

Project Status: Active — The project has reached a stable, usable state and is being actively developed. https://travis-ci.org/jwodder/wheel-inspect.svg?branch=master https://codecov.io/gh/jwodder/wheel-inspect/branch/master/graph/badge.svg https://img.shields.io/pypi/pyversions/wheel-inspect.svg MIT License https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg

GitHub | PyPI | Issues | Changelog

wheel-inspect examines Python wheel files & *.dist-info directories and outputs various information about their contents as JSON-serializable objects. It can be invoked in Python code as:

from wheel_inspect import inspect_wheel

output = inspect_wheel(path_to_wheel_file)

or from the command line with the wheel2json command.

Installation

wheel-inspect requires Python 3.5 or higher. Just use pip for Python 3 (You have pip, right?) to install wheel-inspect and its dependencies:

python3 -m pip install wheel-inspect

Example

$ wheel2json wheel_inspect-1.0.0.dev1-py3-none-any.whl
{
    "abi": [
        "none"
    ],
    "arch": [
        "any"
    ],
    "buildver": null,
    "derived": {
        "dependencies": [
            "distlib",
            "headerparser",
            "packaging",
            "readme-renderer",
            "setuptools"
        ],
        "description_in_body": true,
        "description_in_headers": false,
        "keyword_separator": ",",
        "keywords": [
            "packages",
            "pypi",
            "wheel"
        ],
        "modules": [
            "wheel_inspect",
            "wheel_inspect.__main__",
            "wheel_inspect.inspect",
            "wheel_inspect.metadata",
            "wheel_inspect.schema",
            "wheel_inspect.util",
            "wheel_inspect.wheel_info"
        ],
        "readme_renders": true
    },
    "dist_info": {
        "entry_points": {
            "console_scripts": {
                "wheel2json": {
                    "attr": "main",
                    "extras": [],
                    "module": "wheel_inspect.__main__"
                }
            }
        },
        "metadata": {
            "author": "John Thorvald Wodder II",
            "author_email": "wheel-inspect@varonathe.org",
            "classifier": [
                "Development Status :: 3 - Alpha",
                "Programming Language :: Python :: 3 :: Only",
                "Programming Language :: Python :: 3",
                "Programming Language :: Python :: 3.5",
                "Programming Language :: Python :: 3.6",
                "Programming Language :: Python :: 3.7",
                "Programming Language :: Python :: Implementation :: CPython",
                "Programming Language :: Python :: Implementation :: PyPy",
                "License :: OSI Approved :: MIT License",
                "Intended Audience :: Developers",
                "Topic :: Software Development :: Libraries :: Python Modules",
                "Topic :: System :: Software Distribution"
            ],
            "description": {
                "length": 1538
            },
            "home_page": "https://github.com/jwodder/wheel-inspect",
            "keywords": "packages,pypi,wheel",
            "license": "MIT",
            "metadata_version": "2.1",
            "name": "wheel-inspect",
            "platform": [],
            "requires_dist": [
                {
                    "extras": [],
                    "marker": null,
                    "name": "distlib",
                    "specifier": "~=0.2.7",
                    "url": null
                },
                {
                    "extras": [],
                    "marker": null,
                    "name": "headerparser",
                    "specifier": "~=0.2.0",
                    "url": null
                },
                {
                    "extras": [],
                    "marker": null,
                    "name": "packaging",
                    "specifier": ">=17.1",
                    "url": null
                },
                {
                    "extras": [],
                    "marker": null,
                    "name": "readme-renderer",
                    "specifier": "~=21.0",
                    "url": null
                },
                {
                    "extras": [],
                    "marker": null,
                    "name": "setuptools",
                    "specifier": ">=36",
                    "url": null
                }
            ],
            "requires_python": "~=3.5",
            "summary": "Extract information from wheels",
            "version": "1.0.0.dev1"
        },
        "record": [
            {
                "digests": {
                    "sha256": "EL9q_wQOJRlJL3LkKscASTrhXgXgVLfeugZz66MFeV8"
                },
                "path": "wheel_inspect/__init__.py",
                "size": 440
            },
            {
                "digests": {
                    "sha256": "3_DrJ4Tr-ie5TCQtmmTnS82eHTMmVDY1mOeSP_hJ_Ho"
                },
                "path": "wheel_inspect/__main__.py",
                "size": 247
            },
            {
                "digests": {
                    "sha256": "LCgjTkHaGxyzSKeY_pEDSWQFNQi7PRby6lh6H0OSVAQ"
                },
                "path": "wheel_inspect/inspect.py",
                "size": 4816
            },
            {
                "digests": {
                    "sha256": "3u83eQ0RBdR-AEOxqsPyMkc663G2Un9Hd6tqhO2eu6k"
                },
                "path": "wheel_inspect/metadata.py",
                "size": 1946
            },
            {
                "digests": {
                    "sha256": "8VOeroNaM34lIqdjnCiaCwtNEVwi_wFDTtYaL7dEXDQ"
                },
                "path": "wheel_inspect/schema.py",
                "size": 12158
            },
            {
                "digests": {
                    "sha256": "iaxC3qenCrPMRjrqdTwj1Hfy-OPo-y-WVLaPWEDeSFs"
                },
                "path": "wheel_inspect/util.py",
                "size": 1352
            },
            {
                "digests": {
                    "sha256": "wNTKsMw_TVe3RbIpj8tjwRE0Q_rUeoRUF66KKpqBp2c"
                },
                "path": "wheel_inspect/wheel_info.py",
                "size": 1010
            },
            {
                "digests": {
                    "sha256": "-X7Ry_-tNPLAGkZasQc2KOBW_Ohnx52rgDZfo8cxw10"
                },
                "path": "wheel_inspect-1.0.0.dev1.dist-info/LICENSE",
                "size": 1095
            },
            {
                "digests": {
                    "sha256": "SbhMBq15toKwrurqS0Xmt--MPsWRvKTjtx9ya4tTed8"
                },
                "path": "wheel_inspect-1.0.0.dev1.dist-info/METADATA",
                "size": 2692
            },
            {
                "digests": {
                    "sha256": "-ZFxwj8mZJPIVcZGLrsQ8UGRcxVAOExzPLVBGR7u7bE"
                },
                "path": "wheel_inspect-1.0.0.dev1.dist-info/WHEEL",
                "size": 92
            },
            {
                "digests": {
                    "sha256": "fqJPsljFaWRzPdYMreNAf0zg8GSQE0Tgh8_XOzL85lo"
                },
                "path": "wheel_inspect-1.0.0.dev1.dist-info/entry_points.txt",
                "size": 60
            },
            {
                "digests": {
                    "sha256": "Cz2n0fdOaOfDcl0g6x4t_DEWzWZYYRcFASrgxW0v_WE"
                },
                "path": "wheel_inspect-1.0.0.dev1.dist-info/top_level.txt",
                "size": 14
            },
            {
                "digests": {},
                "path": "wheel_inspect-1.0.0.dev1.dist-info/RECORD",
                "size": null
            }
        ],
        "top_level": [
            "wheel_inspect"
        ],
        "wheel": {
            "generator": "bdist_wheel (0.32.1)",
            "root_is_purelib": true,
            "tag": [
                "py3-none-any"
            ],
            "wheel_version": "1.0"
        }
    },
    "file": {
        "digests": {
            "md5": "fc6dcdac9f850435e41167f48e3862f4",
            "sha256": "69733fa29a205ecfee322961defd15dc42880873869db6a742edf26d6d6d4832"
        },
        "size": 10208
    },
    "filename": "wheel_inspect-1.0.0.dev1-py3-none-any.whl",
    "project": "wheel_inspect",
    "pyver": [
        "py3"
    ],
    "valid": true,
    "version": "1.0.0.dev1"
}

API

wheel_inspect.DIST_INFO_SCHEMA

A JSON Schema for the structure returned by inspect_dist_info_dir(). It is the same as WHEEL_SCHEMA, but without the "filename", "project", "version", "buildver", "pyver", "abi", "arch", and "file" keys.

wheel_inspect.WHEEL_SCHEMA

A JSON Schema for the structure returned by inspect_wheel(). This value was previously exported under the name “SCHEMA”; the old name continues to be available for backwards compatibility, but it will go away in the future and should not be used in new code.

wheel_inspect.inspect_dist_info_dir(dirpath)

Treat dirpath as a *.dist-info directory and inspect just it & its contents. The structure of the return value is described by DIST_INFO_SCHEMA.

wheel_inspect.inspect_wheel(path)

Inspect the wheel file at the given path. The structure of the return value is described by WHEEL_SCHEMA.

Previous versions of wheel-inspect provided a parse_wheel_filename() function. As of version 1.5.0, that feature has been split off into its own package, wheel-filename. wheel-inspect continues to re-export this function in order to maintain API compatibility with earlier versions, but this will change in the future. Code that imports parse_wheel_filename() from wheel-inspect should be updated to use wheel-filename instead.

Command

wheel2json [<path> ...]

wheel-inspect provides a wheel2json command (also accessible as python -m wheel_inspect) that can be used to inspect wheels and *.dist-info directories from the command line. Each path passed to the command is inspected separately (treated as a *.dist-info directory if it is a directory, treated as a wheel file otherwise), and the resulting data is output as a pretty-printed JSON object. (Note that this results in a stream of JSON objects with no separation when multiple paths are given.)

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

wheel-inspect-1.6.0.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

wheel_inspect-1.6.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file wheel-inspect-1.6.0.tar.gz.

File metadata

  • Download URL: wheel-inspect-1.6.0.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.9

File hashes

Hashes for wheel-inspect-1.6.0.tar.gz
Algorithm Hash digest
SHA256 001b0da1912239d6a5c2d3142ea41f5e9caea554a220d68e03fbb2e1b9df32d2
MD5 22cc93fa82878c6197fef007f17c96d7
BLAKE2b-256 bbac07e8e7fa88be7c197b5850aa67230737d18f5ec016c6d1f4231568293d14

See more details on using hashes here.

File details

Details for the file wheel_inspect-1.6.0-py3-none-any.whl.

File metadata

  • Download URL: wheel_inspect-1.6.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/46.0.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.9

File hashes

Hashes for wheel_inspect-1.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e7e4d3b5ed5c60fdf4c286604e4124a450b71e6fbdb4fc37ed7fd4dbba79b247
MD5 aadb2e06794003f0c9114cb24b25e1b8
BLAKE2b-256 1718c7c9fd738f077ab4c8999e960b3c618dcc7f1ed74642f093993322f35263

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page