This Python script retrieves S3 credentials from a specified URL and lists the first-level directories in an Amazon S3 bucket.
- Python 3.6 or higher
- pip installed
Clone this repository to your local machine.
$ git clone <repository_url>
$ cd <repository_folder>It is recommended to create a Python virtual environment to manage dependencies.
# Create a virtual environment named 'venv'
$ python3 -m venv venv
# Activate the virtual environment
# On Windows
$ venv\Scripts\activate
# On macOS/Linux
$ source venv/bin/activateInstall the required packages using pip:
$ pip install -r requirements.txtCreate a .env file in the project root directory and add the following:
SECRET_URL=https://hublink.cloud/...This URL contains the necessary credentials for accessing Amazon S3.
To run the script, ensure your virtual environment is activated and execute the following command:
$ python client.pyThe script will retrieve the S3 credentials and list the first-level directories in the specified bucket.
When you're done, deactivate the virtual environment:
$ deactivateThis project is licensed under the MIT License.
See How to Sync AWS S3 Buckets with Local Folders Let see the steps below.