r/Python•
mpdehaan

classforge - a new minimal OO & serialization framework for python3

I Made This

I found myself wanting a better object layer for non-web projects, and recently created classforge.

IMHO, there's way too much boilerplate in standard python object programming and this leads to harder to read code and greater chance of errors. By making declarations stand out more, we can have more maintainable code.

Here's the library:

https://classforge.io/index.html

https://classforge.io/usage.html

Clearly, there are other ways to implement this (and some other library options), including annotations and larger libraries, though I prefer this primarily because it is more explicit and wanted something I could more easily extend as fields gain properties.

Subclasses for different types of fields will be coming in a future release.

The implementation is very minimal, at ~209 lines of code for the current release.

classforge is available on pypi now, "pip3 install classforge".

You can also follow "@classforge" on twitter.

Posted May 4, 2020, 3:37 PM UTC

10

No comments yet

Nobody commented on this post, or the comments weren't captured.