This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Let me check my pockets…

The Pockets library pulls together all the Python helper functions I’ve found useful over the years.

If you’ve worked on a project that exports an API and accesses a data store, you’ve probably seen some code that looks like this:

# Receive a data type with underscores from some API
data_type = 'user_preference'

# Convert underscored data type to CamelCase to match the data model
model_name = camel(data_type)

# Resolve the model name into a model class
model_class = resolve(model_name, modules=["webapp.model.admin",
                                           "webapp.model.user",
                                           "webapp.model.businesslogic"]

# Instantiate the model class and do stuff with the instance...
instance = model_class()

There’s an impedance mismatch any time you work with two different frameworks; especially when you want to update your back-end while maintaining legacy compatibility with an external API.

Pockets is full of highly tested, well maintained functions that help bridge the gap. Here are just a few examples…

Convert underscore_separated string to CamelCase

>>> from pockets import camel
>>> camel("xml_http_request", upper_segments=[1])
'XmlHTTPRequest'

Convert CamelCase string to underscore_separated

>>> from pockets import uncamel
>>> uncamel("XmlHTTPRequest")
'xml_http_request'

Resolve a string into an object

>>> from pockets import resolve
>>> resolve("calendar.TextCalendar")
<class 'calendar.TextCalendar'>

Peek ahead iterator

>>> from pockets import peek_iter
>>> p = peek_iter(["a", "b", "c", "d", "e"])
>>> p.peek()
'a'
>>> p.next()
'a'
>>> p.peek(3)
['b', 'c', 'd']

Downloads and Docs

Full documentation is available on Read the Docs.

Built packages are available on PyPI.

Source code is available on GitHub. Feel free to:

  • Create an issue to request a feature or a report a bug.
  • Fork the repository and make changes to the master branch for next release.
  • Send a pull request and pester the maintainer until it’s merged. Make sure to add yourself to AUTHORS and update CHANGES.

Build Status

Release History

Release History

0.3

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.2.4

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.2.3

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.2.2

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.2.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

0.2

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

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pockets-0.3-py2.py3-none-any.whl (60.2 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Nov 17, 2015
pockets-0.3.tar.gz (20.4 kB) Copy SHA256 Checksum SHA256 Source Nov 17, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development 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