semvec/pypi-packages huggingface dataset:
pycollect 0.2.3
Utility library to collect files recursively
License: MIT license
Requires Python: >=3.6
Keywords: file,py,traversal,directory

.. _pycollect:

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
============

.. code-block:: bash

    pip install pycollect


Basic Usage
===========

Collect Python files
--------------------

.. code-block:: python

    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 <https://allrod5.github.io/pycollect/reference/pycollect.html#pycollect.PythonFileCollector>`__.

Get the module name of a Python file
------------------------------------

.. code-block:: python

    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 <https://allrod5.github.io/pycollect/reference/pycollect.html#pycollect.find_module_name>`__.

Documentation
=============

See the complete docs at `allrod5.github.io/pycollect <https://allrod5.github.io/pycollect/>`__.

`Integration tests <https://github.com/allrod5/pycollect/tree/master/tests/integration>`__
can be pretty helpful to understand pycollect usage more in-depth too.

See also
--------

* `CONTRIBUTING <https://allrod5.github.io/pycollect/contributing.html>`__: Bug reports, feature requests, documentation & pull requests.
* `CHANGELOG <https://allrod5.github.io/pycollect/changelog.html>`__: See what's changed in each version.
* `AUTHORS <https://allrod5.github.io/pycollect/authors.html>`__: 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.