All Projects → liormizr → S3path

liormizr / S3path

Licence: apache-2.0
s3path is a pathlib extension for AWS S3 Service

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to S3path

serverless-data-pipeline-sam
Serverless Data Pipeline powered by Kinesis Firehose, API Gateway, Lambda, S3, and Athena
Stars: ✭ 78 (-6.02%)
Mutual labels:  aws-s3, amazon-web-services
Ssm Cache Python
AWS System Manager Parameter Store caching client for Python
Stars: ✭ 177 (+113.25%)
Mutual labels:  aws-s3, amazon-web-services
Aws Csa Notes 2018
My AWS Certified Solutions Architect Associate Study Notes!
Stars: ✭ 167 (+101.2%)
Mutual labels:  aws-s3, amazon-web-services
Aws S3 Virusscan
Antivirus for Amazon S3 buckets
Stars: ✭ 400 (+381.93%)
Mutual labels:  aws-s3, amazon-web-services
Cloud Security Audit
A command line security audit tool for Amazon Web Services
Stars: ✭ 68 (-18.07%)
Mutual labels:  amazon-web-services
Rpizero smart camera3
Smart security camera with Raspberry Pi Zero and OpenFaaS
Stars: ✭ 58 (-30.12%)
Mutual labels:  aws-s3
Amazon Ecs Interstella Workshop
Amazon ECS Interstella Workshops CON209/318/319/407
Stars: ✭ 57 (-31.33%)
Mutual labels:  amazon-web-services
Simples3
Simple no frills AWS S3 Golang Library using REST with V4 Signing (without AWS Go SDK)
Stars: ✭ 51 (-38.55%)
Mutual labels:  aws-s3
Circleci Orbs
The source code for some of the orbs published by CircleCI
Stars: ✭ 82 (-1.2%)
Mutual labels:  aws-s3
Aws
Racket support for Amazon Web Services.
Stars: ✭ 72 (-13.25%)
Mutual labels:  amazon-web-services
Curso Aws Com Terraform
🎦 🇧🇷 Arquivos do curso "DevOps: AWS com Terraform Automatizando sua infraestrutura" publicado na Udemy. Você pode me ajudar comprando o curso utilizando o link abaixo.
Stars: ✭ 62 (-25.3%)
Mutual labels:  aws-s3
Content Dynamodb Deepdive
Amazon DynamoDB Deep Dive Course
Stars: ✭ 59 (-28.92%)
Mutual labels:  amazon-web-services
Aws Github Actions
Deploy 🚀 to AWS ☁️ with GitHub Actions!
Stars: ✭ 70 (-15.66%)
Mutual labels:  aws-s3
Aws S3
Amazon S3 volume type for Craft CMS
Stars: ✭ 57 (-31.33%)
Mutual labels:  aws-s3
Cognitocurl
🦉🤖Easily sign curl calls to API Gateway with Cognito authorization token.
Stars: ✭ 76 (-8.43%)
Mutual labels:  amazon-web-services
Poosh
🌎 Publish local files to virtually any remote endpoint (e.g. AWS S3)
Stars: ✭ 55 (-33.73%)
Mutual labels:  aws-s3
Aws Config To Elasticsearch
Generates an AWS Config Snapshot and ingests it into ElasticSearch for further analysis using Kibana
Stars: ✭ 62 (-25.3%)
Mutual labels:  aws-s3
Molecule Ansible Docker Aws
Example project showing how to test Ansible roles with Molecule using Testinfra and a multiscenario approach with Docker, Vagrant & AWS EC2 as infrastructure providers
Stars: ✭ 72 (-13.25%)
Mutual labels:  amazon-web-services
Cloud Portal
Self service web portal for different Cloud platforms like Azure, AWS and VMWare vSphere.
Stars: ✭ 60 (-27.71%)
Mutual labels:  amazon-web-services
Image Resizer
On-the-fly image resizing using Node.js and libvips. Heroku Ready!
Stars: ✭ 59 (-28.92%)
Mutual labels:  aws-s3

S3Path

.. image:: https://badgen.net/pypi/v/s3path :target: https://pypi.org/project/s3path/ :alt: Latest version

