rendicahya / python_file

A Python library for file-related tasks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python File Utilities

A Python library for file-related tasks.

Installation

This library is designed to be used as a git submodule:

git submodule add https://github.com/rendicahya/python_file.git

Dependencies

pip install tqdm

This project depends on another project that must also be installed as a submodule in the main project:

git submodule add https://github.com/rendicahya/assertpy.git

Available Functions

1. count_files()

Returns the number of files in a directory. Parameters:

  • recursive (boolean, default: True)
  • ext (string, default: None)

Usage:

from python_file import count_files

path = "/some/path"
n_files = count_files(path, recursive=True, ext=".txt")

About

A Python library for file-related tasks.


Languages

Language:Python 100.0%