FHIR Chat · Python help required · python

Stream: python

Topic: Python help required


view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:12):

I want to send some process notifications to Zulip. The Zulip people have told me to use https://github.com/zulip/python-zulip-api/blob/master/zulip/zulip/send.py#L3 but I don't know how to get that running on windows. I have Python, and I tell it to run that python code, and I get ModuleNotFound 'zulip' - presumably I have to do something but I don't know what...

view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:12):

python c:\tools\zulip-api\zulip\zulip\send.py

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:14):

It looks like you need the complete "zulip" package for this script to run (it imports that in line 31). So you either download the whole repo and configure it, or you install the package via PIP.

view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:15):

i ddi download the whole repo but I don't know what 'configure it' means, nor do I know what 'install the package via PIP

view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:15):

means. Which should I do?

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:15):

PIP is Python's preferred package manager, I'm sure you'll find tons of tutorials on how to get set up with it on Windows. I'd recommend trying that.

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:16):

Once you have PIP installed, you do pip install zulip and you're good to go.

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:16):

If you encounter something called virtualenv, set that up, too. This will set up mini environments contained in the directory you choose to, rather than install stuff systemwide.

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:18):

pip is already installed if you are using Python 2 >=2.7.9 or Python 3 >=3.4 downloaded from python.org or if you are working in a Virtual Environment created by virtualenv or pyvenv. Just make sure to upgrade pip.

view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:18):

awesome - thanks.

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:18):

^ says PIP

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:18):

https://pip.pypa.io/en/stable/installing/

view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:29):

ok all sorted nicely. My release batch files can now send zulip notifications

view this post on Zulip Pascal Pfiffner (Apr 26 2019 at 04:34):

That was quick :grinning_face_with_smiling_eyes:

view this post on Zulip Grahame Grieve (Apr 26 2019 at 04:44):

the pip piece was the missing bit. the Zulip part was very easy

view this post on Zulip Josh Mandel (May 02 2019 at 03:15):

Do you pack credentials in the public script, or ask users to enter their own api key?

view this post on Zulip Grahame Grieve (May 02 2019 at 16:51):

provide your own key - there's a file format for that - they've thought that through - it's very nice

view this post on Zulip Grahame Grieve (May 02 2019 at 16:52):

you download the file from your settings. Sweet


Last updated: Apr 12 2022 at 19:14 UTC