Skip to main content

Create a database of all the items of a directory

Project description

Create a database of all the items of a directory

Installation

Install it with pip: pip install files-db2

Usage

Create the database:

import files_db
db = files_db.create(<your src>)

It is a table, a subclass of pandas dataframe, the columns are the following:

  • name: name of the item, relative path
  • size: size in bytes
  • n: number of items and sub-items
  • ctime: creation time
  • mtime: modification time
  • atime: last access time
  • level: how deep the item is from the root
  • nls: number of items (-1 if file)

You can use pandas native function sort_values

db_size = db.sort_values("size",ascending=False) # Get which items takes the most place
db_timeline = db.sort_values("ctime") # Get a timeline of items by their creation date

Other features:

db_ls = db.ls() # extract all root items
db_sub = db("foo/bar") # navigate in the database by getting into 1 specific item
db.only_dirs() # select only the dirs
db.only_files() # select only the files
db.pin_columns("nls") # pin a column(s) when you're more interested into a particular one

db.to_csv(<file>) # Export into a file
db = files_db.read_csv(<file>) # Import a database of file

And then you can save it into a file by db.to_csv(<file>) simply like pandas, and use a tool like Data Wrangler or Excel to view and analyse this data freely.

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

files_db2-0.2.tar.gz (60.9 kB view details)

Uploaded Source

Built Distribution

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

files_db2-0.2-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file files_db2-0.2.tar.gz.

File metadata

  • Download URL: files_db2-0.2.tar.gz
  • Upload date:
  • Size: 60.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for files_db2-0.2.tar.gz
Algorithm Hash digest
SHA256 36924227469911a639cc12194c776cb93ff485ad28f75b225c9a3824bbf77320
MD5 7107a966b76f66ce6a8c821e10dbf641
BLAKE2b-256 0d1468bed56c2072836bc636c10418f443e5a0ff880633ab6501c06d816f15a1

See more details on using hashes here.

File details

Details for the file files_db2-0.2-py3-none-any.whl.

File metadata

  • Download URL: files_db2-0.2-py3-none-any.whl
  • Upload date:
  • Size: 3.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for files_db2-0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c49ced881a78aba13ccc7adb141a3a373f9e57142f38c4a46d7e197566c05de
MD5 fc5dc68aab680fb4f8a7b3f30526cabc
BLAKE2b-256 6fbe461d3dc85740bc897fb69bd3f10fc0f35d220c2f878ebd308da8b230551b

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