Saravanan666/pypi-org huggingface dataset:
Package: jsonurl
Introductionjsonurl is a simple library for managing the serialisation and deserialisation of URL query strings which represent hierarchically structured data.It will take python data structures which can be represented in JSON and convert them to flat key/value pairs for use in URL query strings, and it will take URL query strings and parse them into hierarchical data structures.This is convenient if you wish to pass structured data around in the URL itself rather than in a POST body.  This may complement a web API which also accepts JSON strings in the body of a POST request, providing equivalent functionality using GET without constructing URLs which include url-encoded json objects.Usage>>> import jsonurl### Converting Data StructuresA simple flat dictionary>>> d = {"one" : 1, "two" : 2}>>> jsonurl.query_string(d)
'one=1&two=2'A dictionary with a nested dictionary>>> d = {"one" : {"two" : 2, "three" : 3}, "four" : 4}
>>> q = jsonurl.query_string(d)
>>> q
'four=4&one.three=3&one.two=2'We can also get a flat dictionary as a proxy for the hierarchic one, if we do not want jsonurl to actually prepare the query part of the URL for us>>> jsonurl.dict_to_args(d)
{'four': '4', 'one.three': '3', 'one.two': '2'}We can parse the query string back into a python dictionary object>>> jsonurl.parse_query(q)
{'four': 4, 'one': {'three': 3, 'two': 2}}We can also serialise nested lists:>>> d = {"one" : 1, "two" : [2,3,4]}The flattened data structure:>>> jsonurl.dict_to_args(d)
{'two.1': '3', 'two.0': '2', 'two.2': '4', 'one': '1'}The query string itself:>>> q = jsonurl.query_string(d)
>>> q
'one=1&two.0=2&two.1=3&two.2=4'This can be comfortably parsed back into a python data structure>>> jsonurl.parse_query(q)
{'two': [2, 3, 4], 'one': 1}We can go on to serialise arbitrarily complex data structures>>> d = {"one" : [ {"two" : 2, "three" : 3}, 4 ]}
>>> q = jsonurl.query_string(d)
>>> q
'one.0.three=3&one.0.two=2&one.1=4'### Escape Charactersjsonurl will also handle url-escaping:>>> q = {"escape_me" : "I'll need escaping"}
>>> s = jsonurl.query_string(q)
>>> s
'escape_me=I%27ll+need+escaping'jsonurl uses “+” for a space instead of %20 to improve readabilityIt also unescapes everything during parse:>>> jsonurl.parse_query(s)
{'escape_me': "I'll need escaping"}Since jsonurl uses “.” as its separator, dictionary keys with “.” in the name are escaped.  We prefix each “.” with another during serialisation:>>> d = {"user.names" : ["richard", "jones"]}
>>> q = jsonurl.query_string(d)
>>> q
'user..names.0=richard&user..names.1=jones'“..” is then converted back during parsing:>>> jsonurl.parse_query(q)
{'user.names': ['richard', 'jones']}### Parameter OrderingIt orders the query parameters, to make it easier to read long query strings:>>> d = {"b" : "last", "a" : [1,2,3]}
>>> jsonurl.query_string(d)
'a.0=1&a.1=2&a.2=3&b=last'
Package: jsonurl-py
AboutThis is a python implementation of jsonurl, an alternative text format which
encodes the same data model in a way that is more suitable for use in URLs.Seehttps://jsonurl.org/and especiallyhttps://github.com/jsonurl/specification/The following optional features are supported:2.9.1Implied Arrays2.9.2Implied Objects2.9.5Distinction between empty object and array2.9.6AQF - Address Bar Query String FriendlyThe following optional features are not yet supported:2.9.3WFU - x-www-form-urlencoded Arrays and Objects2.9.4Implied Object Missing ValuesInstallationpip install jsonurl-pyThe package name is jsonurl_py to avoid confusion with anunrelated jsonurl
packageon pypi which implements an
unrelated syntax. In theory you can install and import both packages without
having them interfere with each other.The project name uses a dash in the name for consistency with the existingjsonurl-jsandjsonurl-javaimplementations.Usageimport jsonurl_py as jsonurl

