HashiCorp Vault API client
Project description
# hvac
[HashiCorp](https://hashicorp.com/) [Vault](https://www.vaultproject.io) API client for Python 2/3
[](https://travis-ci.org/ianunruh/hvac) [](https://pypi.python.org/pypi/hvac/) [](https://hvac.readthedocs.io/en/latest/?badge=latest)
Tested against Vault v0.1.2 and HEAD. Requires v0.1.2 or later.
## Documentation
Documentation for this module is hosted on [readthedocs.io](https://hvac.readthedocs.io/en/latest/).
## Getting started
### Installation
```bash
pip install hvac
```
or
```bash
pip install "hvac[parser]"
```
if you would like to be able to return parsed HCL data as a Python dict for methods that support it.
### Initialize the client
```python
import os
import hvac
# Using plaintext
client = hvac.Client()
client = hvac.Client(url='http://localhost:8200')
client = hvac.Client(url='http://localhost:8200', token=os.environ['VAULT_TOKEN'])
# Using TLS
client = hvac.Client(url='https://localhost:8200')
# Using TLS with client-side certificate authentication
client = hvac.Client(url='https://localhost:8200', cert=('path/to/cert.pem', 'path/to/key.pem'))
```
### Read and write to secret backends
```python
client.write('secret/foo', baz='bar', lease='1h')
print(client.read('secret/foo'))
client.delete('secret/foo')
```
### Authenticate using token auth backend
```python
# Token
client.token = 'MY_TOKEN'
assert client.is_authenticated() # => True
```
[HashiCorp](https://hashicorp.com/) [Vault](https://www.vaultproject.io) API client for Python 2/3
[](https://travis-ci.org/ianunruh/hvac) [](https://pypi.python.org/pypi/hvac/) [](https://hvac.readthedocs.io/en/latest/?badge=latest)
Tested against Vault v0.1.2 and HEAD. Requires v0.1.2 or later.
## Documentation
Documentation for this module is hosted on [readthedocs.io](https://hvac.readthedocs.io/en/latest/).
## Getting started
### Installation
```bash
pip install hvac
```
or
```bash
pip install "hvac[parser]"
```
if you would like to be able to return parsed HCL data as a Python dict for methods that support it.
### Initialize the client
```python
import os
import hvac
# Using plaintext
client = hvac.Client()
client = hvac.Client(url='http://localhost:8200')
client = hvac.Client(url='http://localhost:8200', token=os.environ['VAULT_TOKEN'])
# Using TLS
client = hvac.Client(url='https://localhost:8200')
# Using TLS with client-side certificate authentication
client = hvac.Client(url='https://localhost:8200', cert=('path/to/cert.pem', 'path/to/key.pem'))
```
### Read and write to secret backends
```python
client.write('secret/foo', baz='bar', lease='1h')
print(client.read('secret/foo'))
client.delete('secret/foo')
```
### Authenticate using token auth backend
```python
# Token
client.token = 'MY_TOKEN'
assert client.is_authenticated() # => True
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hvac-0.6.2.tar.gz
(34.0 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
hvac-0.6.2-py2.py3-none-any.whl
(41.9 kB
view details)
File details
Details for the file hvac-0.6.2.tar.gz.
File metadata
- Download URL: hvac-0.6.2.tar.gz
- Upload date:
- Size: 34.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bc80744df5f09882b1cc91755b03b7b62b093fc63c8c4abb26fbfb9c9e878dd
|
|
| MD5 |
20f7858c9667d15589ca7ad356242cf7
|
|
| BLAKE2b-256 |
e5eeb0471ac0971120268428e42c9f9c3a82f3f3be1e648736a21f6a22f6e78f
|
File details
Details for the file hvac-0.6.2-py2.py3-none-any.whl.
File metadata
- Download URL: hvac-0.6.2-py2.py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7095f6569ba96dcb65b135d80bb15a0cc2e2c4a56dfd878e2b369c902f444cd2
|
|
| MD5 |
425e28c3a134dfc0eb7d03f74d402186
|
|
| BLAKE2b-256 |
5c0f7729d550b6c63bea28fec24ef7c15d7065bc709c1ae9ac1c2fa2de99c20f
|