semvec/pypi-packages huggingface dataset:
PySCfg 0.1.0
simply store/load/modify user configurations
Requires Python: >=3.6.0

# PySCfg - _Python Simple Configurations_

A simple solution to store/load/modify user configurations for your Python project. 

version: _0.1.0_  
contributors: _suppetia_

## Installing

```bash
git clone https://github.com/suppetia/PySCfg.git
cd PySCfg
python setup.py install
```

## Simple Usage
```python
from pyscfg import SimpleConfigs

# uses file 'configs.yml' (default) to store the user configurations
cfg = SimpleConfigs()

# set configurations depending on user preferences
if user_chooses_this:
    cfg["num"] = 1
else:
    cfg["num"] = -1
```

Specify a path to configuration file.
```python
# uses file 'configs.yml' in subdirectory 'data' to store the user configurations
cfg = SimpleConfigs("data/configs.yml")
```


Use default values for your configurations stored in a dictionary. These values will be assigned if the keys aren't in the configurations already.
The configurations file is updated.

```python
from pyscfg import SimpleConfigs


defaults = {
    "foo": "John",
    "bar": "Doe",
    "num": 0
}

# uses file 'configs.yml' (default) to store the user configurations
cfg = SimpleConfigs(defaults=defaults)

print(cfg["num"]) # prints 0

if user_chooses_this:
    cfg["num"] = 1
else:
    cfg["num"] = -1

print(cfg["num"]) # prints 1 or -1
```

You can also write your defaults into a configuration file (supported: _YAML_, _JSON_) and pass it to the constructor.
```python
# uses file 'default_cfg.yml' in subdirectory 'data' to load the default configuration values
cfg = SimpleConfigs(defaults="data/default_cfg.yml")

```
servicemock 0.1.1
Mock DSL for requests_mock
Requires Python: >=3.7

# Servicemock
[![Build Status](https://travis-ci.com/mlackman/urban-lamp.svg?branch=master)](https://travis-ci.com/mlackman/urban-lamp)

## Unittest example

```
import unittest
import servicemock as sm


class TestService(sm.ServiceMockTestCase):

    def test(self):
        # If the expected request is not made the test will fail
        sm.expect('http://service.com').to_receive(sm.Request('GET', '/v1/users')).and_responds(sm.HTTP200Ok(sm.JSON({'status': 'ok'})))
```