Skip to content

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

License

Notifications You must be signed in to change notification settings

davidsantana06/flex-object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages