Skip to main content

🍍 PinappleClient 🍍

Python client for the Pinapple encryption API with automatic token management and robust error handling.

Installation

pip install PinappleClient

Quick Start

from pinapple_client import PinappleClient

client = PinappleClient(
    user="username",
    password="password",
    api_url="https://api.pinapple.com"
)

# Encrypt/decrypt individual PINs
encrypted = client.encrypt_pins(["123456", "789012"])
decrypted = client.decrypt_pins(["enc_abc123", "enc_def456"])

# Validate PINs
validation = client.validate_pins(["123456", "789012"])

DataFrame Operations

Pandas

import pandas as pd

df = pd.DataFrame({
    'id': [1, 2, 3],
    'pin': ['123456', '789012', '345678']
})

# Encrypt
encrypted_df = client.encrypt_pandas_dataframe(df, 'pin', batch_size=100)

# Decrypt
decrypted_df = client.decrypt_pandas_dataframe(encrypted_df, 'pin', batch_size=100)

Polars

import polars as pl

df = pl.DataFrame({
    'id': [1, 2, 3],
    'pin': ['123456', '789012', '345678']
})

# Encrypt
encrypted_df = client.encrypt_polars_dataframe(df, 'pin', batch_size=100)

# Decrypt
decrypted_df = client.decrypt_polars_dataframe(encrypted_df, 'pin', batch_size=100)

Configuration

client = PinappleClient(
    user="username",
    password="password",
    api_url="https://api.pinapple.com",
    refresh_token_after_x_minutes=5,  # Token refresh buffer (default: 5)
    timeout=30,                        # Request timeout (default: 30)
    max_retries=3,                     # Retry attempts (default: 3)
    backoff_base=2.0                   # Exponential backoff (default: 2.0)
)

Token Management

  • Automatic token refresh before expiration
  • Thread-safe token operations
  • JWT payload parsing for expiration tracking

Network Resilience

  • Exponential backoff retry: backoff_base ^ (attempt + 1)
  • Handles 503 database errors
  • Connection/timeout error recovery

License

GPL-3.0

Links

Metadata

Release files for PinappleClient 2.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PinappleClient 2.0.6
File Size Uploaded
pinappleclient-2.0.6.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PinappleClient 2.0.6
File Interpreter ABI Platform
pinappleclient-2.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 18.1 kB

Release files / pinappleclient-2.0.6.tar.gz

Download URL pinappleclient-2.0.6.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
c8f9e0c05225e006eb6c8fe554945d80b2bbcdb38acab3d0b8c8ad434e75cce9
BLAKE2b-256 checksum
How to use checksums
46c413f7410ba254fe97cbc503989c2202f401c09e2b694c492adf408f39f005
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release files / pinappleclient-2.0.6-py3-none-any.whl

Download URL pinappleclient-2.0.6-py3-none-any.whl
Size 8.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c3b3f8dcb39dc0d1a8df4fe98bfd7ade2d375e461264c5d78641b16c472035b
BLAKE2b-256 checksum
How to use checksums
4fea182cdc05de076516cf4374e070fc3f97728c65568703357eefc79b78e834
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

2.0.6 This release

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page