Initialize registry

data-transport uses a registry to store database authentication information and referenced by a human readable label.

Initialize Registry

The registry can be initialized through the command line (CLI) or in code.
A folder will be created in your home folder $HOME/.data-transport/transport-registry.json

Command line (CLI)

# creates folders and files needed
$ transport registry reset < your email >

Create a file http-auth.json and it should contain the following

{
"provider":"http", "url":"https://raw.githubusercontent.com/codeforamerica/ohana-api/master/data/sample-csv/addresses.csv"
}

Add the created file http-auth.json to the registry under the label address-db
$ transport registry --add address-db http-auth.json

In code

import transport
import io
import json
#
# transport.registry.exists()
_email = 'steve@the-phi.com'
transport.registry.init(_email)

#
# Adding the entry to the registry now that is initialized
_authStr = {"provider":"http", "url":"https://raw.githubusercontent.com/codeforamerica/ohana-api/master/data/sample-csv/addresses.csv" }
file = io.StringIO(json.dumps(_authStr))
transport.registry.set('address-db',file)