Skip to main content

A simple file and photo repository.

Project description

Simple File Repository

Build PyPI

A simple file and photo repository. Underlying storage is a filesystem or a S3-compatible service.

Installation

pip install simple_file_repository

Usage

File storage

    >>> import uuid
    >>> from simple_file_repository import FileStorage
    >>> storage = FileStorage(storage_directory='/tmp/repo', database='cats')
    >>> storage.store(b'content')
    UUID('72fc4a76-1ab7-4d60-9f6a-94aa0ad45b5b')
    >>> storage.get(uuid.UUID(hex='72fc4a76-1ab7-4d60-9f6a-94aa0ad45b5b'))
    b'content'
    >>> list(storage.list())
    ['72fc4a76-1ab7-4d60-9f6a-94aa0ad45b5b']

Photo storage using S3

from simple_file_repository import PhotoStorages

storages = PhotoStorages()

storages.init_app(names=['cats', 'dogs'],
                  storage_directory='/tmp/repo',
                  names_for_s3=['cats'],
                  imagemagick_convert='/usr/bin/convert',
                  access_key_id='',
                  secret_access_key='',
                  region='us-east-1', bucket='my-s3-bucket')

storages['cats'].store(b'image')

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

simple_file_repository-0.11.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

simple_file_repository-0.11.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

Details for the file simple_file_repository-0.11.0.tar.gz.

File metadata

  • Download URL: simple_file_repository-0.11.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for simple_file_repository-0.11.0.tar.gz
Algorithm Hash digest
SHA256 7b43c0e70a61ffb59b44770351bd01a28bb4c3e9752ea28c6914d110bab8b5be
MD5 b43a6193924c247ade2285f6b073d3a1
BLAKE2b-256 8b8640dd2f8fe2950344040aa12d80635a3dbf9c16d39ada0a0cb36e30b02d38

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_file_repository-0.11.0.tar.gz:

Publisher: publish.yml on theirix/simple-file-repository

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file simple_file_repository-0.11.0-py3-none-any.whl.

File metadata

File hashes

Hashes for simple_file_repository-0.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 21c8ed9ebd9942c1b782c5946b650a5ed4339c3afde5f618ad0576bf048d6051
MD5 d15a1d3aeb99a3e173a98b169c851a0e
BLAKE2b-256 82a9ecdb34a2bdc5287decf272fa45ecb8d6be3b37e1d75a6c697ea8857d8783

See more details on using hashes here.

Provenance

The following attestation bundles were made for simple_file_repository-0.11.0-py3-none-any.whl:

Publisher: publish.yml on theirix/simple-file-repository

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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