No project description provided
Project description
fsoopify
Just make file system oopify.
install
pip install fsoopify
usage
import fsoopify
[file|directory] = fsoopify.NodeInfo.from_path(...)
# api for both file and directory
file.rename()
file.get_parent()
file.is_exists()
file.is_directory()
file.is_file()
file.delete()
file.create_hardlink()
# api for file
file.open()
file.size
file.read() and file.write()
file.read_text() and file.write_text()
file.read_bytes() and file.write_bytes()
file.copy_to()
file.load() and file.dump() # I love this API
file.load_context() # load and dump the file in a context.
# api for directory
directory.create() and directory.ensure_created()
directory.create_file()
directory.iter_items()
directory.list_items()
directory.get_fileinfo() and directory.get_dirinfo()
directory.has_file() and directory.has_directory()
Optional packages
portalocker
- lock the file when callingfile.load_context()
json5
- load or dump json5 filepyyaml
- load or dump yaml filetoml
- load or dump toml filepipfile
- load pipfile
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fsoopify-0.3.0.tar.gz
(9.8 kB
view hashes)
Built Distribution
fsoopify-0.3.0-py3-none-any.whl
(12.2 kB
view hashes)