Json (version 0.0.1) | index Json.html |
This package implements tools to build python package and tools.
>>> from Json import invalid_json_example1, invalid_json_example2
>>> from Json import get_valid_json, load_invalid_json
>>> from json import loads
>>> loads(get_valid_json(invalid_json_example1))
{'true': True, 'false': False, 'null': None, '15,45': [15, 45, 15, 45, 15, 45]}
>>> load_invalid_json(invalid_json_example2)
{True: 'true', False: 'false', None: None, '\n\tabc\n\t': '\n\tqwerty\n\t', 15.45: 15.45}
>>>
Run tests:
~# python -m doctest Json.py
~# python Json.py # Verbose mode
3 items passed all tests:
5 tests in __main__
4 tests in __main__.get_valid_json
4 tests in __main__.load_invalid_json
13 tests in 3 items.
13 passed and 0 failed.
Test passed.
~# coverage run Json.py
~# coverage report
Name Stmts Miss Cover
-----------------------------
Json.py 46 0 100%
-----------------------------
TOTAL 46 0 100%
~#
Functions | ||
|
Data | ||
__all__ = ['load_invalid_json', 'get_valid_json'] __author_email__ = 'mauricelambert434@gmail.com' __copyright__ = '\nPythonToolsKit Copyright (C) 2022 Maurice Lam...ome to redistribute it\nunder certain conditions.\n' __description__ = '\nThis package implements tools to build python package and tools.\n' __license__ = 'GPL-3.0 License' __maintainer__ = 'Maurice Lambert' __maintainer_email__ = 'mauricelambert434@gmail.com' __url__ = 'https://github.com/mauricelambert/PythonToolsKit' |
Author | ||
Maurice Lambert |