Metadata-Version: 2.4
Name: infisical-wrapper
Version: 1.0.0
Summary: Infisical SDK Python wrapper with environment validation and secret helpers
Author: Mark Traverse
License: MIT License
        
        Copyright (c) 2026 Mark Traverse
        
        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.
Project-URL: Homepage, https://github.com/upstairs-at-erics/infisical-wrapper
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: infisicalsdk>=1.0.15
Requires-Dist: requests>=2.31
Dynamic: license-file

# Infisical Secrets Wrapper  

A clean, Pythonic wrapper around the Infisical SDK with:  

- automatic environment validation  
- client initialisation  
- fetch secrets for a given 'project'    
- single-secret lookup  
- clean error handling  

## Purpose  

- Unified way of getting secrets into python scripts in a secure mmanner
- Keep Dry. A lot of verbosity otherwise required to reliably pull secrets.
- Simplify 
- catch things that go wrong.      

## Pre-requisites
- A self-hosted Infisical Server. 
- Universal **Auth Credentials** for the server.  
- Access to `/etc/environment`


## Installation  

```pip install infisical-wrapper```

## Create Infisical Creds
These can be found or created in the Infisical ui at  
 `Access Control/Machine Identities/Create or click Organization Machine Identity/Universal Auth dropdown/`   
Here you will find Client ID and Client Secret    
```text
INFISICAL HOST="http(s)://<host>:<port>"  
INFISICAL_CLIENT_ID= "<YOUR ID>"
INFISICAL_CLIENT_SECRET= "<YOUR SECRET>"
````  
Put these in `/etc/environmment` to be accessible globally on your node.  
Log out and in again.  
Alternatively keep them in `.env` which are picked up on fallback.    
These allow the module to reach your Infisical Server.

## Usage  
```python
from infisical_wrapper import Infisical

mgr = Infisical()
client = mgr.init_client()

# Fetch all Secrets for a Project
secrets = mgr.fetch_secrets("my-project")
print(f"\n🔑 Secrets dictionary:\n{secrets}")

# Get a specific Secret for a Project
password = mgr.get_secret("my-project", "prod", "DB_PASSWORD")
print(password)

```


# License
MIT License

