Skip to main content

filewrap

Python package for file/directory/archive management.

Python version 3.6 is required at a minimum. 

To install/update the package with pip enter command in terminal:
    pip install filewrap

To uninstall the package with pip enter command in terminal:
    pip uninstall filewrap

Built-in modules used: os, tarfile, zipfile
Method Description
copydir(destination_path, target_path) Copy target directory and all of it's subdirectories/files to a destination directory.
copyfile(destination_path, *filepaths) Copy single/multiple files to destination directory.
The destination_path and *filepaths arguments must be strings.
read(filepath) Read the binary from a file and return.
The filepath argument must be a string.
write(data, filepath) Write bytes object to a file.
The filepath argument must be a string.
The data argument must be a bytes object.
rpfile(mode, *filepaths) Read and print lines in single/multiple text/binary based files.
The mode argument must be either strings: 't' (text) or 'b' (binary).
The *filepaths arguments must be strings.
rmfile(*filepaths) Delete single/multiple files.
The *filepaths arguments must be strings.
mkfile(mode, *filepaths) Make single/multiple text/binary based files.
The mode argument must be either strings: 't' (text) or 'b' (binary).
The *filepaths arguments must be strings.
rmdir(*filepaths) Delete single/multiple directories.
The *filepaths arguments must be strings.
rmall(dirpath) Delete single directory along with it's subdirectories and files.
Use this with caution, as you could delete your entire file system if you're not careful.
mkdir(*filepaths) Make single/multiple directories.
The *filepaths arguments must be strings.
rpdir(*filepaths) Output to terminal the file/subdirectory names of single/multiple argument filepaths.
Use no arguments for working directory only.
The *filepaths arguments must be strings.
lsdir(filepath) Return a list with file/subdirectory names of the single argument directory. If there is no argument used in filepath, a list of the contents (e.g. paths of files & directories) within the working directory is returned. If there is one argument used in filepath, a list of the contents of only that directory is returned.
chdir(filepath) Change current working directory.
The filepath argument must be a string.
wdir() Return string of the path of the current working directory.
pwdir() Print working directory to terminal.
mklist(*filepaths) Return a list from lines in single/multiple text based files.
The *filepaths arguments must be strings.
writelines(filepath, *lines) Write singular strings or lists of strings in sequence to lines in a text based file.
The filepath argument must be a string.
The lines in the file are overwritten by the lines argument values.
appendlines(filepath, *lines) Append singular strings or lists of strings in sequence to lines at the end of a text based file.
The filepath argument must be a string.
path_exists(filepath) Return boolean value (True or False) to check if a single file path exists.
The filepath argument must be a string.
isfile(filepath) Return boolean value (True or False) to check if filepath argument is a file.
The filepath argument must be a string.
isdir(filepath) Return boolean value (True or False) to check if filepath argument is a directory.
The filepath argument must be a string.
istar(filepath) Return boolean value (True or False) to check if filepath argument is a tar archive.
The filepath argument must be a string.
iszip(filepath) Return boolean value (True or False) to check if filepath argument is a zip archive.
The filepath argument must be a string.
ren(current_filepath, desired_filepath) Rename single/multiple files or directories.
current_filepath represents the file path's name being changed.
desired_filepath represents the file path's new intended name.
current_filepath and desired_filepath can either be:
  • Two strings
  • Two lists of equal length consisting of strings
tar_wrap(filepath) Create a tar archive with gzip compression & .gz extension.
tar_extract(filepath) Extract a tar gzip archive contents to working directory.
zip_wrap(filepath) Create a zip archive with DEFLATE compression.
zip_extract(filepath) Extract a zip archive contents to working directory.
filecount(filepath) Count and return the number of files within a directory.
dircount(filepath) Count and return the number of directories within a directory.
size(*filepaths) Get the total combined size in bytes of the file paths & directories within the *filepaths argument.

Back to Top


Release files for filewrap 1.1.7

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

Source distribution (sdist)

Source distribution for filewrap 1.1.7
File Size Uploaded
filewrap-1.1.7.tar.gz 6.5 kB Details

Release files / filewrap-1.1.7.tar.gz

Download URL filewrap-1.1.7.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
8c57fccb8106206adeea9f2310515f43cb92f673c447695d9cb1bf9cbd6f7816
BLAKE2b-256 checksum
How to use checksums
db58e0c7a084af0354437609b6775339cb9b201d3ea9bc86a275e1bdc5c5a853
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release history Release notifications | RSS feed

This release

1.1.7 This release

1 release file

1.1.6

1 release file

1.1.5

1 release file

1.1.4

1 release file

1.1.3

1 release file

1.1.2

1 release file

1.1.1

1 release file

1.1

1 release file

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