Skip to main content

Official Python SDK for EasyOne API with client-side encryption

Project description

EasyOne Python SDK

Official Python SDK for interacting with EasyOne API. Provides client-side AES-GCM encryption and chunked upload functionality.

Installation

pip install ez1-python-sdk

Quick Start

from ez1 import EasyOneClient

client = EasyOneClient(
    api_key='up_live_YOUR_KEY_HERE',  # Replace with your actual API key
    base_url='https://file.ez1.cc',  # optional
)

# Upload a file
result = client.upload_file(
    'my-file.pdf',
    options={
        'fileName': 'my-file.pdf',
        'mimeType': 'application/pdf',
        'retentionDays': 30,  # Days to keep the file (default: 30)
        # Set to 0 for indefinite retention (requires unlimited retention permission)
    }
)

print(f"CID: {result['cid']}")
print(f"Decryption Key: {result['decryptionKey']}")

Downloading a File

# Download and decrypt a file
data = client.download_file(
    result['cid'],
    result['decryptionKey'],
    output_path='downloaded-file.pdf'
)

Listing Files

files = client.list_files(limit=20)

for file in files['files']:
    print(f"{file['filename']} - {file['size']} bytes")

Encryption Only

# Encrypt data without uploading
message = b'Secret message'
encrypted = client.encrypt_data(message)

# Decrypt later
decrypted = client.decrypt_data(encrypted['encrypted'], encrypted['key'])
print(decrypted.decode('utf-8'))

API Reference

EasyOneClient

Constructor

EasyOneClient(
    api_key: str,
    base_url: str = None,
    chunk_size: int = None,
)

Methods

  • upload_file(file_path, options=None) - Upload a file with encryption
  • download_file(cid, decryption_key, output_path=None) - Download and decrypt a file
  • get_download_info(cid) - Get download URL and metadata
  • get_metadata(cid) - Get file metadata
  • list_files(limit=50, offset=0) - List user's files
  • encrypt_data(data) - Encrypt data without uploading
  • decrypt_data(encrypted_data, key) - Decrypt data

Security Best Practices

API Key Storage

  • Store API keys in environment variables
  • Never commit keys to version control
  • Use different keys for development/staging/production
  • Rotate keys regularly (recommended: every 90 days)
# .env file
EASYONE_API_KEY=up_live_YOUR_KEY_HERE

Decryption Key Management

  • Store decryption keys in encrypted storage (e.g., AWS KMS, Azure Key Vault)
  • Never log decryption keys
  • Implement key rotation for encrypted files

Client-Side Validation

The SDK now includes:

  • API key format validation (must start with up_live_ or up_test_)
  • File size validation (max 100GB)
  • File type validation (blocks executable files)

License

MIT

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

ez1_python_sdk-1.0.1.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

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

ez1_python_sdk-1.0.1-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file ez1_python_sdk-1.0.1.tar.gz.

File metadata

  • Download URL: ez1_python_sdk-1.0.1.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for ez1_python_sdk-1.0.1.tar.gz
Algorithm Hash digest
SHA256 ee9f293a03985dce35f2bf05329e2eb56fa26205c057d6bbd2cd26fb7b696c4e
MD5 d9a1ec1b6e5b5737a209500e348a9a28
BLAKE2b-256 2a2889e82a97c455f04f89225cfa2a0d73a5a1f2f2d5ff20a9700700e24a197f

See more details on using hashes here.

File details

Details for the file ez1_python_sdk-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: ez1_python_sdk-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for ez1_python_sdk-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 722bbefecd2ea9cbfc157df2d76fbd707e035f2722d0502c53e5fd1623d57e41
MD5 41f8d25cd40a055d8662fe05e0917d88
BLAKE2b-256 da1fe6ed98e04c7891179e728ffbead84c4705bfcec3497b2c7a15ac85b5fb7a

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