Skip to main content

A python class to wrap fs and fs-s3fs.

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

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

Afs interface class methods

  • bytes_write(destination_path, destination_file, mbytes)

  • directory_list(path)

  • file_copy(source_path, source_file, destination_path, destination_file)

  • file_descriptor_copy(source_file_descriptor, destination_path, destination_file)

  • file_remove(file_path, file_name)

  • file_md5(file_path, file_name)

  • file_read(source_path, source_file, destination_path, destination_file)

A note on the tests

Files needed to begin:

  • local/LICENSE

  • remote/out_LICENSE

  • remote/out2_LICENSE

local/ is a local path, while remote/ is a “remote” path, which is a normal folder in the OS file system case or a folder inside a bucket in the S3 case.

A few words on each test:

  • test_bytes_write: creates remote/out_LICENSE

  • test_directory_list: lists remote/

  • test_filecopy: copies local/LICENSE to remote/out_LICENSE

  • test_file_descriptor_copy: same as test_filecopy but using a file descriptor

  • test_file_remove: deletes remote/out_LICENSE

  • test_file_md5: returns the md5 string of remote/out2_LICENSE

  • test_file_read: returns as a string the content of remote/out2_LICENSE after having copied it in local/LICENSE_from_remote

Author

Carlo Perassi

Thanks

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fss3wrap-0.1.9.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file fss3wrap-0.1.9.tar.gz.

File metadata

  • Download URL: fss3wrap-0.1.9.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

File hashes

Hashes for fss3wrap-0.1.9.tar.gz
Algorithm Hash digest
SHA256 e8df655c41eb255e11193ff206d71fa36f3bd2e5c6f0cc0e6110df9142fd025b
MD5 288179441be51580301310c8e1126577
BLAKE2b-256 88ce15eb804a39ac1c2241847689bc1885d1ad9dece6852528d636f595acc4ea

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

1 file

0.1.16

1 file

0.1.15

1 file

0.1.14

1 file

0.1.13

1 file

0.1.12

1 file

0.1.11

1 file

0.1.10

1 file

This release

0.1.9 This release

1 file

0.1.8

1 file

0.1.6

1 file

0.1.5

1 file

0.1.4

1 file

0.1.2

1 file

0.1.1

1 file

0.1

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page