This project provides a command-line interface (CLI) for managing files in Google Cloud Storage (GCS). 🚀 You can upload files, view blobs in a bucket, and delete specific blobs using this tool.
- 📤 Upload Files: Upload files to a specified GCS bucket and make them publicly accessible.
- 👁️ View Blobs: List all blobs in a specified GCS bucket with details such as size, content type, and public URL.
- 🗑️ Delete Blobs: Delete specific blobs from a GCS bucket by selecting them from a list.
-
Clone the Repository:
git clone https://github.com/JayJCodez/GCP-Uploader-v1.git cd gcp-storage-manager
-
Create and Activate a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate
-
Install Dependencies:
pip install -r requirements.txt
-
Create a
.env
File: Create a.env
file in the root of your project directory with the following content:SERVICE_ACCOUNT_KEY_PATH=path/to/your/service_account_key.json BUCKET_NAME=your-bucket-name
-
📤 Upload a File:
python main.py
Follow the prompts to specify the file path and destination blob name.
-
👁️ View Blobs:
python main.py
Choose the option to view blobs to list all blobs in the bucket.
-
🗑️ Delete Blobs:
python main.py
Choose the option to delete files, then select the blobs to delete by entering their numbers.
Ensure that your .env
file contains the correct paths and bucket name:
SERVICE_ACCOUNT_KEY_PATH
: The path to your GCP service account key file.BUCKET_NAME
: The name of your GCS bucket.
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit your changes (
git commit -am 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to replace placeholders like https://github.com/yourusername/gcp-storage-manager.git
with your actual repository URL, and adjust instructions as needed for your specific project setup. 🎉