Skip to main content

A Python library for cross-platform filesystem operations, providing classes for handling files and directories.

Project description

fsinfo

fsinfo is a Python library providing a high-level abstraction for working with filesystem paths, files, and directories in a cross-platform way. It simplifies file system operations like querying file attributes, manipulating directories, and handling files across Linux, macOS, and Windows.

Features

  • FileSystemInfo: A base class for handling common file system information retrieval such as creation, modification, and access times.
  • FileInfo: Extends FileSystemInfo for file-specific operations, including reading, writing, copying, and moving files.
  • DirectoryInfo: Extends FileSystemInfo for directory-specific operations, like listing contents, calculating directory size, and recursive deletion.

Usage

Working with Files

from YourPackageName.fileinfo import FileInfo 

file = FileInfo('/path/to/your/file.txt')
print(file.creation_time)
file.copy_to('/path/to/destination/file.txt', overwrite=True)

Working with Directories

from YourPackageName.directoryinfo import DirectoryInfo 

directory = DirectoryInfo('/path/to/your/directory')
print(directory.length)  # Total size of files in the directory

for  file_info  in  directory.get_files():
  print(file_info.name)

Contributing

Contributions are welcome! Please feel free to submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

fsinfo-0.0.6.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

fsinfo-0.0.6-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file fsinfo-0.0.6.tar.gz.

File metadata

  • Download URL: fsinfo-0.0.6.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for fsinfo-0.0.6.tar.gz
Algorithm Hash digest
SHA256 6a7b81aed66d92a34ba1cb55a5d0b14fc4df4f890ae93cb6cd7a94ee0a29a1a6
MD5 52fa4d4f9e63a2f9c4deee1792f10f73
BLAKE2b-256 6e34d033cb96524e086a5f6d4db603023d84ef7a1fe74a131203bbd053d78b9b

See more details on using hashes here.

File details

Details for the file fsinfo-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: fsinfo-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.7

File hashes

Hashes for fsinfo-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 2c137d8e5bab846d6be380d6b6b012427a12aea4c81215e1a73be1417d783d6f
MD5 ae0c2bd977382be065d067e4d209e983
BLAKE2b-256 382d222d19e9e4fba318a336a661db8cd3c663176e8c232b03325668fa1ae9fd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page