Welcome to metaextract’s documentation!

metaextract is a tool to collect metadata about a python module. For example you may have a sdist tarball from the Python Package Index and you want to know it’s dependencies. metaextract can collect theses dependencies. The tool was first developed in py2pack but is now it’s own module to be useful for others, too.

Installation

To install metaextract from the Python Package Index, simply:

$ pip install metaextract

Usage

To extract the metadata for a python module using setup.py, do:

$ metaextract my-archive-file.tar.gz

This will print a json blob to stdout which contains i.e. install_requires, extras_require and friends extracted from the given archive file.

If you already have some source code available (i.e. a git checkout) for some project you can also run the setup.py file with the metaextract distutils command:

$ python setup.py --command-packages=metaextract metaextract

This will print the metadata as json. If you want to write the data to a file, do:

$ python setup.py --command-packages=metaextract metaextract -o output-file

API documentation

The metaextract.utils Module

metaextract.utils.from_archive(archive_filename)

extract metadata from a given sdist archive file

Parameters:archive_filename – a sdist archive file
Returns:a json blob with metadata

Indices and tables