All versions 1.0.0 and up support Python 3 only! If you need Python 2 support, check out the following:
In the early days
gopy was fairly limited in it's ability to track object allocation across the border of Go and Python.
As a result, our implementation is fairly naive- we only pass primitive types from Go to Python (nothing that comes by reference).
Session are managed entirely on the Go side and identified with an integer- here are a few function signatures to demonstrate:
NewRPCSessionV2c(hostname string, port int, community string, timeout, retries int) uint64
RPCConnect(sessionID uint64) error
RPCGet(sessionID uint64, oid string) (string, error)
RPCClose(sessionID uint64) error
The functions that return complex data do so in a special JSON-based format- at this point
gopy does it's magic and those functions are
made available to Python.
We then have
RPCSession abstraction on the Python side that pulls things together in a class for convenience (saving you need the to keep
track of the identifiers and handling deserialisation).
We're building for Python3 and we use a
python-config script for Python3 however we're using a
python.pc file from Python2.
I dunno why this has to be this way, but it's the only way I can get the C Python API GIL lock/unlock calls to be available to
So if you're wondering why Python2 still comes into it here and there- that's why. Doesn't seem to cause any problems.
pip install virtualenv
brew install pkg-config
Install (from PyPI)
python -m pip install gosnmp-python
virtualenv -p $(which python3) venv
pip install -r requirements-dev.txt
If you're deep in the grind and want to iterate faster, you can invoke:
This skips the setup (assuming you've already done that).
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.