Python SDK for lazy-locker - A secure local secrets manager
Project description
lazy-locker SDK for Python
SDK Python pour lazy-locker - Gestionnaire de secrets sécurisé.
Installation
pip install lazy-locker
# ou
uv add lazy-locker
Prérequis
L'agent lazy-locker doit être démarré :
lazy-locker # Entrez votre passphrase dans le TUI
L'agent reste actif pendant 8 heures.
Usage
Injection automatique
from lazy_locker import inject_secrets
import os
# Injecte tous les secrets dans os.environ
inject_secrets()
# Utilisez vos secrets normalement
api_key = os.environ["MY_API_KEY"]
Récupération manuelle
from lazy_locker import get_secrets, get_secret
# Tous les secrets
secrets = get_secrets()
print(secrets) # {"MY_API_KEY": "xxx", "DB_PASSWORD": "yyy"}
# Un secret spécifique
api_key = get_secret("MY_API_KEY")
Vérification de l'agent
from lazy_locker import is_agent_running, status
if is_agent_running():
info = status()
print(f"Agent actif, TTL restant: {info['ttl_remaining_secs']}s")
else:
print("Lancez lazy-locker pour démarrer l'agent")
Comparaison avec python-dotenv
| Feature | python-dotenv | lazy-locker |
|---|---|---|
| Secrets en clair sur disque | ✅ Oui (.env) | ❌ Non (chiffré) |
| Versioning sécurisé | ❌ Non | ✅ Oui |
| Expiration des secrets | ❌ Non | ✅ Oui |
| Multi-projet | ❌ Non | ✅ Oui |
Migration depuis python-dotenv
# Avant
from dotenv import load_dotenv
load_dotenv()
# Après
from lazy_locker import inject_secrets
inject_secrets()
# Le reste du code reste identique !
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
lazy_locker-0.0.1.tar.gz
(3.2 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 lazy_locker-0.0.1.tar.gz.
File metadata
- Download URL: lazy_locker-0.0.1.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
756132808a9d91fc247fbde5bb37906bff90c48653cb5b95d0c8b93d6529128e
|
|
| MD5 |
85c2e9a75fe060f84804e08d574d24b0
|
|
| BLAKE2b-256 |
e5f70578928d4c3108f42bda707dfeb919dc379a10b8206e973234432b3eb6a0
|
File details
Details for the file lazy_locker-0.0.1-py3-none-any.whl.
File metadata
- Download URL: lazy_locker-0.0.1-py3-none-any.whl
- Upload date:
- Size: 3.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9cc1d718dd8e8197c8f6bc40d5aac5fe457d74754d7177c4964c1b3f3a59c44
|
|
| MD5 |
0f97f25513db0d11f2332746ca5d5711
|
|
| BLAKE2b-256 |
9b57374fdd9b3f43c5eec1e3859f118c48fbae3331f71c62e05853d5c590356a
|