## protocols.kvstore.KeyValueStoreProtocol

<span id="hexkit.protocols.kvstore.KeyValueStoreProtocol"></span>


A protocol for a key-value store.


Usage

``` python
protocols.kvstore.KeyValueStoreProtocol()
```


## Methods

| Name | Description |
|----|----|
| [delete()](#delete) | Delete the value for the given key. |
| [exists()](#exists) | Check if the given key exists. |
| [get()](#get) | Retrieve the value for the given key. |
| [set()](#set) | Set the value for the given key. |

<span id="hexkit.protocols.kvstore.KeyValueStoreProtocol.delete"></span>


#### delete()


Delete the value for the given key.


Usage

``` python
delete(key)
```


Does nothing if there is no such value in the store.


<span id="hexkit.protocols.kvstore.KeyValueStoreProtocol.exists"></span>

------------------------------------------------------------------------


#### exists()


Check if the given key exists.


Usage

``` python
exists(key)
```


Default implementation for classes inheriting from this protocol. Providers can use something more efficient.


<span id="hexkit.protocols.kvstore.KeyValueStoreProtocol.get"></span>

------------------------------------------------------------------------


#### get()


Retrieve the value for the given key.


Usage

``` python
get(key, default=None)
```


Returns the specified default value if there is no such value in the store.


<span id="hexkit.protocols.kvstore.KeyValueStoreProtocol.set"></span>

------------------------------------------------------------------------


#### set()


Set the value for the given key.


Usage

``` python
set(key, value)
```


Providers must reject storing a value of None if they support a value domain V that can contain such values.
