Skip to main content

JSON-backed attribute-persistent object with namespace support

Project description

This is a very simple lib that provides the PersistantObject class, which saves all its attributes to the given json file. Attributes are saved as soon as they are set.

[!IMPORTANT]

morphing actions like appending, inserting, extending, etc. will not automaticly save! so its recomended to create a temp var, then append to it and at the end set the PersistantObject attr to the temp var.

with namespace(NAME) seperate sub namespaces can be created inside the object.

Usage example:

from PersistantObject import PersistantObject

pobject = PersistantObject("save.json")

pobject.first_value = 10
pobject.second_value = "foo"

namespace = pobject.namespace("test_namespace")
namespace.third_value = [10, 5]

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

persistentobjects-0.1.3.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

persistentobjects-0.1.3-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file persistentobjects-0.1.3.tar.gz.

File metadata

  • Download URL: persistentobjects-0.1.3.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for persistentobjects-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2e0107a441886a2f3e0fefd42ce6f309d4dc6877618ffed7837c0420ec807e14
MD5 b36b8f086269f7c4111cc39016e532c9
BLAKE2b-256 59ad41890c38dba4f08ec8ffdcc6556ec74b28fcd7f98f85563bb3b1c8a0f53f

See more details on using hashes here.

File details

Details for the file persistentobjects-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for persistentobjects-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 032621506474cb4f48a79984efafccad56d17b1ef9e972a0d8e174559113bf78
MD5 f6688c21daf86811b643ac0bb543592b
BLAKE2b-256 19479393e96af717541d5c52890a77f784416f3c64c88758f45c6047a31e62bd

See more details on using hashes here.

Supported by

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