
Security News
TC39 Advances 11 Proposals for Math Precision, Binary APIs, and More
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
DeepDesk is a framework designed for a common database across multiple applications.
It features the following submodules:
data: json file based database system with indexing, full text search, record templates, validation, navigation aliases and more!
from deepdesk import * root=data.Root('./root') template=root.Record( ... "template/user", ... { ... 'email':data.Index(data.Validate("", 'email'), "user/email"), ... 'profile':data.Key('profile/') ... }) template.hash = True template.version = 1 template.save()
By setting template.hash to True, we are telling deepdesk to include the hash and salt fields in records created from this template. These are automatically included if a password is set, but by doing this now we can use it later to display a password field for records that have a hash attribute.
As we might alter templates and need a history of changes for managing data updates, set version to 1 to enable versioning on the record.
We can now use this template to create a user. A trailing back slash ("/") on the key tells deepdesk that there is a template for this record and it will generate a uuid for the rest of the location.
user=root.Record("user/", {'email':"domino@@example.com"}) user['email'].isvalid False user['email'] = "domino.marama@example.com" user['email'].isvalid True user.password = "example.password" user.save()
Now we haved saved the user, we can find it from the "user/email" index.
indexfile = root.IndexFile("user/email") indexfile.lookup("domino.marama@example.com") 'user/ae4df406/f166/4a75/be34/c0742a029f24' test = root.Record('user/ae4df406/f166/4a75/be34/c0742a029f24') test.password == "another.password" False test.password == "example.password" True test.password <password._HashedPassword object at 0x7fa70467cb10> test.base 'template/user.0001' str(test) "{'email': Index(Validate('domino.marama@example.com', 'email'), 'user/email'), 'profile': Key('profile/')}"
As well as Index, there are Alias, Collect, Group, Search and Include field wrappers which you can use to help navigate the database.
root.init()
This imports schema.org to the database, check the code for the field wrappers used :-)
root.search("about") {'schema.org/AboutPage', 'schema.org/about'} root.browse("menu/schema.org") ['Data Type', 'Thing', 'Data Type.json', 'Thing.json'] root.browse("menu/schema.org/Data Type") ['Time.json', 'Text.json', 'Date.json', 'Number.json', 'Number', 'Date Time.json', 'Boolean.json', 'Text'] t = root.Record("menu/schema.org/Data Type/Time.json") t.key Key('schema.org/Time') t.fields.keys() dict_keys(['supertypes', 'ancestors', 'specific_properties', 'id', 'url', 'subtypes', 'properties', 'comment', 'comment_plain', 'label']) t['url'] 'http://schema.org/Time'
FAQs
Flexible data storage, with indexing, templates and validation
We found that DeepDesk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.