2

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
Alex
  • 4,316
  • 2
  • 24
  • 28
Keefer
  • 59
  • 1
  • 3
  • 8

1 Answers1

3

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

harshil9968
  • 3,254
  • 1
  • 16
  • 26
  • Do you by chance know if where I could get the documentation for Python syntax? I wasn't seeing it on their github page anywhere. – Keefer Nov 23 '16 at 13:50
  • No, I tried to find it but was unable to get it. You can try using IPython and it will let you know all possible functions using key. – harshil9968 Nov 23 '16 at 13:53
  • @Keefer @harshil9968 If any of you got it working, can you please share an example code for `credstash.getSecret()` – azhar22k Oct 04 '18 at 06:03
  • @itz-azhar see here: https://github.com/fugue/credstash/blob/c43f5dcfde1348df639cb33d78dc1beb267ed582/credstash.py#L468 credstash.getSecret("", "", "", "", <{"context-key": "context-value"}>) – patm Jan 08 '19 at 20:18