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 = Str()

    first_name = Str()

    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.

Source Distribution

atom-0.6.0.tar.gz (118.0 kB view hashes)

Uploaded Source

Built Distributions

atom-0.6.0-cp39-cp39-win_amd64.whl (111.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

atom-0.6.0-cp39-cp39-win32.whl (97.0 kB view hashes)

Uploaded CPython 3.9 Windows x86

atom-0.6.0-cp39-cp39-manylinux2010_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

atom-0.6.0-cp39-cp39-manylinux2010_i686.whl (1.5 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

atom-0.6.0-cp39-cp39-macosx_10_9_x86_64.whl (127.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

atom-0.6.0-cp38-cp38-win_amd64.whl (112.0 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

atom-0.6.0-cp38-cp38-win32.whl (97.1 kB view hashes)

Uploaded CPython 3.8 Windows x86

atom-0.6.0-cp38-cp38-manylinux2010_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

atom-0.6.0-cp38-cp38-manylinux2010_i686.whl (1.5 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

atom-0.6.0-cp38-cp38-macosx_10_9_x86_64.whl (127.4 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

atom-0.6.0-cp37-cp37m-win_amd64.whl (111.4 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

atom-0.6.0-cp37-cp37m-win32.whl (101.2 kB view hashes)

Uploaded CPython 3.7m Windows x86

atom-0.6.0-cp37-cp37m-manylinux2010_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

atom-0.6.0-cp37-cp37m-manylinux2010_i686.whl (1.5 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

atom-0.6.0-cp37-cp37m-macosx_10_9_x86_64.whl (124.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

atom-0.6.0-cp36-cp36m-win_amd64.whl (111.4 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

atom-0.6.0-cp36-cp36m-win32.whl (101.2 kB view hashes)

Uploaded CPython 3.6m Windows x86

atom-0.6.0-cp36-cp36m-manylinux2010_x86_64.whl (1.5 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

atom-0.6.0-cp36-cp36m-manylinux2010_i686.whl (1.5 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

atom-0.6.0-cp36-cp36m-macosx_10_9_x86_64.whl (124.1 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page