Skip to main content

Memory efficient Python objects

Project description

https://travis-ci.org/nucleic/atom.svg?branch=master

Atom is a framework for creating memory efficient Python objects with enhanced features such as dynamic initialization, validation, and change notification for object attributes. It provides the default model binding behaviour for the Enaml UI framework.

Illustrative Example:

from atom.api import Atom, Unicode, Range, Bool, observe


class Person(Atom):
    """ A simple class representing a person object.

    """
    last_name = Unicode()

    first_name = Unicode()

    age = Range(low=0)

    debug = Bool(False)

    @observe('age')
    def debug_print(self, change):
        """ Prints out a debug message whenever the person's age changes.

        """
        if self.debug:
            templ = "{first} {last} is {age} years old."
            s = templ.format(
                first=self.first_name, last=self.last_name, age=self.age,
            )
            print(s)

    def _default_first_name(self):
        return 'John'


john = Person(last_name='Doe', age=42)
john.debug = True
john.age = 43  # prints message
john.age = 'forty three'   # raises TypeError

For version information, see the Revision History.

Project details


Release history Release notifications

This version
History Node

0.4.1

History Node

0.4.0

History Node

0.3.10

History Node

0.3.9

History Node

0.3.7

History Node

0.3.6

History Node

0.3.5

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
atom-0.4.1-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (192.6 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp27-cp27m-manylinux1_i686.whl (814.2 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp27-cp27m-manylinux1_x86_64.whl (853.6 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp27-cp27mu-manylinux1_i686.whl (814.1 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp27-cp27mu-manylinux1_x86_64.whl (853.5 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp27-none-win32.whl (91.7 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp27-none-win_amd64.whl (108.1 kB) Copy SHA256 hash SHA256 Wheel cp27 Mar 6, 2018
atom-0.4.1-cp34-cp34m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (190.5 kB) Copy SHA256 hash SHA256 Wheel cp34 Mar 6, 2018
atom-0.4.1-cp34-cp34m-manylinux1_i686.whl (835.5 kB) Copy SHA256 hash SHA256 Wheel cp34 Mar 6, 2018
atom-0.4.1-cp34-cp34m-manylinux1_x86_64.whl (877.8 kB) Copy SHA256 hash SHA256 Wheel cp34 Mar 6, 2018
atom-0.4.1-cp34-none-win32.whl (92.3 kB) Copy SHA256 hash SHA256 Wheel cp34 Mar 6, 2018
atom-0.4.1-cp34-none-win_amd64.whl (101.9 kB) Copy SHA256 hash SHA256 Wheel cp34 Mar 6, 2018
atom-0.4.1-cp35-cp35m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (190.6 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 6, 2018
atom-0.4.1-cp35-cp35m-manylinux1_i686.whl (837.6 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 6, 2018
atom-0.4.1-cp35-cp35m-manylinux1_x86_64.whl (879.2 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 6, 2018
atom-0.4.1-cp35-none-win32.whl (95.7 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 6, 2018
atom-0.4.1-cp35-none-win_amd64.whl (107.7 kB) Copy SHA256 hash SHA256 Wheel cp35 Mar 6, 2018
atom-0.4.1-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (190.6 kB) Copy SHA256 hash SHA256 Wheel cp36 Mar 6, 2018
atom-0.4.1-cp36-cp36m-manylinux1_i686.whl (837.7 kB) Copy SHA256 hash SHA256 Wheel cp36 Mar 6, 2018
atom-0.4.1-cp36-cp36m-manylinux1_x86_64.whl (879.2 kB) Copy SHA256 hash SHA256 Wheel cp36 Mar 6, 2018
atom-0.4.1-cp36-none-win32.whl (95.7 kB) Copy SHA256 hash SHA256 Wheel cp36 Mar 6, 2018
atom-0.4.1-cp36-none-win_amd64.whl (107.7 kB) Copy SHA256 hash SHA256 Wheel cp36 Mar 6, 2018
atom-0.4.1.tar.gz (65.1 kB) Copy SHA256 hash SHA256 Source None Jan 28, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page