Keystore creation

The first step is to create a Keystore, which will be used to access any account to which it’s registered:

from vulcan import Keystore

keystore = Keystore.create()
# or with an explicitly passed device model
keystore = Keystore.create(device_model="Vulcan API")

The keystore is now ready to be registered in exchange for an Account, but it’s best to save it for later use:

with open("keystore.json", "w") as f:
    # use one of the options below:
    # write a formatted JSON representation
    # dump a dictionary as JSON to file (needs `json` import)
    json.dump(keystore.as_dict, f)

A once-saved keystore may be simply loaded back into an API-usable object:

with open("keystore.json") as f:
    # use one of the options below:
    # load from a file-like object
    keystore = Keystore.load(f)
    # load from a JSON string
    keystore = Keystore.load(
    # load from a dictionary (needs `json` import)
    keystore = Keystore.load(json.load(f))

The keystore is now ready for further usage.