Skip to main content

Python SDK for Pied Piper multimodal compression

Project description

Pied Piper Python SDK

Pied Piper is a lightweight Python SDK for the Pied Piper multimodal compression service.

Install

python -m pip install -e app/packaging

Configure

Set your API key:

export PIED_PIPER_API_KEY="your-shared-api-key"

The SDK defaults to the production Pied Piper service URL. PIED_PIPER_BASE_URL is only needed if you want to override that for local development or a non-production deployment.

Quickstart

import pied_piper

result = pied_piper.compress("Long inline text to compress", fidelity=0.33)
print(result.status)
print(result.text)

Mixed inputs

from pathlib import Path

from pied_piper import Client

client = Client()
result = client.compress(
    [
        "inline text",
        Path("paper.pdf"),
        Path("diagram.png"),
        Path("demo.mp4"),
    ],
    fidelity=0.55,
)

Current behavior:

  • text is extracted and compressed remotely
  • images are accepted as passthrough items
  • video inputs return an inline MP4 artifact on item.output_file
video_item = next(item for item in result.items if item.modality == "video")
video_bytes = video_item.output_file.as_bytes()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

piedpiper_sdk-0.2.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

piedpiper_sdk-0.2.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file piedpiper_sdk-0.2.0.tar.gz.

File metadata

  • Download URL: piedpiper_sdk-0.2.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for piedpiper_sdk-0.2.0.tar.gz
Algorithm Hash digest
SHA256 aeaa2c8883039e959d0aba8deaca50f06425162a986d3f708e8432d19e9b7d2a
MD5 e18985cb9833be766a271a25731d985b
BLAKE2b-256 cd71e3674893ac737fef49dde25c1a1489ccc161c4ebea7d40a26543916ccff2

See more details on using hashes here.

File details

Details for the file piedpiper_sdk-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: piedpiper_sdk-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for piedpiper_sdk-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d55ca55bdfc8e47a1a6d361a2803524fab031bbb809afd2a3247867c199f38ad
MD5 3563ef2f47e091349e2de9e81bee63be
BLAKE2b-256 b98f67d63b5a5b55758814069857d7a83bcaf7955b277f9a7858e925307221fd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page