Saravanan666/pypi-org huggingface dataset:
Package: jsoncomparedeep
A library to compare any json string/bytes/json-like-objects.Version 1.20 is an enhance version that supportsomit_pathto ignore
omitted keys in dict, and fixes many bugs, esp counting message
inaccurate issue when same length & element collections; and wrong
not_found info when different length underignore_list_seq=TrueVersion 1.19 is an enhance version that fixes small bugs with
strict_number_type supported to make 1 != 1.0.Version 1.18 is a quickfix + enhance version that fixes custom handlers
cannot be passed recursively bug, andfloat_fuzzy_digitscan be passed
directly.Version 1.17 is an enhance version that supports custom handlers to
handle outputs.Version 1.16 is a quickfix version that supports Python 3.8.FeaturesCompare jsons and print the differences (what and where they are,
recursion supported). Useful for interface testing.Config whether it will ignore the order of items in a list or not,
recursively.Both python 26+ and 35+ supported.Regular expressions supported for string to skip unconcerned keys or
just to assert the format.Compactstrandunicode(orbytesandstrin
python3), they are considered equal. Good for non ascii coding
languages.Bothjson string(unicodeorbinarystr) andjson
object(dict,listortuple) are supported.Support tuples, so results from pymysql.cursors.DictCursor can
compare with interface response directly.Json type legal check.Support skipping anywhere using argument likeignore_path=[“/a/1/k”,
“/a/1/l”], dict keys or list indexes. Skipped fields are regarded as
match.The ignore_path list now support regular expressions too. You can use[r“^(/:raw-latex:`d+`/a)”]as ignore_path to skip all keys named
“a” in[{“a”: 1, “b”: 2}, {“a”: 1, “b”: 4}]but still compare the
value of “b”. (New)Useful when compare multi records in database query result
(dictionary cursor) with some fields unconcerned.Fuzzy equal when handling floats. (New)Python 3.8 supported. (New)Custom handlers supported. (New)Strict_number_type option to make int(1) != float(1.0) supported.
(New)QuickStartinstallpipinstalljsoncomparedeepor updatepipinstall-Ujsoncomparedeepa simple examplefromjson_compareimportJcomparecp=Jcompare()print(cp.compare({"key1":["v1","v2"],"key2":{"key3":1}},{"key1":["v2","v1"],"key2":{"key3":2}}))to seea is {'key2': {'key3': 1}, 'key1': ['v1', 'v2']}
b is {'key2': {'key3': 2}, 'key1': ['v2', 'v1']}
ignore_list_seq = True, re_compare = True
different value at /key2/key3
a: 1
b: 2
FalseFor more demos and information, just install it and visit the test filetest_json_compare.pyinYour_Python_Path/Lib/site-packages/json_compare/Small HintsDatetime in SQL result is not JSON serializable type, use something
likeCAST(create_time as CHAR) ‘create_time’in SQL statement to
solve it.Bug reportIssues and bugs report torainydew@qq.com.Homepage icon leads to my Github project page, issues / PRs / stars
are welcomed :)
Package: json-compare-deep
A library to compare any json string/bytes/json-like-objects.Version 2.0 is a rewrite to support more clear and easy-to-use
functions(backward incompatible, so I started a new repo).Version 1.20 is an enhance version that supportsomit_pathto ignore
omitted keys in dict, and fixes many bugs, esp counting message
inaccurate issue when same length & element collections; and wrong
not_found info when different length underignore_list_seq=TrueVersion 1.19 is an enhance version that fixes small bugs with
strict_number_type supported to make 1 != 1.0.Version 1.18 is a quickfix + enhance version that fixes custom handlers
cannot be passed recursively bug, andfloat_fuzzy_digitscan be passed
directly.Version 1.17 is an enhance version that supports custom handlers to
handle outputs.Version 1.16 is a quickfix version that supports Python 3.8 (and 3.9 as
well).FeaturesCompare jsons and print the differences (what and where they are,
recursion supported). Useful for interface testing.Config whether it will ignore the order of items in a list or not,
recursively.Both python 2.6-2.7 and 3.5-3.9 supported. (New)Regular expressions supported for string to skip unconcerned keys or
just to assert the format.Compactstrandunicode(orbytesandstrin
python3), they are considered equal. Good for non ascii coding
languages.Bothjson string(unicodeorbinarystr) andjson
object(dict,listortuple) are supported.Support tuples, so results from pymysql.cursors.DictCursor can
compare with interface response directly.Json type legal check(strict_json).Support skipping anywhere using argument likeignore_path=[“/a/1/k”,
“/a/1/l”], dict keys or list indexes. Skipped fields are regarded as
match.The ignore_path list now support regular expressions too. You can use[r“^(/:raw-latex:`d+`/a)”]as ignore_path to skip all keys named
“a” in[{“a”: 1, “b”: 2}, {“a”: 1, “b”: 4}]but still compare the
value of “b”. (New)Useful when compare multi records in database query result
(dictionary cursor) with some fields unconcerned.Fuzzy equal when handling floats.Custom handlers supported.Strict_number_type option to make int(1) != float(1.0) supported.Emit keys in dict compare supported. (New)QuickStartinstallpipinstalljsoncomparedeepor updatepipinstall-Ujsoncomparedeepa simple examplefromjson_compareimportcompareprint(compare({"key1":["v1","v2"],"key2":{"key3":1}},{"key1":["v2","v1"],"key2":{"key3":2}}))to seea is {'key1': ['v1', 'v2'], 'key2': {'key3': 1}}
b is {'key1': ['v2', 'v1'], 'key2': {'key3': 2}}
ignore_list_seq = True, re_compare = True, ignore_path = None, omit_path = None, float_fuzzy_digits = 0
different value at /key2/key3
a: 1
b: 2
FalseFor more demos and information, just install it and visit the test filetest_json_compare.pyinYour_Python_Path/Lib/site-packages/json_compare/Small HintsDatetime in SQL result is not JSON serializable type, use something
likeCAST(create_time as CHAR) ‘create_time’in SQL statement to
solve it.Bug reportIssues and bugs report torainydew@qq.com.Homepage icon leads to my Github project page, issues / PRs / stars
are welcomed :)
Package: jsoncomparison
The JSON Comparison packageThis package is designed to compare two objects with a JSON-like structure and data types.Installpip install -U pip jsoncomparisonUsageFirst you need to define two variables:expected&actual.
Think of them as the same variables that you use in tests.Expected - the original data object that you want to see.
Actual - the given data object.Then we will transfer these objects to check and identify the difference between them:fromjsoncomparisonimportCompare,NO_DIFFexpected={"project":{"name":"jsoncomparison","version":"0.1","license":"MIT","language":{"name":"python","versions":[3.5,3.6]}},"os":"linux"}actual={"project":{"name":"jsoncomparison","version":0.1,"license":"Apache 2.0","language":{"name":"python","versions":[3.6]}}}diff=Compare().check(expected,actual)assertdiff!=NO_DIFFThecheckmethod returns a dictionary of differences betweenexpectedandactualobjects:{"project":{"version":{"_message":"Types not equal. Expected: <str>, received: <float>","_expected":"str","_received":"float"},"license":{"_message":"Values not equal. Expected: <MIT>, received: <Apache 2.0>","_expected":"MIT","_received":"Apache 2.0"},"language":{"versions":{"_length":{"_message":"Lengths not equal. Expected <2>, received: <1>","_expected":2,"_received":1},"_content":{"0":{"_message":"Value not found. Expected <3.5>","_expected":3.5,"_received":null}}}}},"os":{"_message":"Key does not exists. Expected: <os>","_expected":"os","_received":null}}ConfigurationThe default configuration can be overridden by passing the config dictionary to the Compare class constructor:fromjsoncomparisonimportCompareconfig={"output":{"console":False,"file":{"allow_nan":True,"ensure_ascii":True,"indent":4,"name":None,"skipkeys":True,},},"types":{"float":{"allow_round":2,},"list":{"check_length":True,}}}cmp=Compare(config)OutputBy default, the configuration does not allow printing the comparison result to the console,
but at the same time writes the results to a file.These settings can be changed in your class config:config={"output":{"console":True,"file":{}}}Ignore rulesWhat if you do not want to compare some values and keys of objects from your JSON?In this case, you can define exception rules and pass them to the class constructor.Let's go back to the example above:fromjsoncomparisonimportCompare,NO_DIFFexpected={# ...}actual={# ...}rules={"project":{"version":"*","license":"*","language":{"versions":{"_values":[3.5]}}},"os":"*",}diff=Compare(rules=rules).check(expected,actual)assertdiff==NO_DIFFNow that we have added exceptions to the missing values,
the comparison test has been successfully passed!LinksYou can see a more complex comparison example that I used to test the correct operation of an application:link.
Package: jsonConfig
jsonConfigis a Python package that provides sparse JSON based config files with GUI editor.
The config files are referred to as being sparse because only those settings which are different than
the default values are stored in the config files. Default config options are defined programmatically
which allows defaults to be updated with out overwriting a users options.UsageCreating defaultsfrom jsonConfig import *

