These libraries have been developed as part of SVNPlace.
Deep convert a dictionary into objects with attributes.
Unlike AttrDict, this is a conversion, instead of live.
Evaluate a python expression safely. Safely here means:
Take a string and substtute f-string-like sections using safeeval.
Deeply merge a dictionary into another deep structure which may include lists.
a = {
'one': 'hello',
'two': [
1,
{
'three': 'sunny',
},
'bother',
],
'four': 'houses',
}
b = {
'two':{
1: {
'three': 'rainy',
}
}
}
c = deep_updated(a, b) gives...
c = {
'one': 'hello',
'two': [
1,
{
'three': 'rainy',
},
'bother',
],
'four': 'houses',
}
Deeply safesubst a dictionary.
Mimic another object to allow additions without affecting the original, but changes to the original to affect the original. The mimicing is good enough, for example, for Djando's db.models.model to be fooled.
Build objects from a dict, allowing more flexibility in object preparation than only __init__
kwargs.
Add your api to a Django website. These were the goals:
additional, unplanned benefits:
This is the site-side library. Add this as an application to your Django website, tie in the automatically generated views, create your api methods, and you're good to go.
Follow up by adding a UI for your users to manage their policies, roles and keys and your site's API acquires the sophistication of AWS.
This is the client-side library. It can be used for your site as is, or wrapped to create a custom API.