Skip to main content
Help us improve Python packaging – donate today!

vault library.

Project Description



Chef style Databag Storage

Supports plain text and encrypted databags.

A data bag is an object with two properties:

* _id
* data

The _\_id_ represent the databag name and _data_ contains the data we want to store in the databag.


python sdist
pip install ./dist/vaultlib-0.0.1.tar.gz


pip install vaultlib



* add_databag()
* get_databag()
* delete_databag()
* list_databags()


* encrypt()
* decrypt()


* from_file()
* from_data()

##Library Usage

### Create encryption key

To encrypt a databag we need a key:

openssl genrsa -out my_key.pem 4096

### Initialize the Vault

couchdb_host = ''
couchdb_port = 6984
couchdb_database = 'databags'

vault = Vault('http', couchdb_host, couchdb_port, couchdb_database)

### Create a databag

databag_data = {
"foo": "bar",
"and": {
"foo": "bar"

databag_name = ""
databag = Databag(databag_name, databag_data)

### Encrypt databag (optional)

key_file = "mykey.pem"
pk = Key(filename=key_file).private

### Store databag in the Vault


### Retrieve data bag from the vault

databag_name = ""
databag = vault.get_databag(databag_name)

data =
id_ =

### Decrypt databag (optional)

key_file = "mykey.pem"
pk = Key(filename=key_file).private

data =
id_ =

### List all databags

for databag in vault.list_databags():

##Cli Usage

Required environment variables:

export VAULT_PROTOCOL=http
export VAULT_HOST=''
export VAULT_PORT=5984
export VAULT_DATABASE='vault'


vault-cli --help


usage: vault-cli [-h] [--databag DATABAG] [--key KEY] [cmd [cmd ...]]

Manage databags

positional arguments:
cmd [add, list, show]

optional arguments:
-h, --help show this help message and exit
--databag DATABAG specify .json databag
--key KEY specify encryption key

__Add databag__

vault-cli add --databag databag.json

vault-cli add --databag databag.json --key /my/path/key.pem

__List databag__

vault-cli list

__Show databag__

vault-cli show databag_name

vault-cli show databag_name --key /my/path/key.pem

__Delete databag__

vault-cli delete databag_name

## v0.0.1:
* super rought prototype (Initial release)

Release history Release notifications

This version
History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
vaultlib-0.0.1.tar.gz (5.0 kB) Copy SHA256 hash SHA256 Source None Aug 22, 2013

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page