cfg = Config()
cfg.add_setting( 'Category 1', 'option1', 'Value1', alias = 'Option #1', options = ['Value1', 'Value2'], type = CT_COMBO, about = 'An example option.' )
cfg.add_setting( 'Category 1', 'option2', True, alias = 'Option #2', type = CT_CHECKBOX )
cfg.add_setting( 'Category 2', 'option1', 'value', type = CT_LINEEDIT)Accessing values>>> cfg
{'Category 2': {'option1': 'value'}, 'Category 1': {'option2': True, 'option1': 'Value1'}}

>>> cfg['Category 1']['option1']
'Value1'Loading config fileconfig.json{
  "Category 1": {
    "option1": {
      "value": "Value2"
    }
  }
}cfg.set_user_file("config.json")
>>> cfg
{'Category 2': {'option1': 'value'}, 'Category 1': {'option2': True, 'option1': 'Value2'}}GUI Editorfrom PySide.QtGui import *
from jsonConfig import ConfigEditor

app = QApplication([])
editor = ConfigEditor(app, cfg, 'Demo Config Editor')
editor.setup()
app.exec_()
Package: json_config
json_configA convenience utility for working with JSON config files.FeaturesDocumentation:https://json_config.readthedocs.orgOpen Source:https://github.com/bionikspoon/json_configMIT licenseAutomatically syncs file on changes.Automatically handles complicated nested data structures.Designed to be easily extended.  Use different serializer libraries to easily switch to yaml, ini, etc.Lightweight (<5KB) and Fast.Takes advantage of Python’s native dictionary syntax.Tested against python 2.6, 2.7, 3.3, 3.4, 3.5, and PYPY!Unit Tested with high coverage.Idiomatic, self-descriptive code & api>>>importjson_config>>>config=json_config.connect('categories.json')>>>configConnect({})>>>config['comics']['dc']['batman']['antagonists']=['Scarecrow','The Joker','Bane']>>>config['comics']['marvel']['ironman']['antagonists']='Ultron'>>>print(config.serialize()){"comics":{"dc":{"batman":{"antagonists":["Scarecrow","The Joker","Bane"]}},"marvel":{"ironman":{"antagonists":"Ultron"}}}}InstallationAt the command line either via easy_install or pip$pipinstalljson_config$easy_installjson_configOr, if you have virtualenvwrapper installed$mkvirtualenvjson_config$pipinstalljson_configUninstall$pipuninstalljson_configUsageTo use json_config in a project:importjson_configconfig=json_config.connect('config.json')config['root']='/var/www/html/'print(config['root'])#OUT: '/var/www/html/'config#OUT:  Connect({'root': '/var/www/html/'})CreditsTools used in rendering this package:Cookiecutterbionikspoon/cookiecutter-pypackageforked fromaudreyr/cookiecutter-pypackageHistoryNext ReleaseStay tuned2.0.0 (2016-01-01)BREAKING: (Internal API)connect.blockremovedBREAKING: (Internal API)connect.write_filerenamed toconnect.saveFeature: Rewrote the entire library to encapsulate logicFeature: Extendable serializer contract, to allow any config format.Feature: Upgrade to stable.Feature: Removed threading in favor of a smarter locking mechanismFeature: Add support for py26 and py35Feature: Pin dependenciesFeature: Reorganized package and testsFix: Updated doc buildsFix: Readme badge links2.0.1: Fix: Failed deploy (travis requirements)1.2.0 (2015-05-18)Feature: Improved compatibility to py27, py32, py33, py34, and pypyFeature: Supports multiple config files.Feature: Writes less, smarter logic on deciding if a write is necessary.Feature: Delegates writes to a background process.Testing: Renamed tests to be more descriptive of expectations.Testing: Added a bunch of tests describing different scenarios.Massive Refactoring1.1.0 (2015-04-15)Massive improvement to documentation and presentation.1.0.0 (2015-04-13)First working version.0.1.0 (2015-04-11)First release on PyPI.
Package: json-config-expander
json-config-expanderExpandmulti optionalconfiguration tomultiple configurations.Example 1base_config = {'param_1*': [12, 13]}
expand_configs(base_config)Returns:[{'param_1': 12}, {'param_1': 13})Example 2base_config = {'param_1': {'param_2*': [12, 13]}}
expand_configs(base_config)Returns:[
    {'param_1': {'param_2': 12}}, 
    {'param_1': {'param_2': 13}}
]Example 3base_config = {'param_1*': [12, 13], 'param_2*': ['a', 'b']}
expand_configs(base_config)Returns:[
    {'param_1': 12, 'param_2': 'a'}, 
    {'param_1': 12, 'param_2': 'b'}, 
    {'param_1': 13, 'param_2': 'a'}, 
    {'param_1': 13, 'param_2': 'b'}
]Example 4base_config = {
    'param_1*': [
        {'param_2*': [20, 30, 50]},
        {'param_3*': ['Big', 'Small']}
    ]
}
expand_configs(base_config)Returns:[
    {'param_1': {'param_2': 20}}, 
    {'param_1': {'param_2': 30}},
    {'param_1': {'param_2': 50}},  
    {'param_1': {'param_3': 'Big'}},
    {'param_1': {'param_3': 'Small'}}
]Motivation ScenarioYou would like to  run a classification task on multiple parameters of multiple classifier types, and see which one performs better:base_config = {
    'classifier*': [
        {'name': 'logistic_regression', 'max_iter*': [100, 200, 300]},
        {'name': 'xgboost', 'n_estimators*': [50, 100, 200], 'max_depth*': [3,4,5]}
    ]
}To returns all the possible configurations of your setting:expand_configs(base_config)Returns:[
    {'classifier': {'name': 'logistic_regression', 'max_iter': 100}}, 
    {'classifier': {'name': 'logistic_regression', 'max_iter': 200}}, 
    {'classifier': {'name': 'logistic_regression', 'max_iter': 300}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 50, 'max_depth': 3}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 50, 'max_depth': 4}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 50, 'max_depth': 5}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 100, 'max_depth': 3}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 100, 'max_depth': 4}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 100, 'max_depth': 5}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 200, 'max_depth': 3}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 200, 'max_depth': 4}}, 
    {'classifier': {'name': 'xgboost', 'n_estimators': 200, 'max_depth': 5}}
]If you want to run evaluation on each configuration, you need to pass evaluation_function:def evaluation_function(config):
    ...results = expand_configs(base_config, evaluation_function)The results list would have all the evaluation results on each config, then you can select the best result for your needs.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: json-configparser
