Skip to main content

Python library for interacting with the file system

Project description

Revelio

Revelio is a Python library for interacting with the file system in an object oriented manner. I know you can use os and os.path to do all of these but I find their usage hard to remember and not very object oriented.

Installation

You can use pip to install Revelio.

pip install revelio

Usage

Revelio is an object oriented interface for the file system. All files and directories (folders) are considered Path objects. Any path except the root, has a parent: the directory it is in. Directories have children, some of them are files and some are subdirectories.

Path

Usually we want to start in the current working directory:

from revelio import Path
current_directory = Path.get_current_directory()

# ls or dir:
print(current_directory.list())

# get the first subdirectory:
first_subdirectory = current_directory.directories[0]

# get the parent directory:
parent_directory = current_directory.parent_directory

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

disk-0.1.1.tar.gz (3.2 kB view hashes)

Uploaded Source

Built Distribution

disk-0.1.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

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