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 hashes)

Uploaded Source

Built Distribution

flex_object-1.0.0-py3-none-any.whl (5.5 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