This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

A simple package to create data structures with defaultsob

Project Description

A simple package to create data structures with defaults and strict limitations of attributes/properties.

Features

class User(Defaults):
    __slots__ = [
       "name",
       "description",
       "an_attribte_with_no_default"
   ]
   """
   usef will use the 'name' attribute
   if the description attribute is not
   set at the time of object creation
   """
   description = usef('name')

user = User(name='Billy')
"""
.to_dict_clean method returns a
dictionary of attributes with values
"""
print(user.to_dict_clean())
{
   "name": "Billy",
   "description": "Billy"
}

user.description = "Something Else"
user.an_attribute_with_no_default = "Another"
print(user.to_dict_clean())
{
   "name": "Billy",
   "description": "Something Else"
   "an_attribute_with_no_default": "Another"
}


user2 = User(name="Billy", description="The Kid")
print(user2.to_dict_clean())
{
   "name": "Billy",
   "description": "The Kid"
}

History

0.1.0 (2015-01-11)

  • First release on PyPI.
Release History

Release History

This version
History Node

0.3.0

History Node

0.1.0

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
defaultsob-0.3.0.tar.gz (13.2 kB) Copy SHA256 Checksum SHA256 Source Oct 1, 2015

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