<commit_before># vpsutil
A personal wrapper around a couple of VPS provider APIs.  This mainly exists
for experimentation and basic scripts.  There are few dependencies and only
one configuration file.

## Python Version
The code in this repository was written against Python 3.4.  It may
also work with Python 2.6+

# Setup
## Python
```console
> virtualenv -p python3.4 virtualenv
> . virtualenv/bin/activate
> pip install -e .
```

## Configuration
The configuration for this library lives in `~/.vpsutil`.  It is highly
recommended that you secure the permissions of this file so only you will be 
able to read it.

```dosini
[linode]
token = your_api_token_string

[digital_ocean]
token = your_api_token_string
```<commit_msg>adding example<commit_after># vpsutil
A personal wrapper around a couple of VPS provider APIs.  This mainly exists
for experimentation and basic scripts.  There are few dependencies and only
one configuration file.

## Python Version
The code in this repository was written against Python 3.4.  It may
also work with Python 2.6+

# Setup
## Python
```console
> virtualenv -p python3.4 virtualenv
> . virtualenv/bin/activate
> pip install -e .
```

## Configuration
The configuration for this library lives in `~/.vpsutil`.  It is highly
recommended that you secure the permissions of this file so only you will be 
able to read it.

```dosini
[linode]
token = your_api_token_string

[digital_ocean]
token = your_api_token_string
```

## Examples
### DNS
Create or update an DNS record.  

**NOTE**: The domain you are attempting to manipulate must already exist
```python
>>> from vpsutil.dns import LinodeDNSManager
>>> dns = LinodeDNSManager()
>>> dns.create_record("example.com", "A", "www", "127.0.0.1")
>>> dns.update_record("example.com", "A", "www", "")
>>> dns.delete_record("example.com", "A", "www")
```
{'fraction_non_alphanumeric': 0.10140997830802603, 'fraction_numerical': 0.009761388286334056, 'mean_word_length': 4.54054054054054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 3, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '436726', 'n_tokens_mistral': 571, 'n_tokens_neox': 540, 'n_words': 229}