assert jsonurl.loads('(a:1,b:c)') == {'a': 1, 'b': 'c'}
assert jsonurl.dumps(dict(a=[1,2])) == '(a:(1,2))'Command Line InterfaceThe package includes a command line interface for converting between jsonurl and
standard json:$ echo "(a:b)" | jsonurl-py load
{"a": "b"}
$ echo '{"a":"b"}' | jsonurl-py dump
(a:b)It is also possible to run the executable directly via pipx:$ echo '(a:b)' | pipx run jsonurl-py load
{"a": "b"}DocumentationPublished ongithub pages.Can be built locally usingtox-edocsTestingTests run via github actions.Code coverage for main branch is published ongithub pages.
Package: jsonut
#JSONUTjsonutcan be used to convert json objects to Python data class objects and vice versa.How to UseExamplefromdataclassesimportdataclass,fieldfromtypingimport*importjsonut# Sample Dataclass Object@dataclassclassSampleObject(jsonut.JsonSerializable):name:str=field(default_factory=str)numbers:List[int]=field(default_factory=list)def__eq__(self,other):ifnotisinstance(other,self.__class__):returnFalseifself.name!=other.name:returnFalseifself.numbers!=other.numbers:returnFalsereturnTrue# Create an object# sample_obj = create_sample_object()# Serializationserialized=serialize(sample_obj)# Deserializationdeserialized=deserialize(serialized)How to Deploy to PyPIrefer with:https://packaging.python.org/tutorials/packaging-projects/
Package: jsonutils3
jsonutilsA lib to use json easly.DependenciesPython 3.5+InstallationInstall jsonutils withpip install jsonutils3EnjoyFeaturesModify json by function and by direct key access (set/getfunctions andJsonObject[key])Support dot in access (example :json["config.theme"]=> get value of "theme" in value of "config")Save function + option to save at destructionConvert json to xml (to_xml()function)Uncoming FeaturesClear jsonPropose in issuesChangelogV 1.0.0 - 12/02/2020 (LATEST)First version
Package: jsonvalidate
# JSON Validation Schema<a href="https://travis-ci.org/RobusGauli/jsonvalidate"><img src="https://travis-ci.org/RobusGauli/jsonvalidate.svg?branch=master"></a><a href="https://pypi.python.org/pypi/jsonvalidate"><img src="https://img.shields.io/pypi/v/jsonvalidate.svg"></a><a href="https://jsonvalidate.readthedocs.io/en/latest/?badge=latest"><img src="https://readthedocs.org/projects/jsonvalidate/badge/?version=latest"></a>JSON Validation Schema* Free software:  MIT license* Documentation:  https://jsonvalidate.readthedocs.io.Features------------```pythonfrom jsonvalidate import Object, String, Integerschema = Object({'email': String(regex='[^@]+@[^@]+\.[^@]+'),'name': String(),'age': Integer(enums=[5, 6, 7]),'address': Object({'permanent': String(),'temporary': String(min_length=3, enums=['asss', 's'])})})payload = {'email': 'robus@example.com','name': 'robus','age': 342,'address': {'permanent': 'sd','temporary': 'asss'}}print(schema.check(payload))```=======History=======0.1.0 (2018-06-08)------------------* First release on PyPI.
Package: json-validator
Copyright (c) [2017]Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.Description:
# json_validator
—————–
Package: jsonvalue2markdown
对任意json格式的数据，转换成markdown格式的文本安装pipinstalljsonvalue2markdown用法示例fromjsonvalue2markdownimportJsonValueToMarkdownjson_value={"title":"标题","context":{"subtitle":"副标题","context1":"内容1","context2":"内容2","context6":["内容3","内容4",{"context7":"内容5","context8":"内容6",},{"context9":"内容10"}],"context3":"内容7","context4":"https://www.test.demo.jpg",},}mapping_dict={"title":"h1","subtitle":"h2","context1":"p","context2":"li","context7":"li","context8":"li","context3":"li","context4":"img","context9":"p",}markdown=JsonValueToMarkdown(json_value=json_value,mapping_dict=mapping_dict,title_level=3,).convert()print(markdown)参数说明参数说明json_value需要转换为markdown格式的json数据mapping_dictjson数据中的key与markdown中的标签的映射关系title_level标题的级别，从1开始，最大为6输出结果#标题##副标题内容1*内容2
内容3

