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

Hatch is an easy to use framework for loading extensions into Python applications. No really, it is:

import hatch

class DummyInterface(hatch.Interface):
    def method(self):
        pass

for instance in DummyInterace.instances():
    # Loop through all implementations of the interface that were
    # found in plugins
    print instance.method()

Or you can take this code out for a spin in your interactive interpreter:

>>>import hatch
>>>class IObserve(hatch.Interface):
...    @classmethod
...    def notify(cls):
...        cls.apply('notify')
...
>>>class SnippyObserver(object):
...    def notify(self):
...        print "Doesn't hatch have a better way to do this?"
...
>>>class CleverObserver(object):
...    def notify(self):
...        print "That's not the point..."
...
>>>hatch.add_internal_extension('__main__.IObserve', SnippyObserver)
>>>hatch.add_internal_extension('__main__.IObserve', CleverObserver)
>>>IObserve.notify()
Doesn't hatch have a better way to do this?
That's not the point

For curious ones, the observer pattern is supported natively:

>>>import hatch
>>>def winded_observer(arg):
...    print "Hey, I was 'observing' and I got this message:", arg

>>>def quiet_observer(arg):
...    print arg

>>>hatch.add_internal_extension('observer_hook', winded_observer)
>>>hatch.add_internal_extension('observer_hook', quiet_observer)
>>>notify = hatch.Observers('observer_hook')
>>>notify('foo')
Hey, I was 'observing' and I got this message: foo
foo

How does it find extensions?

That’s up to you. Hatch can load extensions from an internal source, a setuptools entry point, or any other source. Telling Hatch where to load extensions from is just as easy as everything else:

from hatch.entry_points import EpFinder

hatch.register_global_finder(EpFinder('/path/to/plugin/dir'))
# Or alternatively, to load plugins directly off sys.path:
hatch.register_global_finder(EpFinder())

Check out the Finders documentation for details on the different finders that you can use.

Got Questions?

You can contact me directly through xmpp (or email): te-je@geniphi.com. If you find a bug, use Github to file an issue (you’d really be helping me out).

Release History

Release History

0.9

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

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
hatch-0.9-py2.7.egg (23.6 kB) Copy SHA256 Checksum SHA256 2.7 Egg Jan 9, 2012
hatch-0.9.zip (18.6 kB) Copy SHA256 Checksum SHA256 Source Jan 9, 2012

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