Skip to main content

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.

Release files for pycollect 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycollect 0.2.3
File Size Uploaded
pycollect-0.2.3.tar.gz 209.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycollect 0.2.3
File Interpreter ABI Platform
pycollect-0.2.3-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 216.5 kB

Release files / pycollect-0.2.3.tar.gz

Download URL pycollect-0.2.3.tar.gz
Size 209.6 kB
Tags Source
SHA-256 checksum
How to use checksums
a9d7ce5cc9b74bd795cbac57afaa65da3b6554916f15656113a3d7b60543d007
BLAKE2b-256 checksum
How to use checksums
507c550a5011f530a1e14d240a85f34ea7e455fb48d3b57c34ab8dff71a4bdc0
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pycollect-0.2.3-py2.py3-none-any.whl

Download URL pycollect-0.2.3-py2.py3-none-any.whl
Size 6.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
6b14cc68a50663307dfc7d0b1ba6c69d416b1a01d49c4c30570441d8091cb0d1
BLAKE2b-256 checksum
How to use checksums
65615512e9a0b41bc0820e2cef9259bd158ddb8886427f4dc368a3294d5b075d
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.1

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page