Skip to main content

What is this?

An work-in-progress library for file manipulation in python.
(E.g. I was tired of copy-pasting my giant tool into each project)

How do I use this?

pip install file-system-py

import file_system_py as FS


*folders, name, extension = FS.path_pieces("/this/is/a/filepath.txt")
# folder[0] == '/' for absolute paths

FS.remove("./a folder")
FS.remove("./a file")
# 1. no error if they dont exist
# 2. doesnt care if file or folder

FS.extname("./thing/thing.stuff.blah.py")
# returns ".py"

# different ways to list
FS.list_paths_in("./thing/things")
FS.list_basenames_in("./thing/things")
FS.list_file_paths_in("./thing/things")
FS.list_folder_paths_in("./thing/things")
# returns [] when path doesnt exist or is a file

# much faster iterative versions
FS.iterate_paths_in(path)
FS.iterate_basenames_in(path)
FS.iterate_file_paths_in(path)
FS.iterate_folder_paths_in(path)


# 
# full api
# 
FS.walk_up_until(file_to_find, start_path=get_cwd())
FS.ensure_is_folder(path, force=True)
FS.ensure_is_file(path, force=True)
FS.make_relative_path(to=, coming_from=get_cwd())
FS.make_absolute_path(to, coming_from=get_cwd())
FS.move(item, to=, new_name=, force=True)
FS.copy(item, to=, new_name=, force=True)
FS.write(data, to=, force=True)
FS.is_folder(path)
FS.is_file(path)
FS.read(filepath)
FS.remove(path)
FS.exists(path)
FS.ls(path=".")
FS.list_paths_in(path)
FS.list_basenames_in(path)
FS.list_file_paths_in(path)
FS.list_folder_paths_in(path)
FS.iterate_paths_in(path)
FS.iterate_basenames_in(path)
FS.iterate_file_paths_in(path)
FS.iterate_folder_paths_in(path)
FS.glob(path)
FS.touch(path)
FS.touch_dir(path)
FS.parent_folder(path)
FS.basename(path)
FS.name(path)
FS.extname(path)
FS.path_pieces(path)
FS.join(*paths)
FS.is_absolute_path(path)
FS.is_relative_path(path)
FS.get_cwd()
FS.local_path(*paths)

Metadata

Release files for file-system-py 0.0.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for file-system-py 0.0.11
File Size Uploaded
file_system_py-0.0.11.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for file-system-py 0.0.11
File Interpreter ABI Platform
file_system_py-0.0.11-py3-none-any.whl Python 3 none any Details

Total release size: 10.2 kB

Release files / file_system_py-0.0.11.tar.gz

Download URL file_system_py-0.0.11.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8c47c1ce53c2aaf158b8b26879568b166cc10640b08769b111787241c9845212
BLAKE2b-256 checksum
How to use checksums
ded4ae85ebdb99595deac4feed647c0b7cb6aae7573c3ca3bb4d707d646133ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.13

Release files / file_system_py-0.0.11-py3-none-any.whl

Download URL file_system_py-0.0.11-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc29c6e9993174eddc781936fa1c937e6599de080c314c4de22460cb5c4a4276
BLAKE2b-256 checksum
How to use checksums
143ac0e33a68b5efd6d23b1c77b7d6b2539f0e4316813b8b21e2cd67859196f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.8.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.63.0 CPython/3.8.13

Release history Release notifications | RSS feed

This release

0.0.11 This release

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page