JSON-ConfigparserThis python package enables the usage of JSON files as configuration files that can be properly validated.The examples folder contains examples of using this package.Main FeaturesParse several different datatypes from a JSON configuration file:intsfloatsstringsbooleanslistsdictionarieslists/dictionaries of all other typesDefine options, including their types, bounds, extra validations, and defaultsParse a configuration file, returning an object with attributes or a dictionaryAll types, bounds, and defaults are validated by the packageList of TODOsImplement compatibility with 3.7 dataclassesImprove testsImprove function namesImprove the creation of BoundsAllow command line interaction, e.g., when running a script pass the path to the json and new values for some arguments
Package: json-config-parser
A straightforward and unambiguous config file parser.This package was originally based on the configparser module that comes in the standard python distribution but has been almost entirely rewritten.The main branch won’t support python 2 as it is missing keyword only arguments andChainMapis not in the standard library.
If you need legacy support then there are a couple of forks which look like they do the job.InstallationAvailable on pypi asjson-config-parserTo install runpipinstalljson-config-parserAlternatively grab the code fromgithuband run:pythonsetup.pyinstallSyntaxFiles are structured using square bracket sections,#comments and$key = $valueoptions.  Option values are written in json and can lists and dictionaries be spread over any number of lines.
To keep parsing simple and files neat, comments, section headers and keys can not be indented and no whitespace is allowed on empty lines.Comments start at the beginning of a line with a#symbol and extend to the line’s end.Usagecfg=JSONConfigParser()cfg.read_string("""
[section]
number = 3.141592654
dictionary = {"key": "value"}
list = [1,
        2,
        3]
