File Operations
Simple python API for performing directory and file-based operations.
Installation
You can install the file_operations library with the following command:
pip install file_operations==1.0.5
Then import into your program as:
import file_operations
def main():
data = "aabaaba"
src_file = "hello.src"
dest_file = "hello.dest"
file_operations.write_file(src_file, data, mode='w')
file_operations.copy_file(src_file, dest_file)
if __name__ == '__main__':
main()
API Architecture
The following discusses the available methods in this library:
read_bytes(src_file, offset, limit)
copy_file(src_file, dest_file)
write_file(dest_file, data, mode ='w', overwrite = False)
move_file(src_file, dest_file)
remove_file(src_file)
create_dir(dest_dir)
copy_dir(src_dir, dest_dir, overwrite = False)
move_dir(src_dir, dest_dir)
remove_dir(dest_dir)
buffered_reader(file_name, buffer_size, mode ='rb'):
buffered_reader.has_next()
buffered_reader.read()
buffered_reader.close()
The _file methods require both src_file and dest_file to be formatted as path/file_name.extension.
Note the buffered_reader is a class which is used for reading a large file in chunks, the size of each chunk is buffer_size.
If an operation is successfully applied, then the function returns True and False otherwise.
For coding interview preparation, please visit [algorithmspath.com] (https://algorithmspath.com).
Metadata
Release files for file-operations 1.0.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| file_operations-1.0.5.tar.gz | 3.7 kB | Without provenance | Details for file_operations-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| file_operations-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for file_operations-1.0.5-py3-none-any.whl |
Total release size: 7.9 kB
Release files / file_operations-1.0.5.tar.gz
| Download URL | file_operations-1.0.5.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
159de58eb2690ee6b2a777825abead35ea79165a1af4dd8127461c4d47acbdd3
|
|
BLAKE2b-256 checksum How to use checksums |
1996b341bbedebf00849c198073a8a7961338575884a15e896e2655fd50c9b14
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
|
Release files / file_operations-1.0.5-py3-none-any.whl
| Download URL | file_operations-1.0.5-py3-none-any.whl |
|---|---|
| Size | 4.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b4636c1e401cf74eed81577563ff9e58b8196511edb1602c95fcb865742edfb0
|
|
BLAKE2b-256 checksum How to use checksums |
50e49de54f11e9cbeca1641f6e2d69cbde0179d99e1a432b4ceae43a125cb8d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.2 importlib_metadata/4.6.3 pkginfo/1.7.1 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
|
Security for file-operations 1.0.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.