hook.io
hook.io copied to clipboard
Adding Python modules
If one wanted to add a non-default Python module for access within Hook.io (in particular, I was thinking of "pip install pushbullet.py"), how would one go about structuring that pull request? I don't see anywhere obvious within the project structure to do so, apologies if I am being dense.
@VerstandInvictus Not at all.
The code responsible for package installations is available at: https://github.com/bigcompany/hpm
You'd want to add pip
support to that project with a pull request.
hook.io then communicates with hpm
over the network to manage package installations.
Ah ha. Okay, that seems like it is well beyond my abilities at present, but I'll give it a longer glance later when I have time and see if it might be something I can pick up. Thanks for the info!
@VerstandInvictus -
In the mean-time I try to run: pip install pushbullet.py
Is it working for you now?
If it's not working, could you send me the hook you are trying to run?
I can experiment with the package installation a bit and see if I can get pushbullet.py
working in the chroot.
Traceback (most recent call last):
File "/bin/run-hook-python", line 26, in <module>
exec code
File "<string>", line 1, in <module>
File "<string>", line 2, in <module>
ImportError: No module named pushbullet
I didn't actually intend to use this right away, so it's no rush, but the hook I'm using that gets that error is:
import pprint
from pushbullet import Pushbullet
print "Hello, this is a Python script."
print "Hook['params'] is populated with request parameters"
pprint.pprint(Hook['params'])
Side note: Currently, in Python, is there any way to access a) the JSON body of a POST request sent to a hook b) the Hook.log (for writing)?
@VerstandInvictus, please join discussion important for python support.
@Marak @pyhedgehog @VerstandInvictus I am looking into using hook.io for Python development. But after going through the website, I can't find any information on installing non-standard Python packages. Is that not possible?