Skip to main content

python module name to package name map

Project description

#: pymod2pkg

pymod2pkg is a simple python module for translating python module names to corresponding package names which is a common problem in the packaging world.

Note that [rdopkg](https://github.com/redhat-openstack/rdopkg) uses this module to check whether packages corresponding to requirements.txt are available across distros and more.

## Installation

### from source

If you want to hack pymod2pkg or just have the latest version without waiting for next release, I suggest using the git repo directly a la

git clone https://github.com/openstack/pymod2pkg cd pymod2pkg python setup.py develop –user

### from PyPI

For your convenience, pymod2pkg is also available from the Cheese Shop:

pip install pymod2pkg

## Usage

module2package is probably all you need, it accepts a module name to convert and a linux distribution name as returned by platform.linux_distribution()[0]:

import pymod2pkg

pkg = pymod2pkg.module2package(‘six’, ‘Fedora’)

There’s not much more, really, so RTFS.

## Fixing/extending the map

Currently, only package maps for RPM-based systems are provided, but it’d be nice to have all the distros covered and it’s really easy to do.

See *_PKG_MAP and get_pkg_map, hack it to your liking and submit review by

git review

## Running the testsuite

Run tests by:

python tests.py

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

pymod2pkg-0.3.tar.gz (7.0 kB view details)

Uploaded Source

File details

Details for the file pymod2pkg-0.3.tar.gz.

File metadata

  • Download URL: pymod2pkg-0.3.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pymod2pkg-0.3.tar.gz
Algorithm Hash digest
SHA256 0dd9f0e35fd2d94f60d0c77a4188e0a8804d0205f484b551b6d72be5f4a9c361
MD5 2c41c8578555aa5c6390084555009311
BLAKE2b-256 21c7d7265d62d743da8fda92ad8902373765c932b1410029911ba05a4145f9b9

See more details on using hashes here.

Provenance

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