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

Cobble is a Python library that allows easy creation of data objects, including implementations of common methods such as __eq__ and __repr__.

Examples

import cobble

@cobble.data
class Song(object):
    name = cobble.field()
    artist = cobble.field()
    album = cobble.field(default=None)


song = Song("MFEO", artist="Jack's Mannequin")

print(song) # Prints "Song(name='MFEO', artist="Jack's Mannequin", album=None)"
class Expression(object):
    pass

@cobble.data
class Literal(Expression):
    value = cobble.field()

@cobble.data
class Add(Expression):
    left = cobble.field()
    right = cobble.field()

class Evaluator(cobble.visitor(Expression)):
    def visit_literal(self, literal):
        return literal.value

    def visit_add(self, add):
        return self.visit(add.left) + self.visit(add.right)

Evaluator().visit(Add(Literal(2), Literal(4))) # 6
class Expression(object):
    pass

@cobble.visitable
class Literal(Expression):
    def __init__(self, value):
        self.value = value

@cobble.visitable
class Add(Expression):
    def __init__(self, left, right):
        self.left = left
        self.right = right

class Evaluator(cobble.visitor(Expression)):
    def visit_literal(self, literal):
        return literal.value

    def visit_add(self, add):
        return self.visit(add.left) + self.visit(add.right)

Evaluator().visit(Add(Literal(2), Literal(4))) # 6

License

2-Clause BSD

Release History

Release History

0.1.1

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

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
cobble-0.1.1.tar.gz (11.7 kB) Copy SHA256 Checksum SHA256 Source Aug 30, 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