Skip to main content

file and folder system information

Project description

py-filesystem

py-filesystem is a Python module that provides information about files and folders.

Usage

To obtain information from a folder

>>> import os
>>> from filesystem import Folder
>>> folder = Folder(os.getcwd())
>>> folder.what
'folder'
>>> folder.atime
1657473718.8713582
>>> folder.atime_humanized()
'10 Jul 2022 19:21:58'
>>> folder.size             
133914
>>> folder.size_humanized()
'130.8KiB'
>>> folder.is_empty
False
>>> folder.listdir 
['.git', '.gitignore', 'README.md', 'build', 'dist', 'filesystem', 'py_filesystem.egg-info', 'requirements.txt', 'setup.py', 'test']

To obtain information from a file

>>> from filesystem import File
>>> file = File('README.md')
>>> file.mime
'inode/x-empty'
>>> file.size
0
>>> file.is_readable()
True
>>> file.is_writable()
True
>>> file.md5
'd41d8cd98f00b204e9800998ecf8427e'
>>> file.extension
'.md'
>>> file.name
'README'

Installation

pip install py-filesystem

Other sources:

Requirements

python-magic

libmagic

MacOs

macappstore: installation libmagic

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

py_filesystem-0.1.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file py_filesystem-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: py_filesystem-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.9

File hashes

Hashes for py_filesystem-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0727863f383d7633a40b60d73f4e498c46f43e414132f8c51e6d0cb857950413
MD5 6eee6b9aad3c0cb630eb27d2c6c138ad
BLAKE2b-256 ae1f1bb1c15bd0303b1a264cc946525dd1448e84e743c1b3e40837ae17134c8d

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