Skip to main content

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

  1. Configuration Validation: Checks for a valid storage URL in your jbussdieker configuration
  2. URL Parsing: Extracts bucket name and prefix from the S3 URL
  3. Storage Connection: Establishes connection to AWS S3 using boto3
  4. Directory Listing: Lists all subdirectories under the configured prefix
  5. 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 bucket
  • s3://my-project-bucket/data/ - Data directory
  • s3://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:

  1. Create a new store class in store.py
  2. Implement the required interface methods
  3. Update the CLI logic in cli.py to handle the new URL scheme
  4. Add appropriate tests

📝 License

This project is licensed under MIT.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📚 Related

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jbussdieker_storage-0.2.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jbussdieker_storage-0.2.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

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

Hashes for jbussdieker_storage-0.2.1.tar.gz
Algorithm Hash digest
SHA256 b728b92fc488f3924de8a86d5a0baee097e2e12b2488bdb4d611f73388894aa0
MD5 f45e64d765cb46012a2f0d9227319594
BLAKE2b-256 9318c942b18ab3a13fa75663aa3af4772c8e25b9c16e520c6d5a5ec2b2a92693

See more details on using hashes here.

File details

Details for the file jbussdieker_storage-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jbussdieker_storage-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e16aadceceb9f19f0c32c48f9274924c02a4528e7669b59d708b6ed2e42a2b37
MD5 b1bdc464cda3f4ba707c511ee980e9a9
BLAKE2b-256 a7cfa5d10e2241b55780bea1306c68cacc8917c8eef473388691a81a8a1d745a

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page