Coder Social home page Coder Social logo

py-rfc2397's Introduction

py-rfc2397

Author

Jacob Oscarson

Contact email

[email protected]

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.

py-rfc2397's People

Contributors

jacob414 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.