Keefer Keefer - 17 days ago 8
Python Question

Using credstash in Python

I've installed credstash on my computer. I'm able to use commands like "credstash get [credential]" while in the command prompt.

However, when in a python interpreter, after I use "import credstash" I am getting syntax errors when attempting to use the "credstash get [credential]" command:

>>> import credstash
>>> credstash get credstash
File "<stdin>", line 1
credstash get credstash
^
SyntaxError: invalid syntax

Answer

That syntax is for command line, for python you should use credstash.getAllSecrets() or credstash.getSecret()