Skip to main content

FlexObject is a Python class that provides dynamic attribute management, runtime attribute addition/removal, JSON serialization, and JSON file/str reading.

Project description

FlexObject

The FlexObject redefines your Python programming experience with its versatile base class, offering an array of dynamic attribute management capabilities, seamless runtime attribute manipulation, effortless JSON serialization, and streamlined JSON file/string handling. This library serves as a cornerstone for simplified data interaction, catering to a wide spectrum of scenarios.

Note This project has been developed based on Python 3.6 or above.


Features

  1. Dynamic Attribute Management: Enjoy the freedom to effortlessly manage object attributes on-the-fly, enhancing adaptability to evolving requirements.
  2. Runtime Attribute Addition/Removal: Streamline your workflow by dynamically adding or removing attributes during execution, minimizing disruptions.
  3. JSON Serialization: Seamlessly transform object attributes into the JSON format, facilitating convenient storage, sharing, or communication with external systems.
  4. JSON File/String Reading: Effortlessly load object attributes from JSON files or strings, expediting data retrieval and utilization.

Usage

After incorporating FlexObject into your project, the usage will follow the steps outlined below.

from flex_object import FlexObject

# Create a FlexObject instance
flex_obj = FlexObject()

# Set attributes dynamically
flex_obj.set(name='David Santana', github='davidsantana06', age=21)

# Serialize attributes to JSON string
json_str = flex_obj.dumps_json()

# Deserialize attributes from JSON string
flex_obj.loads_json(json_str)

# Store attributes in a JSON file
flex_obj.dump_json('data.json')

# Load attributes from a JSON file
flex_obj.load_json('data.json')

License

This project adopts the MIT License, which allows you to use and make modifications to the code as you wish. The only thing I ask is that proper credit is given, acknowledging the effort and time I invested in building it.

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

flex-object-1.0.0.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

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

flex_object-1.0.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file flex-object-1.0.0.tar.gz.

File metadata

  • Download URL: flex-object-1.0.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for flex-object-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5971c5ea1287a6d64b902cb2010a59db2414067f6f7b485a622e7f1ae61ddd5f
MD5 c62ff77bfb3f936cfb4956b0da50988c
BLAKE2b-256 504507b2f534441133467f03d8ca5f2e35f54aa7a89b0c86087a7a1c7b84f352

See more details on using hashes here.

File details

Details for the file flex_object-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: flex_object-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.9.6 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/1.0.0 urllib3/1.26.18 tqdm/4.64.1 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.5 CPython/3.6.8

File hashes

Hashes for flex_object-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1a882f5a50b0857f25bd28c74ec63bc2d8392c05b2f2607d4a37cfbbc917e983
MD5 f24f8562aa46b6f03fc5bf2f2c8e4530
BLAKE2b-256 aecb0341c91ccc36c3850da53e1a59200a38441d694ec90342fa96e2c14ea706

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