Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mananag-1784/s3_bucket
Python Package that will help you to perform tasks in your S3 bucket.
https://github.com/mananag-1784/s3_bucket
aws filesystem s3-bucket
Last synced: 5 days ago
JSON representation
Python Package that will help you to perform tasks in your S3 bucket.
- Host: GitHub
- URL: https://github.com/mananag-1784/s3_bucket
- Owner: MananAg-1784
- Created: 2024-09-05T00:34:37.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-05T01:19:09.000Z (4 months ago)
- Last Synced: 2024-12-17T18:13:25.244Z (5 days ago)
- Topics: aws, filesystem, s3-bucket
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# S3_bucket
`Amazon Simple Storage Service` (Amazon S3) is an object storage service that offers scalability, data availability and performance.
This package will help you perform tasks in your S3 bucket though the use of simple Python functions. It can be easily be implemented with any of the existing code allowing it to manage and access storage directly through the bucket.
It uses the `boto3` package - Amazons SDK for Python.## How to Use
Fill up the AWS details in the `config.py` file, It is not mandatory to configure the file but this method is recommended. You can also pass the credentials while creating the `bucket` object.
If no credentials are passed while creating the object it takes defualt credentials from the config file.```bash
# config.py file
aws_credentials = {
"access key" : "",
"secret key" : "",
"region" : "",
"bucket_name" : ""
}
```Import the package in your file `run.py`
Create an object of the class `bucket` from `bucket.py````bash
# run.py
from S3_bucket.bucket import Bucket
from env import credentials # Importing your AWS details locally
bucket_obj = Bucket()
# OR
bucket_obj2 = Bucket(credentials)
```Some Examples of the functions
```bash
obj.create_folder("Music")
obj.upload_file(file_path = "__path__", file_name = "new_file.txt", replace = True)
obj.move_folder("Music", "Albums")
obj.get_object_list("Albums\", check_folder = True)
```
*NOTE : While creating a S3 bucket for your app make sure to check the `Block all public access` to protect your files from unauthorised access.*## Contact
For any questions or feedback, please contact at `[email protected]`
Visit my [Website](https://manan-portfolio.ddns.net/) to check out my works