Skip to main content

Flexible, extensible Python data structures for general usage

Project description

Flexible, extensible Python data structures for general usage. Get data in and out, reliably, without boilerplate and with speed!

middle stands on the shoulders of attrs and aims to be as simple as possible to get data from complex objects to Python primitives and vice-versa, with validators, converters and a lot of sugar! middle can be used with your preferred web framework, background job application, configuration parsing and many others!

middle is flexible enough to understand Enum, nested models and a large variety of types declared on the typing Python module out of the box. Also, you can extend it to your own classes!

TODO

  • Get 100% (or closer) in code coverage;

  • Alias options to populate classes;

  • Read-only and write-only fields;

  • Better error handling (almost everywhere);

  • If possible, fine grain the converters, so a str input value of {} doesn’t end up as str({});

  • Get date and datetime converters to be customizable, instead of an if isinstance statement;

  • Lots of documentation;

  • More benchmarks;

  • Support more types (provided in the Python standard library), if possible;

  • Implement more validators and a registerable for more metadata options;

Documentation

https://middle.readthedocs.io/

Inspiration and Thanks

I really got inspired to create this library by observing a lot of other libraries and tools, specially:

  • attrs: how such a simple library can be such flexible, extendable and fast?

  • cattrs: for its speed on creating attrs instances from dicts and to instances again;

  • pydantic: for such pythonic and beautiful approach on creating classes using typing hints;

  • mashmallow: it is one of the most feature rich modelling APIs I’ve seen;

  • apistar: it’s almost magical!

  • Sanic: “Gotta go fast!

License

middle is free software distributed under the MIT license.

Changelog

0.1.0 (2018-06-21)

  • First release on PyPI.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

middle-0.1.0-py2.py3-none-any.whl (9.5 kB view hashes)

Uploaded Python 2 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