Pachyderm's Python SDK
Official Python client/SDK for Pachyderm. The successor to https://github.com/pachyderm/python-pachyderm.
This library provides the autogenerated gRPC/protobuf code for Pachyderm, generated using a fork of the betterproto package, along with higher-level functionality.
Installation
pip install pachyderm_sdk
A Small Taste
Here's an example that creates a repo and adds a file:
from pachyderm_sdk import Client
from pachyderm_sdk.api import pfs
# Connects to a pachyderm cluster using your local config
# at ~/.pachyderm/config.json
client = Client.from_config()
# Creates a pachyderm repo called `test`
repo = pfs.Repo(name="test")
client.pfs.create_repo(repo=repo)
# Create a new commit in `test@master` and upload a file.
branch = pfs.Branch.from_uri("test@master")
with client.pfs.commit(branch=branch) as commit:
file = commit.put_file_from_bytes(path="/data/file.dat", data=b"DATA")
# Retrieve the uploaded file.
with client.pfs.pfs_file(file) as f:
print(f.readall())
How to load a CAST file into a pandas dataframe
from pachyderm_sdk import Client
from pachyderm_sdk.api import pfs
import pandas as pd
client = Client.from_config()
file = pfs.File.from_uri("test@master:/path/to/data.csv")
with client.pfs.pfs_file(file) as f:
df = pd.read_csv(f)
Changes from Python-Pachyderm
This package is a successor to the python-pachyderm package. Listed below are some of the notable changes:
- Organization of the API
- Methods and Message objects are now organized according to the service they are associated with, i.e. auth, pfs (pachyderm file-system), pps (pachyderm pipelining-system).
- Message objects can be found within their respective submodule of the
pachyder_sdk.apimodule, i.e.pachyderm_sdk.api.pfs. - Methods can be found within their respective attribute of the
Clientclass, i.e.client.pps.create_pipeline.- Some methods have been renamed to remove redundancy due to this organization, i.e.
python_pachyderm.Client.get_enterprise_state->pachyderm_sdk.Client.enterprise.get_state
- Some methods have been renamed to remove redundancy due to this organization, i.e.
- The autogenerated code is generated using a fork of the betterproto compiler.
- Messages are now python dataclasses.
- Methods require keyword arguments.
- Pachyderm resources are specified using types.
- python-pachyderm (old):
client.create_repo("test") - pachyderm_sdk (new):
client.pfs.create_repo(repo=pfs.Repo(name="test"))
- python-pachyderm (old):
Contributing
Please see the contributing guide for more info (including testing instructions)
Developer Guide
Generate python APIs from protobuf:
./generate-protos.sh
Generate HTML documentation (writes to docs/pachyderm_sdk):
make docs
Running Tests:
pytest -vvv tests
Metadata
Release files for pachyderm-sdk 2.12.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pachyderm_sdk-2.12.2.tar.gz | 72.6 kB | Without provenance | Details for pachyderm_sdk-2.12.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pachyderm_sdk-2.12.2-py3-none-any.whl | Python 3 | none | any | Details for pachyderm_sdk-2.12.2-py3-none-any.whl |
Total release size: 161.3 kB
Release files / pachyderm_sdk-2.12.2.tar.gz
| Download URL | pachyderm_sdk-2.12.2.tar.gz |
|---|---|
| Size | 72.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
229487945ddace46a6d24e7cf0fcbd9fed43a25b015e58fd8fcfbae413c0b21a
|
|
BLAKE2b-256 checksum How to use checksums |
2300d6bcfe2973e5e5d9ec94ec5bb7c5a6a85fdac2dedfa48690d10352a5bd38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.10.16 Linux/5.15.0-1057-aws
|
Release files / pachyderm_sdk-2.12.2-py3-none-any.whl
| Download URL | pachyderm_sdk-2.12.2-py3-none-any.whl |
|---|---|
| Size | 88.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d6b8e18af5a2f529638fe783168c15b259a23d6d6ce7a041767e9fc56db1f3d7
|
|
BLAKE2b-256 checksum How to use checksums |
cc740a9ad2d91e1980b6c2ab8f15644865f2f1f034ead9f72cbff6c4813a53fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.1 CPython/3.10.16 Linux/5.15.0-1057-aws
|
Security for pachyderm-sdk 2.12.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.