This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Help us improve Python packaging - Donate today!
Project Description

Installation

Install the distribution from source:

$ python setup.py install

Or install with easy_install:

$ easy_install fnord.easycodec

Usage

This package can be used to easily create and register codecs.

Use the decorator encoder to create an encode-function:

>>> from fnord.easycodec import encoder
>>> @encoder("my_codec")
... def my_encode(message):
...     ...

(my_codec is the name of the codec.)

Use the decorator decoder to create a decode-function:

>>> from fnord.easycodec import decoder
>>> @decoder("my_codec")
... def my_decode(message):
...     ...

Use the factory CodecRegistration to create an object that can be returned by a codec’s search-function:

>>> from fnord.easycodec import CodecRegistration, AUTO
>>> registration = CodecRegistration(
...     "my_codec", my_encode, my_decode,
...     streamwriter=AUTO, streamreader=AUTO)

This factory takes the following parameters:

name:The name of the codec. Required.
encode:The encode-function. Required.
decode:The decode-function. Required.
incrementalencoder:
 The incremental encoder. Optional.
incrementaldecoder:
 The incremental decoder. Optional.
streamwriter:The stream-writer. Optional.
streamreader:The stream-reader. Optional.

If one of the optional parameters has the value AUTO assigned, an appropriate object will be generated and used.

Use the factory CodecSearch to create a search-function for a codec. The parameters are the same as for CodecRegistration:

>>> from fnord.easycodec import CodecSearch
>>> search = CodecSearch(
...     "my_codec", my_encode, my_decode,
...     streamwriter=AUTO, streamreader=AUTO)

This function can then be used to register the codec:

>>> import codecs
>>> codecs.register(search)

Contributors

Changelog

0.2 (2013-08-17)

  • Fixed parameters to constructor for exception UnicodeDecodeError [Bert Vanderbauwhede]

0.1 (2013-08-11)

  • Package created using templer [Bert Vanderbauwhede]
  • First implementation [Bert Vanderbauwhede]
Release History

Release History

0.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
fnord.easycodec-0.2.tar.gz (6.8 kB) Copy SHA256 Checksum SHA256 Source Aug 17, 2013

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting