Metadata-Version: 2.4
Name: AnarchKeyClient
Version: 2.0.0
Summary: A Client package to connect and retrieve api keys from vault serivce called AnarchKey
Author-email: AkiTheMemeGod <k.akashkumar@gmail.com>
Project-URL: Homepage, https://github.com/AkiTheMemeGod/AnarchKey_PyPi_Package
Project-URL: Bug Tracker, https://github.com/AkiTheMemeGod/AnarchKey_PyPi_Package/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests<4.0.0,>=2.31.0
Dynamic: license-file

# AnarchKey Client

The official Python SDK for **AnarchKey**, a secure secret management platform for developers.

AnarchKey lets you securely store API keys, tokens, passwords, and other secrets in the cloud, then retrieve them at runtime without hardcoding sensitive values into your applications.

---

## Features

* 🔐 Secure cloud-based secret management
* 🚀 Simple Python API
* 🛡️ Local device initialization for secure access
* 🔑 Retrieve secrets by name
* 💻 Lightweight with minimal dependencies
* ⚡ Works seamlessly in local development, CI/CD, and production

---

## Installation

Install the SDK from PyPI:

```bash
pip install AnarchKeyClient
```

---

## Getting Started

### 1. Create an AnarchKey account

Sign up at:

**https://anarchkey.bytheseus.me**

After creating an account, generate an **Access Token** from your dashboard.

---

### 2. Initialize your machine

Run the initialization command once:

```bash
anarchkey init --username <YOUR_USERNAME> --password <YOUR_PASSWORD>
```

This securely stores a local initialization token inside:

```
~/.anarchkey
```

---

### 3. Retrieve secrets

```python
from AnarchKeyClient import AnarchKeyClient

client = AnarchKeyClient(
    api_key="YOUR_ACCESS_TOKEN"
)

database_url = client.get_api_key("DATABASE_URL")

print(database_url)
```

or, if you've added the alias:

```python
secret = client.getApiKey("DATABASE_URL")
```

---

## Example

Suppose you have a secret named:

```
OPENAI_API_KEY
```

Retrieve it like this:

```python
from AnarchKeyClient import AnarchKeyClient

client = AnarchKeyClient(
    api_key="ak_xxxxxxxxxxxxxxxxx"
)

openai_key = client.get_api_key("OPENAI_API_KEY")
```

No credentials are stored in your source code other than your access token.

---

## API

### Create a client

```python
client = AnarchKeyClient(
    api_key="YOUR_ACCESS_TOKEN"
)
```

### Retrieve a secret

```python
secret = client.get_api_key("SECRET_NAME")
```

Returns the secret value stored in your AnarchKey vault.

---

## Command Line

Initialize your machine:

```bash
anarchkey init --username YOUR_USERNAME --password YOUR_PASSWORD
```

This command only needs to be run once per machine.

---

## Requirements

* Python 3.8+
* requests

---

## License

MIT License
