Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Flexible data storage, with indexing, templates and validation

Project Description

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

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':""})
>>> user['email'].isvalid
>>> user['email'] = ""
>>> user['email'].isvalid
>>> user.password = "example.password"

Now we haved saved the user, we can find it from the “user/email” index.

>>> indexfile = root.IndexFile("user/email")
>>> indexfile.lookup("")
>>> test = root.Record('user/ae4df406/f166/4a75/be34/c0742a029f24')
>>> test.password == "another.password"
>>> test.password == "example.password"
>>> test.password
<password._HashedPassword object at 0x7fa70467cb10>
>>> test.base
>>> str(test)
"{'email': Index(Validate('', '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 to the database, check the code for the field wrappers used :-)

{'', ''}
>>> root.browse("menu/")
['Data Type', 'Thing', 'Data Type.json', 'Thing.json']
>>> root.browse("menu/ Type")
['Time.json', 'Text.json', 'Date.json', 'Number.json', 'Number', 'Date Time.json', 'Boolean.json', 'Text']
>>> t = root.Record("menu/ Type/Time.json")
>>> t.key
>>> t.fields.keys()
dict_keys(['supertypes', 'ancestors', 'specific_properties', 'id', 'url', 'subtypes', 'properties', 'comment', 'comment_plain', 'label'])
>>> t['url']
Release History

Release History

This version
History Node


History Node


History Node


Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
DeepDesk-0.1.2.tar.gz (13.6 kB) Copy SHA256 Checksum SHA256 Source May 10, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting