Skip to main content

Local file storage abstraction with content deduplication for MAESTRO

Project description

mmar-files

Local file storage abstraction with content deduplication for MAESTRO.

Installation

Base functionality (local/basic storage only):

pip install mmar-files

With optional S3 support:

pip install mmar-files[s3]

Testing

Unit Tests

Run unit tests (these use mocks and don't require external services):

make test
# or
uv run pytest

Integration Tests

Integration tests use MinIO (S3-compatible storage) via Docker to test real S3 functionality.

Quick start - Run everything:

make test-integration-full

This will:

  1. Start MinIO in Docker
  2. Wait for it to be ready
  3. Run integration tests
  4. Stop MinIO

Manual control:

# Start MinIO in background
make minio-up

# Run integration tests (MinIO must be running)
make test-integration

# View MinIO logs
make minio-logs

# Stop MinIO
make minio-down

MinIO credentials:

The integration tests can be configured via environment variables:

  • MINIO_ENDPOINT (default: http://localhost:9000)
  • MINIO_ACCESS_KEY (default: minioadmin)
  • MINIO_SECRET_KEY (default: minioadmin)

Assumed migration

Before:

from mmar_mapi import FileStorage, FileStorageAPI
from mmar_mimpl import SettingsModel

...
class Config(SettingsModel):
    files_dir: str = "/mnt/data/maestro/files"
...
config: Config = ...
file_storage: FileStorageAPI = FileStorage(config.files_dir)

After

from mmar_mimpl import SettingsModel

from mmar_files import FilesConfigDir, FileStorageAPI, create_file_storage

...
class Config(SettingsModel):
    files: FilesConfig = Field(default=FilesConfigDir(dir="/mnt/data/maestro/files"))
...
config: Config = ...
file_storage: FileStorageAPI = create_file_storage(config.files)

License

MIT

Project details


Download files

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

Source Distribution

mmar_files-1.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

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

mmar_files-1.1.1-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

Details for the file mmar_files-1.1.1.tar.gz.

File metadata

  • Download URL: mmar_files-1.1.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for mmar_files-1.1.1.tar.gz
Algorithm Hash digest
SHA256 65ba8a8d99ec7c3461ec0a4bd866381f995449d126c66e2bc732f95f3720d7cd
MD5 3ad95a7bce5a08b6771a410e28c0cf4b
BLAKE2b-256 ff090a3ea5224cb0487e14a29eae51c010202f3402db6cb6194979c0b2447261

See more details on using hashes here.

File details

Details for the file mmar_files-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: mmar_files-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.31

File hashes

Hashes for mmar_files-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cb586124ed7fa34336a7976a1eac4edf25cb4ed9601e753285185779935c0a90
MD5 024532aa8cf570bfc7e405f3cf08ee26
BLAKE2b-256 925c67935a6776838126c7bfc90a2589faab7a58f72f34e4d0b79ee1f1dcf22f

See more details on using hashes here.

Supported by

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