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 DataFramecolumn: Column name to encryptstrict: Use strict encryption (default: True)strict_then_loose: Enable fallback strategy (default: False)
🔒 Authentication
The client automatically handles token management:
- Requests a bearer token on first API call
- Caches the token for subsequent requests
- Automatically includes authentication headers
📄 License
This project is licensed under the GPL-3.0 License.
🔗 Links
Project details
Release history Release notifications | RSS feed
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.0.tar.gz
(4.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinappleclient-1.1.0.tar.gz.
File metadata
- Download URL: pinappleclient-1.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9ed63ab2e8025bbc35e5b2e87d1156d6fd7d2726f9fd1996f3a4e4bc04997dd
|
|
| MD5 |
fb3ee78f88440840fc5d60e4a74f03b9
|
|
| BLAKE2b-256 |
25bb4dab953403309de133fa9021fc45e534b36ec19d4b334d0ebf54aa8ecc92
|
File details
Details for the file pinappleclient-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pinappleclient-1.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6fa8a24cdead44e94223e08c3eeeeb1c9fbd905a930d24d3c3f7b09ff20d6b2
|
|
| MD5 |
a89c2b8956ccd264046a080d9894bc6c
|
|
| BLAKE2b-256 |
af76a7aff5e26803534ba208e1661906bd6acc441f8e31d4158e8020246baffe
|