A modern Python development toolkit.
Project description
jbussdieker-storage
A modern Python development toolkit plugin for persistent storage operations using cloud storage services. This plugin integrates with the jbussdieker CLI framework to provide seamless storage management capabilities.
🚀 Features
- Cloud Storage Integration: Seamlessly connect to AWS S3 storage buckets
- Directory Listing: List and explore storage prefixes and directories
- Configurable Storage URLs: Support for S3 storage URLs with bucket and prefix configuration
- CLI Integration: Fully integrated with the jbussdieker CLI framework
- Extensible Architecture: Easy to extend for additional storage backends
📦 Installation
pip install jbussdieker-storage --upgrade
🔧 Prerequisites
- Python 3.9 or higher
- AWS credentials configured (via AWS CLI, environment variables, or IAM roles)
- jbussdieker CLI framework
- Valid S3 bucket access permissions
🎯 Usage
Basic Usage
List directories in your configured storage:
jbussdieker storage
Configuration
The plugin requires a storage URL to be configured in your jbussdieker configuration. The storage URL should follow the S3 format:
s3://bucket-name/prefix/
Example Configuration
Add the following to your jbussdieker configuration:
storage_url: "s3://my-project-bucket/data/"
🔍 How It Works
- Configuration Validation: Checks for a valid storage URL in your jbussdieker configuration
- URL Parsing: Extracts bucket name and prefix from the S3 URL
- Storage Connection: Establishes connection to AWS S3 using boto3
- Directory Listing: Lists all subdirectories under the configured prefix
- Output Display: Prints the directory structure to stdout
🛠️ Supported Storage Backends
AWS S3
Currently supports AWS S3 storage with the following features:
- Bucket Access: Connect to any S3 bucket you have access to
- Prefix Support: Work within specific prefixes in your bucket
- Directory Listing: List all subdirectories under a given prefix
- Pagination: Handles large directory structures efficiently
Future Backends
The plugin architecture is designed to support additional storage backends:
- Google Cloud Storage
- Azure Blob Storage
- Local file system
- Other S3-compatible services
📋 Storage URL Format
The plugin supports the following URL format for S3:
s3://<bucket-name>/<prefix>/
Examples
s3://my-project-bucket/- Root of buckets3://my-project-bucket/data/- Data directorys3://my-project-bucket/users/john/- User-specific directory
🔍 Error Handling
The plugin provides clear error messages for common issues:
- Missing Configuration: When no storage URL is configured
- Invalid URL Format: When the storage URL doesn't match expected format
- Unsupported Backend: When trying to use an unsupported storage service
- Access Denied: When AWS credentials are invalid or insufficient
🛠️ Development
This plugin is part of the jbussdieker ecosystem. It integrates seamlessly with the jbussdieker CLI framework.
Project Structure
src/jbussdieker/storage/
├── __init__.py
├── cli.py # CLI interface and argument parsing
└── store.py # Storage backend implementations
Adding New Storage Backends
To add support for a new storage backend:
- Create a new store class in
store.py - Implement the required interface methods
- Update the CLI logic in
cli.pyto handle the new URL scheme - Add appropriate tests
📝 License
This project is licensed under MIT.
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
📚 Related
- jbussdieker - The main CLI framework
- boto3 - AWS SDK for Python
- AWS S3 - Amazon Simple Storage Service
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jbussdieker_storage-0.2.1.tar.gz.
File metadata
- Download URL: jbussdieker_storage-0.2.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b728b92fc488f3924de8a86d5a0baee097e2e12b2488bdb4d611f73388894aa0
|
|
| MD5 |
f45e64d765cb46012a2f0d9227319594
|
|
| BLAKE2b-256 |
9318c942b18ab3a13fa75663aa3af4772c8e25b9c16e520c6d5a5ec2b2a92693
|
File details
Details for the file jbussdieker_storage-0.2.1-py3-none-any.whl.
File metadata
- Download URL: jbussdieker_storage-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e16aadceceb9f19f0c32c48f9274924c02a4528e7669b59d708b6ed2e42a2b37
|
|
| MD5 |
b1bdc464cda3f4ba707c511ee980e9a9
|
|
| BLAKE2b-256 |
a7cfa5d10e2241b55780bea1306c68cacc8917c8eef473388691a81a8a1d745a
|