Skip to main content

Store Python objects in a immutable manner and provide fast attribute lookup

Project description

Frozen is a container that:

  • makes internal object immutable;

  • supports dot notation access.

Example:

from frozen import freeze

person = {
    'name': 'Mike',
    'age': 17,
    'scores': {
        'math': [{
            'name': 'test 1',
            'score': 87,
            'sub_score': {
                'part 1': 25,
                'part 2': 22,
                'part 3': 40
            }
        }, {
            'name': 'test 2',
            'score': 92,
            'sub_score': {
                'part 1': 30,
                'part 2': 23,
                'part 3': 39
            }
        }]
    }
}

frozen = freeze(person)
print(frozen['scores.math.1.sub_score.part 3'])  # 39
print(frozen.scores.math[1].sub_score['part 3'])  # 39

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

frozen_box-0.0.1.tar.gz (6.0 kB view hashes)

Uploaded Source

Built Distribution

frozen_box-0.0.1-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

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