Skip to main content

Memory efficient Python objects

Project description

https://github.com/nucleic/atom/workflows/Continuous%20Integration/badge.svg https://github.com/nucleic/atom/workflows/Documentation%20building/badge.svg https://codecov.io/gh/nucleic/atom/branch/master/graph/badge.svg Documentation Status

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.

Version 0.4.3 will be the last version to support Python 2. Moving forward support will be limited to Python 3.5+.

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.

Files for atom, version 0.5.2
Filename, size File type Python version Upload date Hashes
Filename, size atom-0.5.2-cp36-cp36m-macosx_10_9_x86_64.whl (127.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size atom-0.5.2-cp36-cp36m-manylinux1_i686.whl (134.8 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size atom-0.5.2-cp36-cp36m-manylinux1_x86_64.whl (139.0 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size atom-0.5.2-cp36-none-win32.whl (100.9 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size atom-0.5.2-cp36-none-win_amd64.whl (113.1 kB) File type Wheel Python version cp36 Upload date Hashes View
Filename, size atom-0.5.2-cp37-cp37m-macosx_10_9_x86_64.whl (127.3 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size atom-0.5.2-cp37-cp37m-manylinux1_i686.whl (135.0 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size atom-0.5.2-cp37-cp37m-manylinux1_x86_64.whl (139.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size atom-0.5.2-cp37-none-win32.whl (101.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size atom-0.5.2-cp37-none-win_amd64.whl (113.2 kB) File type Wheel Python version cp37 Upload date Hashes View
Filename, size atom-0.5.2-cp38-cp38-macosx_10_9_x86_64.whl (130.2 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size atom-0.5.2-cp38-cp38-manylinux1_i686.whl (136.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size atom-0.5.2-cp38-cp38-manylinux1_x86_64.whl (140.4 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size atom-0.5.2-cp38-none-win32.whl (95.9 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size atom-0.5.2-cp38-none-win_amd64.whl (111.4 kB) File type Wheel Python version cp38 Upload date Hashes View
Filename, size atom-0.5.2.tar.gz (112.0 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page