Skip to main content

A python class to wrap fs and fs-s3fs (WIP)

Project description

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

Project details


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.20.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

fss3wrap-0.1.20-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fss3wrap-0.1.20.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for fss3wrap-0.1.20.tar.gz
Algorithm Hash digest
SHA256 7872c11fedeb8bb7cd47a0a5eac089c63816208a8ee809145e3fdbb6ef4e56a1
MD5 2d7b598038c77710ed1f34395f206db6
BLAKE2b-256 cf89278f9760a8c1c13f2b10a75f9c7740eb4c8683628b44a595a1b6879a8fb7

See more details on using hashes here.

File details

Details for the file fss3wrap-0.1.20-py3-none-any.whl.

File metadata

  • Download URL: fss3wrap-0.1.20-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for fss3wrap-0.1.20-py3-none-any.whl
Algorithm Hash digest
SHA256 61de9968561e0ab782372acd549025e4020a45fda2f57d7b7ccab278804d0154
MD5 00b166b2e8eb77b1afc6475cdfab5a95
BLAKE2b-256 2485bd6aec3a8711035236a8996043b35889c0ae1d862012caf530c3e9848091

See more details on using hashes here.

Supported by

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