Skip to main content

Python Examples

This page provides practical examples of how to use the Qanapi Smart Data Proxy with Python for various common scenarios.

Setup

First, make sure you have the requests library installed:

Basic Data Encryption

Encrypt specific fields in a JSON payload:

Decrypting Data

Decrypt previously encrypted fields:

Encrypting and Forwarding

Encrypt data and forward it to another service:

Encrypting Nested Fields

Encrypt fields within nested objects using dot notation:

Creating a Reusable Qanapi Client

For convenience, you can create a reusable client class:

Error Handling

Proper error handling is important when working with the Qanapi API:

Next Steps

For more detailed examples and information: