general-conversors
general-conversors
is a simple library to do conversions in Python. It is a set of functions that allows you to convert between different structures in a simple and easy way.
In Layrz, we uses general-conversors
to convert any dictionary with multi levels to a single level dictionary, and vice versa. Look at this example:
python
from conversor.dict import ToOneLevel
source = {
'error': False,
'result': {
'executed': True,
'payload': 'Hello world',
'code': 200,
'source_code_url': 'http://google.com'
}
}
conversor = ToOneLevel(source=source)
result = conversor.convert()
# result = {'error': False, 'result.executed': True, 'result.payload': 'Hello world', 'result.code': 200, 'result.source_code_url': 'http://google.com'}
For more information, checkout the README
file on GitHub.
Where can I get the library?
You can get the library from pypi.org.
Can I contribute to the library?
Of course! Feel free to contribute to the library on GitHub.
Where are the source code?
You can find the source code on GitHub.