This release is a pre-release and may not be stable for production use.
py-rfc2397
- Author:
Jacob Oscarson
- Contact email:
Quick implementation of RFC2397 in Python, MIT Licenced. RFC2397 is also known as the ‘data url’ format used to embed image data directly into CSS stylesheets among other things.
The rationale behind this package is described in this blogpost.
Requirements
Python 2.6 and 2.7, not tested on Python 3+ (yet).
Installation
The latest version can be found on PyPI. The recommended way to install is via pip:
$ pip install rfc2397
An executable named rfc2397 is then placed in the python environment that pip installs to.
As an alternate method, it’s also possible to copy the rfc2397.py file to any location and run the script stand-alone.
Usage
Just give rfc2397 a path to an image file. rfc2397 uses Python’s mimetypes module to determine what MIME-type a file has (N.B: the program won’t stop you from encoding something too large/an unsupported mime-type).
$ rfc2397 dot.png # <- your image path data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAADElEQVQImWP4o8oAAANCASIYayeeAAAAAElFTkSuQmCC
Changes
1.0b2 (2012-01-03)
Uses mimetypes module instead of primitive ad-hoc file name extension guessing.
rfc2397 is now a single-file module, simplifies package and makes it possible to just copy the rfc2397.py file to an arbitrary location as an alternate installation method.
Better QA by using tox.
1.0b1 (2011-06-16)
Concept and initial coding.
Metadata
Release files for rfc2397 1.0b2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rfc2397-1.0b2.tar.gz | 2.9 kB | Without provenance | Details for rfc2397-1.0b2.tar.gz |
Release files / rfc2397-1.0b2.tar.gz
| Download URL | rfc2397-1.0b2.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e321ae83b6c7d0a9ecd13aafa7cad75c5d30e3d51e325a4c22ee1a283ad5edc4
|
|
BLAKE2b-256 checksum How to use checksums |
27e77ab5fb4bd190fcdcae2573c5c7d566085530dee6f5c9ad03eb13fc07e080
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for rfc2397 1.0b2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.