stackvana / hook.io

Open-Source Microservice Hosting Platform
https://hook.io
Other
1.26k stars 117 forks source link

Adding Python modules #179

Open VerstandInvictus opened 8 years ago

VerstandInvictus commented 8 years ago

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.

Marak commented 8 years ago

@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.

VerstandInvictus commented 8 years ago

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!

Marak commented 8 years ago

@VerstandInvictus -

In the mean-time I try to run: pip install pushbullet.py

Is it working for you now?

Marak commented 8 years ago

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.

VerstandInvictus commented 8 years ago
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'])
VerstandInvictus commented 8 years ago

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)?

pyhedgehog commented 7 years ago

@VerstandInvictus, please join discussion important for python support.

jlumbroso commented 3 years ago

@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?