pyfileindex#
PyFileIndex - pythonic file system index
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.

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 |
|---|---|---|
|
str |
File or directory name, e.g. |
|
str |
Absolute path |
|
str |
Absolute path of the parent directory |
|
bool |
|
|
float |
Last modification time (POSIX timestamp, same as |
|
int |
Hard link count ( |
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: pyiron/pyfileindex
License#
The pyfileindex is released under the BSD license pyiron/pyfileindex . It is a spin-off of the pyiron project 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},
}