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
Metadata
Release files for jbussdieker-storage 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jbussdieker_storage-0.2.1.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| jbussdieker_storage-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.9 kB
Release files / jbussdieker_storage-0.2.1.tar.gz
| Download URL | jbussdieker_storage-0.2.1.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b728b92fc488f3924de8a86d5a0baee097e2e12b2488bdb4d611f73388894aa0
|
|
BLAKE2b-256 checksum How to use checksums |
9318c942b18ab3a13fa75663aa3af4772c8e25b9c16e520c6d5a5ec2b2a92693
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / jbussdieker_storage-0.2.1-py3-none-any.whl
| Download URL | jbussdieker_storage-0.2.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e16aadceceb9f19f0c32c48f9274924c02a4528e7669b59d708b6ed2e42a2b37
|
|
BLAKE2b-256 checksum How to use checksums |
a7cfa5d10e2241b55780bea1306c68cacc8917c8eef473388691a81a8a1d745a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|