pachctl
is the command-line tool you use
to interact with a Pachyderm cluster in your terminal.
However, external applications might need to
interact with Pachyderm directly through our APIs.
In this case, Pachyderm offers language specific SDKs in Go and Python.
Go Client #
The Pachyderm team officially supports the Go client. It implements most of the functionalities provided with the pachctl
CLI tool.
Generate And Serve The godocs Locally #
Golang’s package (godoc), installed by default by the Go installer, can generate the Go client’s documentation from the go code.
To generate the docs:
Set your GOPATH:
export PATH=$(go env GOPATH)/bin:$PATH
In Pachyderm’s root directory, start the godocs server:
go run golang.org/x/tools/cmd/godoc -http=:6060 -goroot="<your go root directory - for example: /Users/yourusername/pachyderm>"
See https://pkg.go.dev/golang.org/x/tools/cmd/godoc for the complete list of flags available.
In your favorite browser, run
localhost:6060/pkg/
A compatible version of gRPC
is needed when using the Go client. You can identify the compatible version by searching for the version number next to replace google.golang.org/grpc => google.golang.org/grpc
in https://github.com/pachyderm/pachyderm/blob/master/go.mod then:
go get google.golang.org/grpc
cd $GOPATH/src/google.golang.org/grpc
git checkout v1.29.1
Running Go Examples #
The Pachyderm godocs reference (see generation instructions above) provides examples of how you can use the Go client API. You need to have a running Pachyderm cluster to run these examples.
Make sure that you use your pachd_address
in client.NewFromAddress("<your-pachd-address>:30650")
.
For example, if you are testing on minikube
, run
minikube ip
to get this information.
See the OpenCV Example in Go for more information.
Python Clients #
Pachyderm-SDK (New) #
The Python client pachyderm-sdk
is the new Python client for Pachyderm and is officially supported by the Pachyderm team.
Python-Pachyderm (Old) #
The Python client python-pachyderm
will be deprecated in 9 months as of 08/10/2023.
Use python-pachyderm v7.3 with Pachyderm 2.8.x.
You will find all you need to get you started or dive into the details of the available modules and functions in the API documentation, namely:
- The installation instructions and links to PyPI.
- A quick “Hello World” example to jumpstart your understanding of the API.
- Links to python-pachyderm main Github repository with a list of useful examples.
- As well as the entire reference API.
Node Client #
Our Javascript client node-pachyderm
has been deprecated.
Other languages #
Pachyderm uses a simple protocol buffer API. Protobufs support other languages, any of which can be used to programmatically use Pachyderm. We have not built clients for them yet. It is an easy way to contribute to Pachyderm if you are looking to get involved.