Skip to main content

Small utilities for listing files in directories

Project description

fileutils

Small utilities for working with files and directories.

Currently provides a helper to list files in one or more directories, optionally filtered by file extension or file type.

Installation (local development)

pip install -e .

Usage

from fileutils import in_dir

# All files in current directory
files = in_dir()

# All Python files
files = in_dir(extensions=[".py"])

# Files by type
files = in_dir(types=["code"])

# Multiple directories
files = in_dir(directories=["src", "tests"], types=["code"])

Behavior

  • Defaults to the current directory (.)
  • If no extensions or types are provided, all files are returned
  • If both are provided, the result is the union of both filters
  • Only files are returned (directories are ignored)

Supported types

Common file groups such as:

  • code
  • text
  • image
  • pdf
  • audio
  • video
  • archive

See source for the full mapping.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fileutils_dir-0.1.2-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file fileutils_dir-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fileutils_dir-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fileutils_dir-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b14143e1438ebe57584b1a1fd543ec4faa30136bb736524e1a19b68479a83a59
MD5 23e9bb0bd991bcdeeea9678b71f7940d
BLAKE2b-256 8e57457b2134e23b607213e5bc5fa02f46b3f4f207e1f62a80d1b9bf80188071

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page