Skip to main content

Manages storage of images and other files, with metadata. Also offers an HTTP API done on Pyramid.

Project description

Scope

keepluggable is an open source, (MIT licensed), highly configurable Python library to manage storage of images and other documents (any kind of file, really), with metadata.

The documentation is at http://docs.nando.audio/keepluggable/latest/

The file metadata can be stored in a different place than the file payload. This is recommended because many operations, such as listing files, do not involve actual file content, so you should avoid loading it. Also, payloads should be optimized for serving and metadata should be optimized for querying.

For file payloads, we currently have implemented one backend that stores them in Amazon S3. There is also a very simple backend that stores files in the local filesystem (useful during development).

For (optionally) storing the metadata we currently provide a base SQLAlchemy backend for you to subclass.

In both cases, you can easily write other storage backends.

Using this library you can more easily have your user upload images (or any kind of file) and enter metadata about them, such as name, description, date, place, alt text, title attribute etc.

Some of the metadata is automatically found, such as file size, mime type, image size, aspect ratio, MD5 checksum etc.

The code is highly decoupled so you can tweak the behaviour easily.

The business rules are implemented in a separate layer (isolated from any of the storage strategies and any UI), called an “action” layer. (This is commonly known as a “service” layer, but we call it “action”.) This makes it possible for us to have any storage backends and use any web frameworks or other UI frameworks.

Each application has its own business rules, therefore it is likely that you will subclass the provided action layer to tweak the workflow for your purposes.

One such “action” is the pluggable policy for uploaded image treatment. For instance, the default policy converts the original uploaded image to the JPEG format (so it will never store an unecessarily large BMP), optionally stores the original image in whatever size it is, then creates configurable smaller versions of it.

Some cameras do not rotate the photo, they just add orientation metadata to the image file, so keepluggable rotates it for you, before creating the thumbnails.

Get started with keepluggable!

Collaboration

We want your help. We are open to feature requests, suggestions, bug reports and pull requests, in reverse order of openness.

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

keepluggable-0.5.0.tar.gz (18.7 kB view details)

Uploaded Source

Built Distribution

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

keepluggable-0.5.0-py2.py3-none-any.whl (26.0 kB view details)

Uploaded Python 2Python 3

File details

Details for the file keepluggable-0.5.0.tar.gz.

File metadata

  • Download URL: keepluggable-0.5.0.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for keepluggable-0.5.0.tar.gz
Algorithm Hash digest
SHA256 2530c7a13cfb8a33de3c67c9765a3693acdff97fd0f15403a926bc78c1af810e
MD5 47470eca43b9ed1cc2129153df17c217
BLAKE2b-256 e09e5e065b6dc9e2188014b84285e652922fa49e3ec4c3988bb6c27c1c5dd5c9

See more details on using hashes here.

File details

Details for the file keepluggable-0.5.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for keepluggable-0.5.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f306b5956dc5edce307e134807fa9825bb3a57a1d9cb400eec5f6dfd6b1f1635
MD5 328018aca3a1105d6c8763fc38ec4a5e
BLAKE2b-256 45d6791f37188e73732760bc2d5a8496ba480a92e299a2f15a5d18d83f4113ce

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