内容4*内容5*内容6
内容10*内容7
![](https://www.test.demo.jpg)
Package: json_variable
NutshellThis is a non-standard implementation extending JSON pointers:https://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-04It allows you to reference parts of a JSON document from within the same
documentfrom within a sub-string.In other words, JSON Pointers can handle resolving things like:{
    "a": "foo",
    "b": "/a"
}However, this proposes a newvariablespec requiring an additional
template:{
    "a": "foo",
    "b": "{{/a}}"
}By using a template, we can replace sub-strings:{
    "a": "foo",
    "b": "{{/a}}, bar!"
}ExampleThe motivation for this is to try and share settings between the
front-end and back-end of an application, settings within the same JSON
document can reference each other to prevent repetition. Consider the
following document:{
    "USERNAME_REGEX": "[a-zA-Z0-9._-]{3,30}",
    "USERNAMES_REGEX": "{{/USERNAME_REGEX}}(?:,{{/USERNAME_REGEX}})*",
    "FILE_ID_REGEX": "{{/USERNAME_REGEX}}:\\d+"
}After de-referencing the variables, you get:{
    "USERNAME_REGEX": "[a-zA-Z0-9._-]{3,30}",
    "USERNAMES_REGEX": "[a-zA-Z0-9._-]{3,30}(?:,[a-zA-Z0-9._-]{3,30})*",
    "FILE_ID_REGEX": "[a-zA-Z0-9._-]{3,30}:\\d+"
}The original document is more readable and revisions to the first value
only require changingoneline.
Package: jsonvice
About jsonvicejsonvice is command line tool for minifying JSON with optimal precision truncation/rounding.  In many applications floating point values in JSON can be very long (15 digits or more) but this level of accuracy isn't needed and takes up much space.jsonvice allows the truncation of all the embedded floating point numbers (wherever they appear) to a specified number of digits.It also removes unnecessary white space to minify JSON files.sample_input.json{"x":12.32,"y":0.23482498323433,"z":"simple test","a":[1,2,3.23423434343]}now run jsonvicejsonvice-iinput.json-ooutput.json-p4ouput.json{"x":12.32,"y":0.2348,"z":"simple test","a":[1,2,3.2342]}More Examplescompactify json and reduce floating point precision to max of 5 digits by roundingjsonvice-isample_input.json-ooutput.json-p5compactify json and reduce floating point precision to max of 5 digits by rounding downjsonvice-imyfile.json-ooutput.json-p5-qfloorjsonvice also allows stdin / stdout pipes to be usedcatsimple_test.json|python3path/to/jsonvice.py-i--o->output_test.jsonjsonvice can also beautify (pretty print) json, while still performing precision truncation.  Note this makes the file larger.jsonvice-imyfile.json-ooutput.json-p3-bBuilding and SourceAll source is atjsonvicejsonvice is built with Python using the Poetry packaging and build tool.pip3 install poetry  # if not installed.poetry update
poetry install
poetry buildpoetry run jsonvice ...parameters...Examplepoetryrunjsonvice-iinputfile.json-ooutputfile.json-p4Installing as stand alone commandline toolpip can be used into install jsonvice as stand alone tool (note python 3.6 should or later specified)pipinstalljsonvicepipx installpipx can be used to install a stand alone version of jsonvice as a command line tool. Note pipx is like pip or pip3 but installs programs with their own virtual environment.pipxinstalljsonviceor install from github repopipxinstallgit+https://github.com/deftio/jsonviceNow you can use jsonvice at the commandline without typing python3 like this example:jsonvice -i inputfile.json -o - -bPython version supportPython version 3.6 or higher is required to build jsonvice.  If pipx is used for install isolation takes place automatically.TestingBoth pytest and tox were used to build jsonvice.  Testing can be performed at the command line via either tool:poetryrunpytestortoxHistory & Motivationjson vice started as a script to compactify / minify some large machine learning model files which had large floating point numbers.   By rounding to fixed number of sig digits and then testing the models against testsuites to see the effects of truncation.At the time couldn't find a tool and whipped up small script (the original script is in /dev directory).So jsonvice was built to learn / test practices around the python poetry and pipx tools, for use in other projects, but starting with a small example cli program that already worked.Licensejsonvice uses the BSD-2 open source license
Package: jsonviewer
# jsonviewerprint meta json structure## Install```bashpip install jsonviewer```## Usage```pythonfrom jsonviewer import view_jsonfname = "foo.json"with open(fname) as f:data = json.load(f)view_json(data)```## Demo```<type 'list'>len=1011<type 'dict'>len=7key=joints_vis<type 'list'>len=16data: 1key=scaledata: 3.374796key=center<type 'list'>len=2data: 698key=joints<type 'list'>len=16<type 'list'>len=2data: 694key=imagedata: 4485.jpg```
Package: jsonvl
JsonVLJsonVL is a JSON validator for Python. This project is intended to be a replacement for thejsonschema packagewhich implements theJSON Schema standard. JsonVL's goal is to curate a rich set of validation methods for JSON data types while remaining extensible to new constraints.InstallationInstall the latestPyPI release:pipinstalljsonvlUsageValidate JSON files from the command linejsonvldata.jsonschema.jsonValidate JSON files in Pythonfromjsonvlimportvalidate_filevalidate_file('data.json','schema.json')Validate in-memory JSON data in Pythonfromjsonvlimportvalidatevalidate(data,schema)DocumentationThe JsonVL documentation is hosted byRead the Docsand is a work in progress.ExampleBelow is an example pair of JSON data and JSON schema. More examples can be found in theexamplesfolder.Data{"play":"A Midsummer Night's Dream","characters":[{"name":"Helena","loves":["Demitrius"]},{"name":"Demitrius","loves":["Hermia","Helena"]},{"name":"Hermia","loves":["Lysander"]},{"name":"Lysander","loves":["Hermia","Helena","Hermia"]},{"name":"Titania","loves":["Oberon","Bottom","Oberon"]},{"name":"Oberon","loves":["Titania"]},{"name":"Bottom","loves":[]},{"name":"Puck","loves":[]}]}Schema{"type":"object","attr":{"play":"string","characters":{"type":"array","cons":{"unique":"@all.name"},"elem":{"type":"object","attr":{"name":"#name","loves":{"type":"array","elem":"#name","cons":{"max_size":4}}}}}},"defs":{"#name":{"type":"string","cons":{"format":{"type":"regex","pattern":"[A-Z][a-z]{0,10}"}}}}}
Package: jsonway
JSONWAYJsonway is the one stop to manage the JSON using the python . All the operations can be done using the JSONway .Installationpip install jsonwayUsageSample JSON{
  "store": {
    "book": [
      {
        "category": "reference",
        "author": "Nigel Rees",
        "title": "Sayings of the Century",
        "price": 8.95
      },
      {
        "category": "fiction",
        "author": "Evelyn Waugh",
        "title": "Sword of Honour",
        "price": 12.99
      }
    ],
    "bicycle": {
      "color": "red",
      "price": 19.95
    }
  },
  "expensive": 10
}Lets say , we have to find the nested key author in the above JSONimport json
from jsonway.mainjsonway import *
with open('sample.json') as json_file:
    data = json.load(json_file)

print(list(findkey('author', data, []))) 
# output :[['store', 'book', 0, 'author'], ['store', 'book', 1, 'author'], ['store', 'book', 2, 'author'], ['store', 'book', 3, 'author']]if you want to find the key and  value thenprint(list(findkeyvalue("title", data, [], "Sayings of the Century")))if you want to find value thenprint(list(findvalue("Sayings of the Century", data, [])))if you want to get the value from a path  then
the path must be in the list formgetFromDict(data, ['store', 'book', 0, 'author'])if you want to set the value at a particular key  thensetInDict(dataDict, mapList, value)to find all the keys  values thenprint(list(findallvalues('title', data)))
output : ['Sayings of the Century', 'Sword of Honour', 'Moby Dick', 'The Lord of the Rings']
Package: jsonwebtoken
A Python implementation ofRFC 7519. From from@jpadilla. Original implementation was written by@progrium.InstallingInstall withpip:$pipinstalljsonwebtokenUsage>>>importjsonwebtoken>>>encoded=jsonwebtoken.encode({"some":"payload"},"secret",algorithm="HS256")>>>print(encoded)eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzb21lIjoicGF5bG9hZCJ9.4twFt5NiznN84AWoo1d7KO1T_yoc0Z6XOpOVswacPZg>>>jsonwebtken.decode(encoded,"secret",algorithms=["HS256"]){'some': 'payload'}DocumentationView the full docs online at coming soon
Package: jsonwidget
jsonwidget is a general-purpose JSON validation and manipulation library.  This
library provides the following functions for applications:Validation of JSON-compatible data against a schemaAutomatic generation of a schema from JSON-compatible dataConstruction of a curses-based tree data editing user interface from a schemaConstruction of a Javascript-based web tree data editing user interface
from a schemaSimple WSGI server to serve the web user interface, and validate and store
result of editing with the web user interfaceThough jsonwidget is optimized for working with JSON, it is useful for
providing editing capability for any JSON-compatible data structure.The following utilities are included with jsonwidget:jsonedit - A terminal-based application (like you would use via SSH or
local terminal on Linux and Mac). It’s based on urwid, an excellent
Python-based library for building terminal-based user interfaces.csvedit - A variation on jsonedit that allows editing of .csv/tsv files.jsonaddress - an example JSON address book editorjwc - a command line utility with the following functions:editserver - launch a web server to edit a json file from a browserjson2yaml - convert a json file to yaml with comments pulled from schema
(also yaml2json to go back)schemagen - create a schema from an example json filevalidate - validate a JSON file against a schemaWebsite:http://robla.net/jsonwidget
Package: json-with-comments
JSON with Comments for PythonFeaturesload(),loads()Remove single line (//) and block comments (/* */)Remove trailing commas from arrays and objectsdump(),dumps()Add commentsAdd trailing commasUsagepipinstalljson-with-comments>>>importjsonc>>>jsonc.loads("{// comment\n}"){}>>>jsonc.loads("{/* comment */}"){}>>>jsonc.loads('{"spam": "ham // egg" /* comment */}'){'spam':'ham // egg'}>>>jsonc.loads('{"spam": /* comment */"ham /* egg */"}'){'spam':'ham /* egg */'}And just likejsonmodule
Package: jsonwiz
jsonwizðŸ—· A command line utility for manipulating JSON filesOverviewInstallationUsageCommandsArgumentsPass JSON valuesPass ArraysOverviewjsonwiz is a command-line tool for working with JSON files. You can retrieve, modify, add or delete any value in the JSON file, then save the changes back to disk. To access a specific property deep in the tree, you can navigate nested objects and arrays using the dot (.) or slash (/) syntax.Installationjsonwiz can be installed via pip through PyPipip install jsonwizUsageOnce jsonwiz is installed, you can use the following command to interact with the clijsonwiz COMMAND [FILE] [PATH] [VALUE] [--ARGS]COMMANDCommand to runFILEPath to JSON filePATHKey name or path (dot notation or slash notation)VALUEThe new value for `set` commandARGSOptional arguments to pass. Check belowExamplejsonwiz set example.json person.name "John" --type stringThis would write anamekey into thepersonobject, and set the value toJohnas a string"person":{"name":"John"}CommandsgetThegetcommand fetches an existing value, and outputs it to the console.jsonwiz get example.json person.namesetThesetcommand will create or replace a key. If the key exists, it will override the exisiting value. It also automatically creates any parent objects if necessary.jsonwiz set example.json person.age 32 --type stringThe data type of the new value is guessed by the format. To assert required data type, pass the--typeargument.Read about it here.deleteThedeletecommand will delete an existing key, and fail if the key or any parent objects don't exist.jsonwiz delete example.json person.agevalidateThevalidatecommand simply checks if the input JSON is valid or not.jsonwiz validate example.jsonArguments--typeThe--typeis an optional argument to specify the data type of the new value. To be used with thesetcommand.Supported types are -string,integer,float,boolean,nullandobjectExample: Pass abooleanvaluejsonwiz set example.json person.subscribed true --type booleanOutput:{"person":{"name":"John","subscribed":true}}Pass JSON valuesIt is possible to add entire JSON fragments to your file by replacing an existing object/creating a new object. Recommended to use--typeobject to correctly parse your value as JSON when applying to the document.Make sure to properly escape your quotes when attempting this.jsonwiz set example.json person.address '{\"city\":\"Mumbai\"}' --type objectOutput:"person":{"address":{"city":"Mumbai"}}Pass ArraysYou can traverse arrays just like any other object, simply by specifying the array index as the key. Make sure to use--typeobject for array insertions to work properly.Make sure to properly escape your quotes when attempting this.Sample JSON{"person":{"address":{"city":"Mumbai"},"items":[{"name":"item1"},{"name":"item2"}]}}getjsonwiz get example.json person.items.0.namesetCreate empty arrayjsonwiz get example.json person.jobs [] --type objectCreate arrays with no stringsjsonwiz get example.json person.jobs [1,2,3] --type objectCreate arrays with string valuesjsonwiz my_list '[\"value1\", \"value2\", \"value3\"]' --type object
Package: json-work-manager
json-work-managerhttps://pypi.org/project/json-work-managerpip install json-work-managerExamplesBasichttps://github.com/automatethem/json-work-manager/blob/main/examples/basic/json_work.pyhttps://github.com/automatethem/json-work-manager/blob/main/examples/basic/config.jsonChromehttps://github.com/automatethem/json-work-manager/blob/main/examples/basic_chrome/json_work.pyhttps://github.com/automatethem/json-work-manager/blob/main/examples/basic_chrome/config.jsonhttps://github.com/automatethem/json-work-manager/blob/main/examples/basic_chrome/bin/start_chrome_controlled.bat
Package: jsonwriter
JSON WriterEasy package to write JSON filesAboutjsonwriteris an easy JSON writer, when i say easy i mean super easyMade byNawaf Alqariin 2021InstallationPIPpipinstalljsonwriterExamplesInitialize your file:If you set autosave toTrueevery change you make will be automatically savedfromjsonwriterimportfilefile=file('filename.json',autosave=True)file.set('key','value')# This will be saved automaticallyIf you don't use autosave you have to addfile.save()whenever you want to save your changesfromjsonwriterimportfilefile=file('filename.json',autosave=False)file.set('key','value')file.set('key2','value2')file.save()# Now, it will be savedFunctionsLet's say this is our file content:{"name":"Nawaf","age":10}get(key)file.get('name')# Will return Nawaffile.get('age')# Will return 10set(key, value)file.set('Skills',['Sleeping','Coding'],indent=3)# indentation will make it more readable# 3 is recommended/default value# set() Can also update valuesfile.set('age',100)File will get updated to{"name":"Nawaf","age":100,"Skills":["Sleeping","Coding"]}If we set the indentation to0this is what we will get{"name":"Nawaf","age":100,"Skills":["Sleeping","Coding"]}remove(key)file.remove('name')# This will just remove "name": "Nawaf"clear()file.clear()# Warning! This will remove everything from your filehasKey(key)file.hasKey('age')# return TruehasValue(value)file.hasValue(10)# return TruehasAll(key or value)file.hasAll('age')# return Truefile.hasAll(10)# return TrueAttributesfromjsonwriterimportfilefile=file('filename.json',autosave=True)print(file.content)# This will show your file content# Note: if you are not using autosave this will show all the changes, even if they are not savedprint(file.keys)# This will show all the keysprint(file.values)# This will show all the values