Skip to main content

A python class to wrap fs and fs-s3fs-ng.

With this library, you can use the same code to interact with a traditional file system or an AWS S3 bucket. Its interface class exposes 7 common methods, not every single file system operation, of course.

It is still in its early stage of development so handle with care. 😃

Installation

pip3 install fss3wrap

Usage

Use the env_example and create your own .env file (or put the same variables in your environment in some other way), then set AWS_S3_USED to True or False as you need it: once in your script with a single class or use it with two Afs classes.

Env files are not read directly: they are used for testing purposes, it’s user duty to call methods with proper values, with or without envs.

You can use the test file on GitHub as documentation of the methods.

Afs interface class methods

  • bytes_write(destination_path, destination_file, mbytes)

  • directory_list(path)

  • download(relative_source_path, destination_path, filename, mode)

  • file_copy(source_path, source_file)

  • file_descriptor_copy(source_file_descriptor, destination_path, destination_file)

  • file_fd(file_path, file_name)

  • file_fd_bin(file_path, file_name)

  • file_md5(file_path, file_name)

  • file_read(source_path, source_file)

  • file_read_bin(source_path, source_file)

  • file_remove(file_path, file_name)

  • reinit(s3_used, s3_parameters, bucket, rootdir)

A note on the tests

Files needed to begin:

  • local/LICENSE (text)

  • local/extra_sub_folder/4x4.jpg (binary)

  • local/extra_sub_folder/out_LICENSE (text)

  • remote/extra_sub_folder/4x4.jpg (binary)

  • remote/extra_sub_folder/out_LICENSE (text)

  • remote_reinit/extra_sub_folder/4x4.jpg (binary)

  • remote_reinit/extra_sub_folder/out_LICENSE (text) and two AWS S3 Bucket

Author

Carlo Perassi

Contributor

Matteo Ferrabone

Thanks

Release files for fss3wrap 0.1.21

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

Source distribution (sdist)

Source distribution for fss3wrap 0.1.21
File Size Uploaded
fss3wrap-0.1.21.tar.gz 5.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fss3wrap 0.1.21
File Interpreter ABI Platform
fss3wrap-0.1.21-py3-none-any.whl Python 3 none any Details

Total release size: 11.7 kB

Release files / fss3wrap-0.1.21.tar.gz

Download URL fss3wrap-0.1.21.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
bb8d5ff47020f2c87836fd6d7484881289e8f0a3eecca5d0a0871b56dcac3188
BLAKE2b-256 checksum
How to use checksums
9834b1b649523a39c54e2191bea0ed13c3f5c7d85958990796c0c939f6259de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

Release files / fss3wrap-0.1.21-py3-none-any.whl

Download URL fss3wrap-0.1.21-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ba479dc592da4186e5f3bfaacc9a0946ad1e81bc6faeeecbb157499bf3b9d547
BLAKE2b-256 checksum
How to use checksums
9fc85f76a0874ec7bec6c73b5edb6e21ed9bc4f62df60b0b8ba0eb4e4a5f1141
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.1.21 This release

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

1 release file

0.1.16

1 release file

0.1.15

1 release file

0.1.14

1 release file

0.1.13

1 release file

0.1.12

1 release file

0.1.11

1 release file

0.1.10

1 release file

0.1.9

1 release file

0.1.8

1 release file

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.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