External Python libraries

To add external libraries for using in the python rules, these are the steps:

Modify the docker-compose.override.yml:

x-shared-libs: &shared-libs:
environment:
PYTHONPATH: /opt/libs
volumes:
– python-libs:/opt/libs

services:
api:
<<: *shared-libs
celery:
<<: *shared-libs

volumes:
python-libs:

The above code makes sure a volume is added to hold the external libraries available to the (even future) containers, being mapped into /opt/libs.
Then, you can install whatever python package by:

docker exec -u 0 celery pip install pyrad

And upon successful installation, you can use it in your code:

@rule(…)
def rule_with_pyrad(…):
import pyrad

Would you like a hands-on session?

A couple times a week our in-house trainer is available for a private or group session. In this session we can cover our Slurp’it or Mock’it solution but also integrations with Netpicker, NetBox, Nautobot & Infrahub.

Yes, keep me informed

Connect with us on LinkedIn to stay updated on the latest happenings, news, and exciting developments at Slurp’it. Just click the button below to follow us and be a part of our professional network.

Newsletter