Metadata-Version: 2.4
Name: redenv
Version: 0.1.0
Summary: A zero-knowledge, end-to-end encrypted secret management SDK for Python.
Project-URL: Homepage, https://github.com/redenv-labs/redenv
Project-URL: Documentation, https://github.com/redenv-labs/redenv/tree/main/packages/python-client
Project-URL: Repository, https://github.com/redenv-labs/redenv
Project-URL: Issues, https://github.com/redenv-labs/redenv/issues
Author-email: PRAS <prassamin@gmail.com>
License: MIT License
        
        Copyright (c) 2026 PRAS
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: dotenv,encryption,redis,sdk,secrets,security,upstash
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Security
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.8
Requires-Dist: cachetools>=5.0.0
Requires-Dist: cryptography>=41.0.0
Requires-Dist: upstash-redis>=1.0.0
Provides-Extra: dev
Requires-Dist: build; extra == 'dev'
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: python-dotenv; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Description-Content-Type: text/markdown

# Redenv Python SDK

The official Python client for Redenv, a zero-knowledge, end-to-end encrypted secret management system.

## Installation

```bash
pip install redenv
```

## Usage

```python
import asyncio
import os
from redenv import Redenv

async def main():
    # Initialize the client
    client = Redenv({
        "project": "your-project-id",
        "token_id": "your-token-id",
        "token": "your-token",
        "upstash": {
            "url": "your-upstash-redis-url",
            "token": "your-upstash-redis-token"
        },
        # Optional
        "environment": "development", # defaults to development
        "cache": {
            "ttl": 300, # 5 minutes
            "swr": 86400 # 24 hours
        }
    })

    # Fetch and decrypt secrets.
    # This automatically injects them into os.environ
    secrets = await client.load()

    print(f"Loaded {len(secrets)} secrets.")
    print(f"DATABASE_URL: {os.environ.get('DATABASE_URL')}")

if __name__ == "__main__":
    asyncio.run(main())
```

## Features

- **End-to-End Encryption**: Secrets are decrypted only in memory using `AES-256-GCM` and `PBKDF2`.
- **Zero Knowledge**: The backend (Redis) only stores encrypted data.
- **Caching**: Implements Stale-While-Revalidate caching to minimize latency and database calls.
- **Universal Support**: Works with standard Python `asyncio`.
