Keefer Keefer - 8 months ago 188
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 Source

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