The Wayback Machine - https://web.archive.org/web/20200529195330/https://github.com/AlexFlipnote/diskspace
Skip to content
Making it possible to use Linux df & du command on Windows/Linux.
Python
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
diskspace
.gitignore
LICENSE
README.md
setup.py

README.md

diskspace

Making it possible to use Linux df & du command on Windows/Linux.

Requirements

Python 3.6 or up

Install

pip install diskspace

Usage

$ ds|diskspace --help
usage:  [--help] [-v] [-e EXCLUDE [EXCLUDE ...]] [-o ONLY [ONLY ...]] [-h]
        [-nf] [-ns]

Making it possible to use Linux df & du command on Windows

optional arguments:
  --help                Show this help message and exit.
  -v, --version         Show the version number and exit
  -e EXCLUDE [EXCLUDE ...], --exclude EXCLUDE [EXCLUDE ...]
                        Exclude name or file extensions matching arguments
  -o ONLY [ONLY ...], --only ONLY [ONLY ...]
                        Only include name or file extensions matching
                        arguments
  -h, --human           Convert bytes in to readable format
  -nf, --nofolders      Ingore folders
  -ns, --nostats        Don't display disk space at top

Usage in code example

>>> import diskspace
>>> show_dir = diskspace.ShowPath("./Desktop")
>>> print(show_dir.all_files)
# [<FileInfo name=Adios.png bytes=267391 human=261.1KiB folder=False created=1571303626.1382277>, <FileInfo name=Baby yoda flip pancakes.jpg bytes=47487 human=46.4KiB folder=False created=1574946741.9886782>, <FileInfo name=big sipp.jpg bytes=47076 human=46.0KiB folder=False created=1574028168.9891481>]

ShowPath()

  • path: str = Path to find files (Default: ".")
  • exclude: str = Exclude files (Default: None)
  • include_folder = Include folders in result (Default: True)
  • human: bool = Show disk space in human-readable value (Default: False)
  • include_stats: bool = Include stats of current disk in ShowPath.pretty_print (Default: True)
  • whitelist: str = Only include X files (Default: None)
You can’t perform that action at this time.