An open API service indexing awesome lists of open source software.

https://github.com/viktor-yakubiv/optimize-data

Dictionary optimizer for format method
https://github.com/viktor-yakubiv/optimize-data

Last synced: 2 months ago
JSON representation

Dictionary optimizer for format method

Awesome Lists containing this project

README

        

# Dict Optimizer

Simple function to optimize dicts for `format()` method.

## Usage

```
template = 'some {formatting} string'
data = {
'formatting': 'amazing',
'redundand': 'data',
}
new_data = optimize_data(template, data)
```

Result:

```
new_data = {
'formatting': 'amazing',
}
```

Function works correct with _dicts_, _lists_ and custom _objects_.