A simple file and photo repository.
Project description
Simple File Repository
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
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
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
Algorithm | Hash digest | |
---|---|---|
SHA256 |
7b43c0e70a61ffb59b44770351bd01a28bb4c3e9752ea28c6914d110bab8b5be
|
|
MD5 |
b43a6193924c247ade2285f6b073d3a1
|
|
BLAKE2b-256 |
8b8640dd2f8fe2950344040aa12d80635a3dbf9c16d39ada0a0cb36e30b02d38
|
Provenance
The following attestation bundles were made for simple_file_repository-0.11.0.tar.gz
:
Publisher:
publish.yml
on theirix/simple-file-repository
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
simple_file_repository-0.11.0.tar.gz
-
Subject digest:
7b43c0e70a61ffb59b44770351bd01a28bb4c3e9752ea28c6914d110bab8b5be
- Sigstore transparency entry: 202601760
- Sigstore integration time:
-
Permalink:
theirix/simple-file-repository@c650a1aca0d9ef4efc52f9c540f9e1b358b9486c
-
Branch / Tag:
refs/tags/v0.11.0
- Owner: https://github.com/theirix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@c650a1aca0d9ef4efc52f9c540f9e1b358b9486c
-
Trigger Event:
release
-
Statement type:
File details
Details for the file simple_file_repository-0.11.0-py3-none-any.whl
.
File metadata
- Download URL: simple_file_repository-0.11.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
21c8ed9ebd9942c1b782c5946b650a5ed4339c3afde5f618ad0576bf048d6051
|
|
MD5 |
d15a1d3aeb99a3e173a98b169c851a0e
|
|
BLAKE2b-256 |
82a9ecdb34a2bdc5287decf272fa45ecb8d6be3b37e1d75a6c697ea8857d8783
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1
-
Predicate type:
https://docs.pypi.org/attestations/publish/v1
-
Subject name:
simple_file_repository-0.11.0-py3-none-any.whl
-
Subject digest:
21c8ed9ebd9942c1b782c5946b650a5ed4339c3afde5f618ad0576bf048d6051
- Sigstore transparency entry: 202601767
- Sigstore integration time:
-
Permalink:
theirix/simple-file-repository@c650a1aca0d9ef4efc52f9c540f9e1b358b9486c
-
Branch / Tag:
refs/tags/v0.11.0
- Owner: https://github.com/theirix
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com
-
Runner Environment:
github-hosted
-
Publication workflow:
publish.yml@c650a1aca0d9ef4efc52f9c540f9e1b358b9486c
-
Trigger Event:
release
-
Statement type: