Skip to main content
Donate to the Python Software Foundation or Purchase a PyCharm License to Benefit the PSF! Donate Now

Memory efficient Python objects

Project description

https://travis-ci.org/nucleic/atom.svg?branch=master https://codecov.io/gh/nucleic/atom/branch/master/graph/badge.svg

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


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.3-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 (200.7 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-cp27-cp27m-manylinux1_i686.whl (129.2 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-cp27-cp27m-manylinux1_x86_64.whl (132.6 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-cp27-cp27mu-manylinux1_i686.whl (129.2 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-cp27-cp27mu-manylinux1_x86_64.whl (132.6 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-cp27-none-win32.whl (94.7 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-cp27-none-win_amd64.whl (111.5 kB) Copy SHA256 hash SHA256 Wheel cp27
atom-0.4.3-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 (198.6 kB) Copy SHA256 hash SHA256 Wheel cp34
atom-0.4.3-cp34-cp34m-manylinux1_i686.whl (129.0 kB) Copy SHA256 hash SHA256 Wheel cp34
atom-0.4.3-cp34-cp34m-manylinux1_x86_64.whl (132.8 kB) Copy SHA256 hash SHA256 Wheel cp34
atom-0.4.3-cp34-none-win32.whl (95.5 kB) Copy SHA256 hash SHA256 Wheel cp34
atom-0.4.3-cp34-none-win_amd64.whl (105.4 kB) Copy SHA256 hash SHA256 Wheel cp34
atom-0.4.3-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 (198.7 kB) Copy SHA256 hash SHA256 Wheel cp35
atom-0.4.3-cp35-cp35m-manylinux1_i686.whl (129.1 kB) Copy SHA256 hash SHA256 Wheel cp35
atom-0.4.3-cp35-cp35m-manylinux1_x86_64.whl (132.8 kB) Copy SHA256 hash SHA256 Wheel cp35
atom-0.4.3-cp35-none-win32.whl (98.8 kB) Copy SHA256 hash SHA256 Wheel cp35
atom-0.4.3-cp35-none-win_amd64.whl (111.0 kB) Copy SHA256 hash SHA256 Wheel cp35
atom-0.4.3-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 (198.7 kB) Copy SHA256 hash SHA256 Wheel cp36
atom-0.4.3-cp36-cp36m-manylinux1_i686.whl (129.1 kB) Copy SHA256 hash SHA256 Wheel cp36
atom-0.4.3-cp36-cp36m-manylinux1_x86_64.whl (132.8 kB) Copy SHA256 hash SHA256 Wheel cp36
atom-0.4.3-cp36-none-win32.whl (98.8 kB) Copy SHA256 hash SHA256 Wheel cp36
atom-0.4.3-cp36-none-win_amd64.whl (111.0 kB) Copy SHA256 hash SHA256 Wheel cp36
atom-0.4.3-cp37-cp37m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (199.2 kB) Copy SHA256 hash SHA256 Wheel cp37
atom-0.4.3-cp37-cp37m-manylinux1_i686.whl (129.5 kB) Copy SHA256 hash SHA256 Wheel cp37
atom-0.4.3-cp37-cp37m-manylinux1_x86_64.whl (133.0 kB) Copy SHA256 hash SHA256 Wheel cp37
atom-0.4.3-cp37-none-win32.whl (98.8 kB) Copy SHA256 hash SHA256 Wheel cp37
atom-0.4.3-cp37-none-win_amd64.whl (111.2 kB) Copy SHA256 hash SHA256 Wheel cp37
atom-0.4.3.tar.gz (97.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

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