Skip to main content

Client for interacting with Pinapple

Project description

🍍 PinappleClient

A Python client for interacting with the Pinapple encryption API.

🚀 Features

  • Authentication 🔐 - Token-based API authentication
  • Flexible Encryption ⚡ - Support for strict and loose encryption modes
  • Fallback Strategy 🔄 - Automatic fallback from strict to loose encryption

📦 Installation

pip install PinappleClient

🔧 Quick Start

from pinapple_client import PinappleClient

# Initialize client
client = PinappleClient(
    user="your_username",
    password="your_password",
    api_url="https://api.pinapple.com"
)

# Encrypt a single PIN
encrypted_pin = client.encrypt_pin_strict("123456")
print(f"Encrypted: {encrypted_pin}")

# Decrypt data
decrypted_pin = client.decrypt_pin(encrypted_data)
print(f"Decrypted: {decrypted_pin}")

📊 DataFrame Operations

encrypt_dataframe(df, column, strict=True, strict_then_loose=False) -> DataFrame

Encrypts an entire column in a pandas DataFrame.

import pandas as pd

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

# Encrypt the 'pin' column
encrypted_df = client.encrypt_dataframe(df, 'pin', strict=True)

# Use fallback strategy
encrypted_df = client.encrypt_dataframe(df, 'pin', strict_then_loose=True)

Parameters:

  • df: Input DataFrame
  • column: Column name to encrypt
  • strict: Use strict encryption (default: True)
  • strict_then_loose: Enable fallback strategy (default: False)

🔒 Authentication

The client automatically handles token management:

  1. Requests a bearer token on first API call
  2. Caches the token for subsequent requests
  3. Automatically includes authentication headers

📄 License

This project is licensed under the GPL-3.0 License.

🔗 Links

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

pinappleclient-1.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

pinappleclient-1.1.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pinappleclient-1.1.1.tar.gz.

File metadata

  • Download URL: pinappleclient-1.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pinappleclient-1.1.1.tar.gz
Algorithm Hash digest
SHA256 1564694ba7c26c973a59350a182fbdad28c408c09e15187c986756c31061112f
MD5 e8543dc3cb54e02e7070ff5a59e481f0
BLAKE2b-256 b7532bbf2641c229bd944639a78e3a43f8ba4111ee912a79daaafdd199bef285

See more details on using hashes here.

File details

Details for the file pinappleclient-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: pinappleclient-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for pinappleclient-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 72c21402c54a8bc844a6ced17ec7201dbb1e9dab1a823b279766180b02f5206e
MD5 acb4e62a80cd5fda5a550ddf272c8c43
BLAKE2b-256 7d08f0d1e29f617b8e3c6ae45b1f5331952e22e2a072c5686b8513d98160d373

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