.. image:: https://badgen.net/travis/liormizr/s3path/master/ :target: https://travis-ci.com/liormizr/s3path :alt: Travis-CI

S3Path provide a Python convenient File-System/Path like interface for AWS S3 Service using boto3 S3 resource as a driver.

Like pathlib, but for S3 Buckets


AWS S3 is among the most popular cloud storage solutions. It's object storage, is built to store and retrieve various amounts of data from anywhere.

Currently, Python developers use Boto3 as the default API to connect / put / get / list / delete files from S3.

S3Path blends Boto3's ease of use and the familiarity of pathlib api.

Install:

From PyPI:

.. code:: bash

$ pip install s3path

From Conda:

.. code:: bash

$ conda install -c conda-forge s3path

Basic use:

The following example assumes an s3 bucket setup as specified bellow:

.. code:: bash

$ aws s3 ls s3://pypi-proxy/

2018-04-24 22:59:59        186 requests/index.html
2018-04-24 22:59:57     485015 requests/requests-2.9.1.tar.gz
2018-04-24 22:35:01      89112 boto3/boto3-1.4.1.tar.gz
2018-04-24 22:35:02        180 boto3/index.html
2018-04-24 22:35:19    3308919 botocore/botocore-1.4.93.tar.gz
2018-04-24 22:35:36        188 botocore/index.html

Importing the main class:

.. code:: python

from s3path import S3Path

Listing "subdirectories" - s3 keys can be split like file-system with a / in s3path we:

.. code:: python

bucket_path = S3Path('/pypi-proxy/') [path for path in bucket_path.iterdir() if path.is_dir()] [S3Path('/pypi-proxy/requests/'), S3Path('/pypi-proxy/boto3/'), S3Path('/pypi-proxy/botocore/')]

Listing html source files in this "directory" tree:

.. code:: python

bucket_path = S3Path('/pypi-proxy/') list(bucket_path.glob('**/*.html')) [S3Path('/pypi-proxy/requests/index.html'), S3Path('/pypi-proxy/boto3/index.html'), S3Path('/pypi-proxy/botocore/index.html')]

Navigating inside a "directory" tree:

.. code:: python

bucket_path = S3Path('/pypi-proxy/') boto3_package_path = bucket_path / 'boto3' / 'boto3-1.4.1.tar.gz' boto3_package_path S3Path('/pypi-proxy/boto3/boto3-1.4.1.tar.gz')

Querying path properties:

.. code:: python

boto3_package_path = S3Path('/pypi-proxy/boto3/boto3-1.4.1.tar.gz') boto3_package_path.exists() True boto3_package_path.is_dir() False boto3_package_path.is_file() True

Opening a "file" (s3 key):

.. code:: python

botocore_index_path = S3Path('/pypi-proxy/botocore/index.html') with botocore_index_path.open() as f: print(f.read()) """

<title>Package Index</title> botocore-1.4.93.tar.gz
"""

Or Simply reading:

.. code:: python

botocore_index_path = S3Path('/pypi-proxy/botocore/index.html') botocore_index_path.read_text() """

<title>Package Index</title> botocore-1.4.93.tar.gz
"""

Requirements:

  • Python >= 3.4
  • boto3

Further Documentation:

  • Advanced S3Path configuration_ (S3 parameters, S3-compatible storage, etc.)
  • Abstract pathlib interface_ implemented by S3Path
  • Boto3 vs S3Path usage examples_

Similar Projects:

  • pathlib_ : Python standard library's Object-oriented filesystem paths and this project base
  • pathy_ : Similar project which provides a Path interface for GoogleCloudStorage.

.. _pathlib : https://docs.python.org/3/library/pathlib.html .. _Abstract pathlib interface: https://github.com/liormizr/s3path/blob/master/docs/interface.rst .. _Boto3 vs S3Path usage examples: https://github.com/liormizr/s3path/blob/master/docs/comparison.rst .. _Advanced S3Path configuration: https://github.com/liormizr/s3path/blob/master/docs/advance.rst .. _pathy: https://github.com/justindujardin/pathy

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].