Skip to main content

All-in-one file manipulation

Project description

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)

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

file_system_py-0.0.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

file_system_py-0.0.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file file_system_py-0.0.2.tar.gz.

File metadata

  • Download URL: file_system_py-0.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using 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.6

File hashes

Hashes for file_system_py-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e727dcdb0225674929cc0bb5f6b94907a7f6faabae561ddef98cdb1267f389ce
MD5 4e62cc09a8f886d5b3619df430675e30
BLAKE2b-256 37df31802c5e5d003cabfd69a0a72d938d3683ce7ca00532f8bc1651fd09ab16

See more details on using hashes here.

File details

Details for the file file_system_py-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: file_system_py-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using 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.6

File hashes

Hashes for file_system_py-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37eb5c3e14159e580edc3113d7871f6fcaa12369a0c14dd95d4e0d36cfedeef7
MD5 42ca1a9844cb92efe4cbda47e893107b
BLAKE2b-256 7e9d54577040e2126bd6e3fcfb0926f0bbd00f83ffecf2bc992ec76427087633

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