Utility library to collect files recursively
Project description
pycollect
Utility library dealing with Python files.
- Features
Collect Python files recursively from a given directory
Find the Python module name respective to a Python file
Installation
pip install pycollect
Basic Usage
Collect Python files
collector = PythonFileCollector()
python_files = collector.collect()
When no explicit directory is given the parent folder of caller’s file will be used.
It is possible to define custom exclusion patterns. See the docs for more.
Get the module name of a Python file
module_name = find_module_name(filepath)
As there can be multiple valid module names for a given file, by default the outermost module name is returned. The inverse behaviour can be enabled with the innermost parameter. See the docs for more.
Documentation
See the complete docs at allrod5.github.io/pycollect.
Integration tests can be pretty helpful to understand pycollect usage more in-depth too.
See also
CONTRIBUTING: Bug reports, feature requests, documentation & pull requests.
CHANGELOG: See what’s changed in each version.
AUTHORS: Know who’s behind the project.
Changelog
0.2.3 (2020-04-14)
Adds support for Windows case insensitivity
Adds official support for Python 3.8
States official support for PathLike objects in the find_module_name function
Fixes and updates the release workflow in GitHub Actions
Bumps pycollect from 0.2.2 to 0.2.3
0.2.2 (2020-02-29)
Lift __init__.py requirement for considering a path as importable
0.2.1 (2020-02-29)
Fix module finder for Windows
0.2.0 (2020-02-28)
Added utility function to find a file’s module name
0.1.1 (2020-02-24)
Update docs
0.1.0 (2019-12-22)
First beta release
0.0.1 (2019-09-01)
Fix GitHub release workflow.
0.0.0 (2019-08-31)
First release on PyPI.
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
Built Distribution
File details
Details for the file pycollect-0.2.3.tar.gz
.
File metadata
- Download URL: pycollect-0.2.3.tar.gz
- Upload date:
- Size: 209.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a9d7ce5cc9b74bd795cbac57afaa65da3b6554916f15656113a3d7b60543d007 |
|
MD5 | 200110e7450cb616959db7cbdbd36769 |
|
BLAKE2b-256 | 507c550a5011f530a1e14d240a85f34ea7e455fb48d3b57c34ab8dff71a4bdc0 |
File details
Details for the file pycollect-0.2.3-py2.py3-none-any.whl
.
File metadata
- Download URL: pycollect-0.2.3-py2.py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b14cc68a50663307dfc7d0b1ba6c69d416b1a01d49c4c30570441d8091cb0d1 |
|
MD5 | 88d6d4a42da2519157ab3cc44e2ef37d |
|
BLAKE2b-256 | 65615512e9a0b41bc0820e2cef9259bd158ddb8886427f4dc368a3294d5b075d |