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.2.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.2-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: persistentobjects-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 85a6874bc32990661248da95d1e7db5fc8a05f8f8ab20414861f883926e53319
MD5 d0a032a30d0722594572976703e86a1a
BLAKE2b-256 e7250e5092fc9daaa107170ade2d82780dfbc1448a6052ea0d0118a26dfca3cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for persistentobjects-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 abd17d8a132ea7a71bb001b911fcceb7ff7d2aff240f119bf886530ac1560be2
MD5 342f57f93e136e3913815ef742ad0ae5
BLAKE2b-256 95d45a1420f22d4893e18fc7ea51c08bac2a923d09e61e225375694ad17e9fef

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