Skip to main content

File Database

Fast index and query of local files using pandas and pyarrow.

Features

  • Recursively index files in specified directories
  • Regex-based exclusion of file and folder patterns
  • Optional BLAKE2b hashing for deduplication
  • Feather-format output for fast query
  • Simple CLI powered by click

Usage

# Index files
file-db index --config config.yaml

# Query files
file-db query --expr "size > 1e7 and suffix == '.csv'"

Query Language

Query Examples

recent files, top 10, drop dir column but add create column, files with names matching regex "q?md$", which means suffix qmd or md.

verbose recent top 10 select !dir,create ! q?md$

Min config file

included/excluded files must not be empty.

project: Samsung 64GB compact flash
hostname: KOLMOGOROV
database: G:/sams64gb.fdb-feather
included_dirs:
- G:/
excluded_dirs: []
excluded_files: []
excluded_files:
hash_files: true
hash_workers: 6
last_indexed: 0 
timezone: Europe/London
tablefmt: mixed_grid

To Do

  • Util to create a blank config file (maybe with prompts)
  • Incremental updates check for deletes and if the file is logged (changed spec), use set and set diff and df = df[~df["col"].isin(seen)]
  • Create job and python path
  • query > file work
  • add duplicates and hardlinks key works
  • parse queries in order independent manner
  • GT should have a repr_text version!
  • directory sizes?!
  • recent directories (recent changes to dirs)

Regex look aheads/look backs

Metadata

Release files for file-database 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file-database 0.2.0
File Size Uploaded
file_database-0.2.0.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for file-database 0.2.0
File Interpreter ABI Platform
file_database-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 40.1 kB

Release files / file_database-0.2.0.tar.gz

Download URL file_database-0.2.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b1ebdbe7f90274e055cf44b732fc5fef79e4f82c852e2d4db6aa3befc52a4c6a
BLAKE2b-256 checksum
How to use checksums
31f4f593ca587eddc78deecbb7a25a36d41a7b49caf77b9d4be783f312d6cf6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release files / file_database-0.2.0-py3-none-any.whl

Download URL file_database-0.2.0-py3-none-any.whl
Size 21.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e2199b67319da61e534bf675b650e7bcb98672b4d7d88c59acf2ccc32e1abbf5
BLAKE2b-256 checksum
How to use checksums
2bf7fa2b1c4f3b0f4df1c54e8752292b30a46d954e0b7f575d1ee8f4d7ba3516
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page