nested = {"list": [1,2,3]}
true = true
none = null

[DEFAULT]
# settings in the default section are inherited
# by all other sections.
default-setting = "default"
""")# read a settingcfg.get("section","number")# read a setting using index notationcfg["section"]["true"]# settings inherited from DEFAULTcfg.get("section","default-setting")BugsPlease report any problems on thebugtrackerand I will do my best to fix them.
Pull requests are also welcome.
Package: jsonconfigreader
DescriptionUtility that allows to read and parse json config files.Possible to specify links to the default values in the config (See Usage
section).InstallationInstall python 3.6+Ensure pip, setuptools, and wheel are installed and up to datepython-mpip install--upgradepip setuptools wheelCreate virtual enviroment (make sure that is not part of the project)python-mvenv <ENV NAME>orpython-mvenv%path%\to\<ENVNAME>Active virtual enviroment%path%\to\<ENVNAME>\Script\activateInstall all project dependencies if neededpip install-rrequirements.txtInstall pandoc and pypandoc.Instructionpip install pypandocUsageExample of the config file:C:\User\test\qa_hotfix_config.json

{
    "defaults": {
        "dataBaseUrl": "http://db:5000"
    },
    "dataBase1": "<defaults.dataBaseUrl>",
    "dataBase2": "<defaults.dataBaseUrl>"
}Specify that lib in your project dependenciesImportfrom jsonconfigparser.json_config_reader import JsonConfigReaderCreate an instance of the class passing config folder path and
optionsconfig_path = 'C:\User\test\qa_config.json'
json_config_reader = JsonConfigReader(config_path)
config = json_config_reader.get()
file_path = json_config_reader.get_config_file_path()
print(config['dataBase1'])
print(file_path)

>> http://db:5000
>> C:\User\test\qa_config.jsonUploading project to PyPiChange version insetup.pyUpload changes to PyPi serverpython setup.py sdist upload-r<Repository URL to the PyPi server>Run unit tests (Example for Visual Studio)From Visual StudioClickTest->Run->All TestView Test run inTest ExplorerFrom CLINavigate into project directorypython-munittestGenerate docs and updating docsRuneasy_install-UsphinxNavigate todocsfolderRunsphinx-quickstartFollow
instruction
Package: json-config-validator
JSON Configuration ValidatorPackage for validation JSON configuration filesFree software: GNU General Public License v3Documentation:https://json-config-validator.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2023-11-20)First release on PyPI.
Package: jsoncontrast
pip install jsoncontrastUsed to contrast two json,especially for testers.jsoncontrast.check(src_data, dst_data,model='contains',string_model='strict',num_model='equal',num_limit=None,explicit=True,basedir=None)主要用来对比json串的期望值和返回值，用于接口测试，方法包括以下8个入参：2个必选参数：src_data-----用来做对比的一个json串，一般地，例如：接口实际返回的jsondst_data-----用来做对比的另一个json串，一般地，例如：校验接口的期望返回json6个可选参数：model='contains'-----可选范围['contains','strict']contains: src_data单向包含dst_datastrict: src_data与dst_data相互包含(不计顺序内容一致)string_model='strict'-----可选范围['contains','strict','start','end','exist']contains: dst_data中的字符串项包含于src_data中对应的字符串strict: dst_data中的字符串等于src_data中对应的字符串start: src_data中的字符串以dst_data中对应的字符串开头end: src_data中的字符串以dst_data中对应的字符串结尾exist: 只想判断dst_data中某项存在，不需要比较具体值，对应值的位置写成''re_expr:dst_data中的字符串以正则表示(见示例)num_model='equal'-----可选范围['equal','nequal','big','small']equal: dst_data中的数字项等于src_data中对应的数字项nequal: dst_data中的数字项不等于src_data中对应的数字项big: dst_data中的数字项大于src_data中对应的数字项small: dst_data中的数字项小于src_data中对应的数字项num_limit=None-----可选范围：无或任意整数或浮点数仅在num_model等于big或small时起效，用于额外的设定dst_data中的数字项的上限或下限explicit=True-----可选范围：True或False用于设定是否需要生成json对比文件basedir=None-----可选：用于设定结果存放目录，默认存放于项目文件夹仅在explicit=True时起效举例:eg1.src={"k1" :{"k11":[{"listk111": "北京"},{"listk112": "上海"}],"k12":{"listk121": 7}},"k2":{"listk21": "广州"} }dst={"k1":{"k12":{"listk121": 5}}}jsoncontrast.check(src,dst,num_model='small',num_limit=4)eg2.src=[{"see":["java","python","golang"],"say":"life is short,i use python"}]dst=[{"see":["java","golang","python"],"say":"re.findall('(python)$','{{src}}')"}]jsoncontrast.check(src, dst,string_model='re_expr')eg3.src={"k1" :{"k11":[{"listk111": "北京"},{"listk112": "上海"}],"k12":{"listk121": 7}},"k2":{"listk21": "广州"} }dst={"k1":{"k12":{"listk121": 7},"k11":[{"listk111": "re.search('北.*','{{src}}')"},{"listk112": "上海"}]}}jsoncontrast.check(src, dst,string_model='re_expr')It offers a method jsontcontrast.check,you can use it according to what above descripted in Chinese,or just guess and try,it is so easy!
Package: jsonConverter
jsonconverterA one step stop for all Json conversions.Installationpip install jsonConverterUsagefrom jsonConverter import jsonConverter
json_converter = jsonConverter(ANY_JSON)Invoke jsonConverter from json filefrom jsonConverter import jsonConverter
json_converter = jsonConverter.from_file(json_path)Invoke jsonConverter from json stringfrom jsonConverter import jsonConverter
json_converter = jsonConverter.from_string(json_str)Get htmltable from jsonfrom jsonConverter import jsonConverter
json_converter = jsonConverter(ANY_JSON)
json_converter.get_html_table()How to change default attributes for html tableBelow attributes are exposed. So, pass these parameters to get_html_table method.table_border_color
header_cell_border_color
header_background_color
header_text_color
header_font_sizeExample 1 : get html table with header background color as redfrom jsonConverter import jsonConverter
json_converter = jsonConverter(ANY_JSON)
json_converter.get_html_table(header_background_color = "#ff0000")
Package: jsoncparser
JSONCInstallpip install jsoncparserGetting StartedTo use JSONC, add the following import statement to your codeimportjsoncYou can then use the four functions below to interact with your jsonc file and datajsonc.load(file)
jsonc.loads(str)
jsonc.dumps(JSONCDict)
jsonc.dump(JSONCDict, file)In addition, you can access the dictionarywithstored comments by usingdata_dict = JSONCDict()
data_dict.with_comments