https://github.com/mikata-project/pkgmod
Get module names from installed package names and back
https://github.com/mikata-project/pkgmod
Last synced: 11 months ago
JSON representation
Get module names from installed package names and back
- Host: GitHub
- URL: https://github.com/mikata-project/pkgmod
- Owner: Mikata-Project
- License: mit
- Created: 2021-06-24T13:05:21.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-30T12:44:29.000Z (almost 5 years ago)
- Last Synced: 2025-03-11T22:49:19.196Z (over 1 year ago)
- Language: Python
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pkgmod
Get module names from installed package names and back.
Example usage:
```python
>>> import pkgmod
>>> pkgmod.get_package_name("impala")
('impyla', False)
```
This returns a tuple with package name and a bool, which tells whether it's
a standard library in Python or not.
For packages this only works if the package is installed.
```python
>>> pkgmod.get_module_names("impyla")
['impala']
>>> pkgmod.get_module_names("Cython")
['Cython', 'cython', 'pyximport']
```
This returns the module names included in a given package (which also needs to
be installed).