This release is a pre-release and may not be stable for production use.
Spro Python API Library
Spro is a secure gateway to privacy-compliant AI interactions. It enables users to interact with language models without disclosing sensitive information. Spro automatically detects and masks sensitive data, ensuring that privacy and compliance standards are upheld.
The Spro Python library provides convenient access to the SPRO REST API from any Python 3.8+ application. The library includes type definitions for all request parameters and response fields, offering both synchronous and asynchronous clients powered by httpx.
Note: This library is currently in beta and under active development. Please report any issues or bugs you encounter.
Installation
To install Spro, run the following command:
pip install spro
Usage
To use Spro, import the Spro class from the spro module and create an instance of the class. You can then call the secure method to mask sensitive data in a given text.
from spro import Spro
# Step 1: Set up the Spro client
client = Spro(api_key="your_api_key_here")
# Step 2: Mask sensitive information using the 'secure' method
result = client.secure("My name is John Doe, and my email is john.doe@example.com")
# Step 3: Print the masked result
print(result)
The secure method provides the following parameters:
| Field | Type | Description |
|---|---|---|
prompt |
string | The text you want to redact. This can be any string containing sensitive information. |
mask_type |
string | The type of masking to apply. Options include: char (character masking), label(entity masking), enhanced (enhanced entity masking). |
mask_char |
string | The character to replace sensitive data with (only used if mask_type is char). |
entities |
array | An optional array of specific entities to redact. This is an empty array by default. |
Release files for spro 0.1.0b0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| spro-0.1.0b0.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| spro-0.1.0b0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / spro-0.1.0b0.tar.gz
| Download URL | spro-0.1.0b0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c43670a78f9d9ce564c3206547ab61070916508326e4f675df11c939447a1fd2
|
|
BLAKE2b-256 checksum How to use checksums |
f1902b8fc584e6fa786ab662785d8065249dc07ad3aaa1aadf4cfb752261f0bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.4 Darwin/23.6.0
|
Release files / spro-0.1.0b0-py3-none-any.whl
| Download URL | spro-0.1.0b0-py3-none-any.whl |
|---|---|
| Size | 6.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
29fd67d808f7c6610a1f3f2483a07244d140ec68ba849f6b28cb3f0e19d54976
|
|
BLAKE2b-256 checksum How to use checksums |
12d2d9d16c9b0d20f1245d57e6418af5ad9cc002547b777882e4e5f9c420760d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.4 CPython/3.12.4 Darwin/23.6.0
|