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 Distribution

fileutils_dir-0.1.3.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

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

fileutils_dir-0.1.3-py3-none-any.whl (2.6 kB view details)

Uploaded Python 3

File details

Details for the file fileutils_dir-0.1.3.tar.gz.

File metadata

  • Download URL: fileutils_dir-0.1.3.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for fileutils_dir-0.1.3.tar.gz
Algorithm Hash digest
SHA256 13c4dc2bd1b9a1f28caa3b250d0b0b960eef7915d6f92b6fd1d5a0051b823f87
MD5 23a44d11b600fa7acba958659fa0ca9b
BLAKE2b-256 8114b738356a30d5ef53be187cb4faa7444f8bc1a97ce318585648ebcfe3ba00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fileutils_dir-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 2.6 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 590ce598ff2526b270008092c992aeb1d5652d36b62c3e338e7149811cdf5560
MD5 b5f2ebc94ab643317383c22571db6c35
BLAKE2b-256 30dd300bee963cba6b9263380488928cc81e6917a033bc1720622b74782afceb

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