Skip to main content

pyfileindex

PyFileIndex - pythonic file system index

Pipeline codecov Binder

The pyfileindex helps to keep track of files in a specific directory, to monitor added files, modified files and deleted files. The module is compatible with Python 3.7 or later but restricted to Unix-like system - Windows is not supported.

Preview

Installation

The pyfileindex can either be installed via pip using:

pip install pyfileindex

Or via anaconda from the conda-forge channel

conda install -c conda-forge pyfileindex

Usage

Import pyfileindex:

from pyfileindex import PyFileIndex 
pfi = PyFileIndex(path='.')

Or you can filter for a specifc file extension:

def filter_function(file_name):
    return '.txt' in file_name
    
pfi = PyFileIndex(path='.', filter_function=filter_function)

List files in the file system index:

pfi.dataframe 

Each row is a file or directory below the indexed path:

Column Type Description
basename str File or directory name, e.g. output.txt
path str Absolute path
dirname str Absolute path of the parent directory
is_directory bool True for directories, False for files
mtime float Last modification time (POSIX timestamp, same as os.stat().st_mtime)
nlink int Hard link count (os.stat().st_nlink), used internally to detect changes
Update file system index:
pfi.update()

And open a subdirectory using:

pfi.open(path='subdirectory')

For more details, take a look at the example notebook: https://github.com/pyiron/pyfileindex/blob/main/notebooks/getting_started.ipynb

License

The pyfileindex is released under the BSD license https://github.com/pyiron/pyfileindex/blob/main/LICENSE . It is a spin-off of the pyiron project https://github.com/pyiron/pyiron therefore if you use the pyfileindex for your publication, please cite:

@article{pyiron-paper,
  title = {pyiron: An integrated development environment for computational materials science},
  journal = {Computational Materials Science},
  volume = {163},
  pages = {24 - 36},
  year = {2019},
  issn = {0927-0256},
  doi = {https://doi.org/10.1016/j.commatsci.2018.07.043},
  url = {http://www.sciencedirect.com/science/article/pii/S0927025618304786},
  author = {Jan Janssen and Sudarsan Surendralal and Yury Lysogorskiy and Mira Todorova and Tilmann Hickel and Ralf Drautz and Jörg Neugebauer},
  keywords = {Modelling workflow, Integrated development environment, Complex simulation protocols},
}

Documentation

Download files

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

Source Distribution

pyfileindex-0.2.2.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

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

pyfileindex-0.2.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

Details for the file pyfileindex-0.2.2.tar.gz.

File metadata

  • Download URL: pyfileindex-0.2.2.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pyfileindex-0.2.2.tar.gz
Algorithm Hash digest
SHA256 bf4f9fa998ca0ed58460a3fb5a5306bcde783cdc3c26e6e9cdadca1f74a351a5
MD5 1dc7c7a994b8245a94968235c5f65961
BLAKE2b-256 8ca51ced418a7d06e3ced144e23ec63fbabc6a0c8adfe537c362b53177bdcd04

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfileindex-0.2.2.tar.gz:

Publisher: deploy.yml on pyiron/pyfileindex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyfileindex-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pyfileindex-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 11.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for pyfileindex-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8553f4d947c9474e63b89e1210feda4811fec25e6880e175cfa51fe53b42f7ec
MD5 95183b0e31ed83700fcade7876e947ba
BLAKE2b-256 9920b915fc1b73063d428d43ef7d4010a6e306a0af6d454f9ad1b6d74b1b931e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyfileindex-0.2.2-py3-none-any.whl:

Publisher: deploy.yml on pyiron/pyfileindex

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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