Saravanan666/pypi-org huggingface dataset:
Package: py-json-config
JSONConfigJSONConfig was created to use .json files as configsYou can create own functions to get values from the config and update valuesHow can i use it?Use this command to install the module$>pip3installpy_json_configSimple tutorialWe are going to create someConfigto add and get adminsCreateconfig.jsonfile in the root directory with content like this{"admins":[]}Import the module into your main .py fileimportpy_json_configThen you need to create some class with extend by the moduleclassConfig(py_json_config.JSONConfig):defget_admins(self):returnself.get_value('admins')defadd_admin(self,admin):admins=self.get_admins()admins.append(admin)self.set_value('admins',admins)That`s it! Now let`s test itconfig=Config('.config.json')config.get_admins()# []config.add_admin(123)config.get_admins()# [123]Now you can create own functions but you don`t know a main featureTo get or update values you need to point thepath, but if u have a complex structure you can use the "dot" operator like this:# the structure## {#     "main": {#         "sub_main": {#             "admins": []#         }#     }# }classConfig(py_json_config.JSONConfig):defget_admins(self):returnself.get_value('main.sub_main.admins')defadd_admin(self,admin):admins=self.get_admins()admins.append(admin)self.set_value('main.sub_main.admins',admins)Ther are also others functions here:self._get_schemeget data as dict of .json configself._save_schemesave data into .json configself.set_valueupdate value of .json configself.get_valueget value of .json config
Package: pyjsondb
PyJsonDBHow to use it?importpyjsondbasdbdb.init("database")Create a tabletable=db.Table("table_name")# set the different fieldstable.set_fields(["name","age","etc"])adding itemtable.add(["pyjsondb",13,"python"])Remove itemtable.remove_by_id(1)# filteringdelete_item=table.filter_by({"age":13})table.delete(delete_item)
Package: pyjsonedit
pyJsonEditEdit parts of inconsistently formatted json.It's just a bit slower that doing this by hand!matcherNow you can easly selectnodesin json treesyntax:selectoractionnode typecomments*selectallitems in current node-[n]selectn-thitem of curent nodearray{n}selectn-thitem of curent nodeobjectkeyselect node chilldby nameobject"key"select node chilldby nameobject>mark current node as seleced-a=bcheck if current node has child 'a' with value 'b'object:beforeadd text before selected node-must at end of pattern:afteradd text after selected node-must at end of patternexample 1:key > [0]this pattern will match one element by:selecting "key" element in root node (assuring that is an object)select first element in it (assumintg its an array)example 2:name > *this pattern will match multiple elements by:selecting "name" element in root node (assuring that is an object)select all element in ithow to installpipinstall--upgradepyjsoneditpython moduleimportpyjsoneditcomand line - mark$pyjsonedit-mask--helpUsage: pyjsonedit-mask [OPTIONS] PATTERN [JSONS]...

  Select and mask parts of json

Options:
  --symbol TEXT
  -i, --insert   save changes to file
  --help         Show this message and exit.example:pyjsonedit-mask "pass" "{'pass':123}"
{'pass':XXX}comand line - modify$pyjsonedit-modify--helpUsage: pyjsonedit-modify [OPTIONS] PATTERN TEMPLATE [JSONS]...

  select and modify parts of json

Options:
  -i, --insert  save changes to file
  --help        Show this message and exit.example 1: simple stringpyjsonedit-modify "pass" 'P@$W&$d' "{'pass':123}"
{'pass':P@$W&$d}example 2: python code:file/home/dave/somefile.py#!/usr/bin/python3defmodify(node,ctx):return"'<"+str(1)+">'"node - matched nodectx - context in witch node was matched: file_name & match_nrpyjsonedit-modify"*"/home/dave/somefile.py"{'a':1}"{'a':'<1>'}example: mask multiple nodes$ pyjsonedit-mask **"quiz > * > q1 >*"** DOC/example.json{
    "quiz": {
        "sport": {
            "q1": {
                "question": XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
                "options": XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
                "answer": XXXXXXXXXXXXXXX
            }
        },
        "maths": {
            "q1": {
                "question": XXXXXXXXXXX,
                "options": XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX,
                "answer": XXXX
            },
            "q2": {
                "question": "12 - 8 = ?",
                "options": [
                    "1",
                    "2",
                    "3",
                    "4"
                ],
                "answer": "4"
            }
        }
    }
}example: mask selected nodes$importpyjsonedit$pyjsonedit.string_match_mark("{'pass':123}","pass"){'pass':XXX}project stats
Package: pyjsonlines
A Python library to convertJsontoJsonlinesandJsonlinestoJson. This library is helpful to
convertndjsontoJsonand vice versa too.InstallationUser can installpyjsonlineseither via thePython Package Index
(PyPI)or fromsource.Install using pippip install pyjsonlinesHow to useThis library contains two APIs to convert data:json2jsonl(in_take, file=None)jsonl2json(in_take, file=None)json2jsonl(in_take, file=None)User should use this API incase to convert Json to Jsonlines or ndjson.
User has to pass valid Json to this API, which is passed toin_takeargument. User can either pass a Json file or Json object to convert to
Jsonlines. The other argument,fileis optional. It’s required when
user wants to store the converted Jsonlines or ndjson data to a file.
Full path of file along with name is suggested to pass.jsonl2json(in_take, file=None)User should use this API incase to convert Jsonlines or ndjson to Json.
User has to pass valid Jsonlines to this API, which is passed toin_takeargument. User can either pass a Jsonlines file or Jsonlines
object to convert to Json. The other argument,fileis optional.
It’s required when user wants to store the converted Json data to a
file. Full path of file along with name is suggested to pass.
Package: pyjsonmodel
jsonModeljson数据转为实体类的工具python版本2.7 ~ 3.8安装包被上传到pypi使用pip安装：$ pip install pyjsonmodel或 更新包$ pip install pyjsonmodel --update使用方法# 模型classGModel:sss=NoneclassZModel:aaa=NoneclassPeople:name=Noneage=NonegirlFriends=Nonezzz=NonetestList=None# 这里指定属性类型__doc__={"girlFriends":GModel,"zzz":ZModel}# 引用importjsonModeldata='[{"testList":[1, 2, 3],"name":"jack","age":13,"girlFriends":[{"sss":"111"},{"sss":"222"}],"zzz":{"aaa":"aaa"}},{"testList":[1, 2, 3],"name":"jone","age":21,"girlFriends":[{"sss":"111"},{"sss":"222"}],"zzz":{"aaa":"aaa"}}]'# json 转 实体类res=jsonModel.loads(data,People)# 实体类 转 jsonjsonStr=jsonModel.dumps(res)
Package: pyjsonpath
Python JsonPathA Python tool that parses JSON documents using JsonPathInspired by:https://github.com/json-path/JsonPathQuick Startinstall it using the pip commandpip install pyjsonpathThen:>>> from pyjsonpath import JsonPath
>>> obj = {"name": "jsonpath"}
>>> JsonPath(obj, "$.name").load()
['jsonpath']
>>>JsonPath SyntaxGeneral Operatorsoperatorsdescription$The root element to query. This starts all path expressions.@The current node being processed by a filter predicate.*Wildcard. Available anywhere a name or numeric are required...Deep scan. Available anywhere a name is required..Dot-notated child['<name>' (, '<name>')]Bracket-notated child or children[<number> (, <number>)]Array index or indexes[start:end]Array slice operator[?(<expression>)]Filter expression. Expression must evaluate to a boolean value.Filter Operatorsoperatorsdescription==left is equal to right (note that 1 is not equal to '1')!=left is not equal to right<left is less than right<=left is less or equal to right>left is greater than right>=left is greater than or equal to right=~left matches regular expression [?(@.name =~ /foo.*?/i)]inleft exists in right [?(@.size in ['S', 'M'])]ninleft does not exists in rightsubsetofleft is a subset of right [?(@.sizes subsetof ['S', 'M', 'L'])]anyofleft has an intersection with right [?(@.sizes anyof ['M', 'L'])]noneofleft has no intersection with right [?(@.sizes noneof ['M', 'L'])]sizesize of left (array or string) should match rightemptyleft (array or string) should be emptyFunctionsoperatorsdescriptionmin()Provides the min value of an array of numbersmax()Provides the max value of an array of numbersavg()Provides the average value of an array of numbersstddev()Provides the standard deviation value of an array of numberslength()Provides the length of an arraysum()Provides the sum value of an array of numberskeys()Provides the property keys (An alternative for terminal tilde ~)
Package: pyjsonquery
PyJsonQuery(pyjsonq)PyJsonQ is an easy to use and package to query json data.
It is a rewrite of the Go package "GoJSONQ" which you can find here:GoJSONQ Github RepositoryI decided to rewrite this package in Python because I love it's
simple API and is just a beauty to work with.FutureOver time I will potentially update this package and add more fun and
useful stuff to it, but for now the only thing I added are two
operators for theWheremethod:holds,notHoldsInstallationpipinstallpyjsonqueryUsageFirst import theJsonQueryclass into your projectfrompyjsonqimportJsonQueryNext create a new JsonQuery instance and load the data into the query
using eitherFile / file,String / string,TOMLFile / toml_file,TOMLString / toml_stringorRaw / raw.jq:JsonQuery=JsonQuery().String("""{"city": "dhaka","type": "weekly","temperatures": [30,39.9,35.4,33.5,31.6,33.2,30.7]}""")# ORjq:JsonQuery=JsonQuery().File("./file.json")Once you created your query object you can then query over it using
a variety of methods. Here is a quick example:avg_temp:float=jq.At("temperatures").Avg()print(avg_temp)# 33.471428571428575city_name:str=jq.Find("city")print(city_name)# dhakaYou can query over the json using various methods such asFind,First,Nth,Pluck,Where,OrWhere,WhereIn,Sort,SortBy,Drop,
etc.You can also aggregate your data after a query usingAvg,Count,Max,Min,
etc.An overview over all query functions can be found in thewiki page
Package: py-jsonrpc-lite
py-jsonrpc-lite===============.. image:: https://travis-ci.org/r3code/py-jsonrpc-lite.svg?branch=master:target: https://travis-ci.org/r3code/py-jsonrpc-lite:alt: Build Status.. image:: https://codecov.io/gh/r3code/py-jsonrpc-lite/branch/master/graph/badge.svg:target: https://codecov.io/gh/r3code/py-jsonrpc-lite:alt: Coverage Status.. image:: https://api.codacy.com/project/badge/Grade/acf5dba2b46242a1a85d171f884f3993:target: https://www.codacy.com/app/r3code/py-jsonrpc-lite:alt: Code Quality StatusInspired by https://www.npmjs.com/package/jsonrpc-liteA implementation of py-jsonrpc-lite 2.0 specifications <http://www.jsonrpc.org/specification>This implementation does not have any transport functionality realization, only protocol.#todo: Documentation: http://py-jsonrpc-lite.readthedocs.orgInstall-------pip install py-jsonrpc-liteTests-----python -m unittest discover -s "tests" -p "test*.py"Features--------- Vanilla python, no dependencies- JSON-RPC 2.0 supportTesting-------py-jsonrpc-lite is a python library, it supports pythons:  2.7.
Package: py-json-serialize
py-json-serializeSerialize in JSON formatFeatures:Simple api: @json_serialize, to_json(), from_json();Version support: version-based data migration;Installpipinstallpy-json-serializeTestin the project's root folder, run pytest:pytestDependenciesNoneAPIclass decortator@json_serializeformat 1: no parameterfrompy_json_serializeimportjson_serialize@json_serializeclassA(object):passformat 2: with parameter@json_serialize(clsid = "", [version=0*|n])clsid: the unique string to identify the class. the class-id will be the name of decorated if
not specified.version: optional parameter to specify the version of serialized data format. the default value
is0if not specified.frompy_json_serializeimportjson_serialize# old version@json_serialize("app-config",version=1)classAppConfigV1(object):servers=[]# new version@json_serialize("app-config",version=2)classAppConfigV2(AppConfigV1):timeout=600to_json()/from_json()The decorated class will have two new functions:to_json(): convert class instance to json string@json_serializeclassHello(object):def__init__(self,who="World"):self.who=whoa=Hello()print(a.to_json())outputs:{"_clsid_":"Hello","who":"World"}from_json(str|dict): reads json string or dictionary object to return an class object.It is actually astaticmethodthat can be called to return an object of any type deduced from the class-id in the data string.
so don't be surprised that you might get an object of different type if the input json data string is serialized from another class.So the from_json() is simply a handy helper method to make your code more readable if your app only handles one type of data.functionjson_decode(jstr: str|dict)-> object: convert json string or dictionary to python objectThis is a function to decode the serialized json string, its typical usage is as following:classTask(object):pass@staticmethoddeffrom_json(jstr):returnjson_decode(jstr)@json_serializeclassCopyFile(Task):pass@json_serializeclassUploadFile(Task):passtask1=Task.from_json({CLASS_ID:'CopyFile'})assertisinstance(task1,CopyFile)task2=Task.from_json({CLASS_ID:'UploadFile'})assertisinstance(task2,UploadFile)functionjson_encode: convert python object to json stringdefjson_encode(obj,pretty=True,encode_all_fields=False)Whenprettyis True, the fields are sorted by their name and the json string
is intented properly for human reading, otherwise the json string can save some
storage space and more efficient for machine processing.Ifencode_all_fieldsis true, then all class fields are serialized, otherwise
the internal fields (field name starts with '_') are ignored.CLASS_ID: the unique key indicating which class is serialized.It is published in case a json string or dictionary object needs to be
prepared manually as input to json_decode()/from_json().The internal constant value ofCLASS_IDis "_CLSID_"json_decode({CLASS_ID:"Hello",who:"World"})json_decode('{ "%s": "Hello", "who": "World" }'%CLASS_ID)
Package: pyjsontools
NoteTo get a better overview visitJSONtools documentation webpage.JSONtoolsHere are all the tools that I found myself writing many times to make minimal changes in JSON structured data.From now on, if I have to write something to manipulate anyjsonifiedAPI response I will try to make it general enough to keep adding functionalities here.How to contributeIf anyone is willing to contribute that is always good news. The only rule is that you can only use Pythonbuiltinsbecause this package must be small enough to not have any dependency (so you can install it and use as any otherbuiltin tools).JSON related tools this is not replacingWhile working with JSONs I have found many tools that I really like and use, like:jq: Fast and furious command line utility to query JSON structured data.orjson: Likebuiltinjsonlibrary but much faster and supporting many more Python types.This is not replacing any of those tools, it does not pretend being so powerful. This is just a collection of handy functions.
Package: py-json-to-proto
PyJsonToProtoThanks for checking out PyJsonToProto, this is a port ofhttps://github.com/json-to-proto/json-to-proto.github.ioin to Python to be used in a number of applications using ProtobufsInstallationThis package is published as a pip installable package.pipinstallpy_json_to_protoHow to useCLI usageThe CLI is the name of the project abbreviated asjsp.  Why? Try typingpy_json_to_protoa ton of timesHELP:usage:jsp.exe[-h][--google_timestampGOOGLE_TIMESTAMP][--inlineINLINE][--input_fileINPUT_FILE][--output_fileOUTPUT_FILE]optionalarguments:-h,--helpshowthishelpmessageandexit--google_timestampGOOGLE_TIMESTAMPAddtimestamptoimportsifinjson--inlineINLINEunsure...thiscoulduseacontribution--input_fileINPUT_FILE,-iINPUT_FILETheinputfiletoconvert--output_fileOUTPUT_FILE,-oOUTPUT_FILEThelocationtosavetheprotosjsp--input_file="test.json"--output_file="yolo.proto"The input file usedtest.json{"id":23357588,"node_id":"MDEwOlJlcG9zaXRvcnkyMzM1NzU4OA==","name":"protobuf","full_name":"protocolbuffers/protobuf","private":false,"arg2":1009,"arg1":11124}The output of the fileyolo.protosyntax="proto3";messageSomeMessage{uint32id=1;stringnode_id=2;stringname=3;stringfull_name=4;uint32private=5;uint32arg2=6;uint32arg1=7;}Code UsageI would take a look at the cli code incli.pyto get a better feel.frompy_json_to_proto.convertimportconvert,Options# Read in your json file and then convert to proto stringwithopen('test.json'),'r')asfile:data=convert(file.read(),Options(False,False))# You're done, save the proto stringwithopen(args.output_file,'w')asfile:file.write(str(data))Authors:Benjamin Garrard
Package: pyjsonutils
PyJSONUtilsA Python library for using JSON files.UsageTo open a file:frompyjsonutilsimportpyjsonutilspyjsonutils.open_file_as_dict("file_path.json")To write to a file:frompyjsonutilsimportpyjsonutilspyjsonutils.write_dict_to_file(dictionary,"file_path.json")To update a JSON file:frompyjsonutilsimportpyjsonutilspyjsonutils.update_json_file("file_path.json")Find the first key having a given value:frompyjsonutilsimportpyjsonutilspyjsonutils.find_key_from_value(dictionary,value)Create a default value for a key if the key does not exist:frompyjsonutilsimportpyjsonutilspyjsonutils.create_default_if_key_not_there(dictionary,key,default_value)
Package: py-js-runner
JS RunnerRun JavaScript From Python.Installingpip3 install py_js_runnerHow To UseNotepy_js_runner Uses Node.JS To Run JavaScript Code.So Make Sure Node.JS Is Installed.JavaScriptimportpy_js_runner# Check If Node.JS Is Installed.py_js_runner.javascript().check_node()# Gives Error If Not Installed.# Run JavaScriptpy_js_runner.javascript().run("""// Some JavaScript Comments.// Blah Blah// Print Sometingconsole.log('hello from javascript with python!');// Some More JavaScript Comments.// Blah Blah""")NPMimportpy_js_runner# Check If NPM Is Installed.py_js_runner.npm().check_npm()# Gives Error If Not Installed.# Command Line Arguments For NPM# This Line Will Execute: npm helppy_js_runner.npm().npm_cli("help")# Check If A NPM Package.print(py_js_runner.npm().check_if_npm_package())# Returns Boolean.# You Can Also Specify Directory To Check If A NPM Package.print(py_js_runner.npm().check_if_npm_package("./somedirectory"))# Create NPM Packagepy_js_runner.npm().init_npm_package("MY_HELPFUL_PACKAGE_NAME")# Default Parameters:# license: str = "MIT"# author: str = ""# description: str = ""# version: str = "1.0.0"# main: str = "index.js"# npm_package_path: str = "./"# Install Packagespy_js_runner.npm().install_packages("nodemon vite")# Run: npm installpy_js_runner.npm().install()# Uninstall Packagespy_js_runner.npm().uninstall("nodemon vite")# Remove NPM Package.py_js_runner.npm().remove_npm_package()# You Can Specify Path.
Package: pyjst
# pyjstBake a template from corresponding JSON object## How to useInstall (Python 3) : `pip install pyjst`Create a project directory with given structure :- project_name/- datas/- templates/In **templates/** you can put templates with extension **.html**. In **datas/** you can putcorresponding data with extension **.json**. What this module does is simply render asked template_name.html_ with corresponding data _name.json_. The output is generated in folder **output/**.For instance let this file tree :- example/- datas/- example.json- another.json- templates/- example.html- another.htmlSo go into your project folder : `cd example`Then generate your static page _example_ : `pyjst example`Or generate static page _another_ : `pyjst another`Done !
Package: pyjstage
pyjstageOverviewJ-STAGE WebAPIWrapper for Python3.J-STAGE is an electronic journal platform for science and technology information in Japan, developed and managed by the Japan Science and Technology Agency (JST).PrerequisitesPython >= 3.6Setup$pipinstallpyjstageUsageYou can try this library like this:frompyjstage.pyjstageimportPyjstagejstage=Pyjstage()ret_search=jstage.search(issn='2186-6619',count=1)ret_list=jstage.list(issn='2186-6619')# ret_(search/list) is a (Search/List)Result Object.If you need more information, see function-definitions in jstage/jstage.py (Sorry for no documentation... I'll write later.)LicenseMIT License, seeLICENSEfile.
Package: pyjt
pyjt - test java UI applications from pythonpyjt supports you testing java UI applications from python.Features:Thread safe call of java ui componentsAdvanced locators to find ui compoments within the component treeSimulate real user interactions by mouse and keyboardThis library makes use ofjpypeas the interface to the java
virtual machine. It basicaly consists of helper functions to
control the application from a test automation perspective.QuickstartInstall pyjtpip3 install pyjtStart testing your appimport pyjt

pyjt.start()

from javax.swing import JButton

# start your java application here, in this case, we start
# a hello world application located in HelloWorld.java
pyjt.start(classpath="myapp/")
pyjt.run("HelloWorld")

# find the frame window titled "Hello World"
frame = pyjt.FrameFinder.find(title="Hello World")

# Locate and click a button on the frame
frame.locate(JButton, text="Ok").click()

# Locate and fill text to an text field
frame.find_by_xpath('//JTextField[@name="textfield1"]').fill("John Smith")

# Close the frame (application)
frame.close()Further documentationCheck thedocumentation on rtfd.io
Package: pyjudi-tjpr
Pyjudi TJPRUm helper para efetuar login no sistema do projudi do paraná (projudi.tjpr.jus.br) utilizando autenticação de dois fatores com um usuários do tipo "Advogados e partes" que possuem acesso com CPF/CNPJ.Installpip3installpyjudi-tjprExamplefrompyjudi_tjprimportAuthenticatorprojudi_auth=Authenticator(# Nome de usuário do projudi (cpf)username='1234567891',# Senha de acessopassword='demo1234',# Token secreto do Google autenticator para geração do token baseado em tempotwofactor_secret='ABCDE1FGHIJKLMNOPQ2RS3TUVXWYZA4B')# Retorna uma sessão autenticada no projudisession=projudi_auth.get_logged_session()# Retorna um dicionário com os cookies da sessãocookies=projudi_auth.get_session_cookies(session)LicenseMIT License
Package: py-jugaad-aws
py-jugaad-awsThe Jugaad libraries are designed to be minimalist but effective in providing essential frameworks to help build multi-tenant SaaS platforms.The python libraries in this package ease development of APIs and event driven apps for AWS serverless architecture and is primarily tested with AWS Chalice framework.Usage GuideLoggingfrom jugaad_aws import log
logger = log.STLogger.getLogger(__name__)
logger.info("useful logs...")The logger instance created above is same as the logger instance available from the packageloggingApp Configurationfrom jugaad_aws import config
testvalue = config.getStaticConfig("testKey","DEFAULT_VALUE")
testDynValue = config.getDynamicConfig("testDynKey","DEFAULT_VALUE")The config instance has two main methods:getStaticConfig- This method looks for the provided configuration key (testKeyin the example above) in the following sequence:Under the specific path within AWS Parameter Store -/APP_CONFIG_STATIC/<App Name>/. The app name is read from aconfig.inifile present under the app root folder.Environment variableAconfig.iniunder the root folder of the app.
An optionalDEFAULT_VALUEcan be provided to the method to return the default if the configuration is not found in any of the mentioned locations.getDynamicConfig- This method looks for the provided configuration key (testDynKeyin the example above) from the AWS Parameter Store -/APP_CONFIG_DYNAMIC/<App Name>. The app name is read from aconfig.inifile present under the app root folder.HTTP ClientMiddleware
Package: pyjuggling
PyjugglingSee theexamplesto get a good feel for what Pyjuggling offers. Documentation can be found RTD:http://pyjuggling.readthedocs.org/en/latest/Features:TBDExampleTBDInstallationTo install pyjuggling, simply:$ pip install pyjugglingLicensePyjuggling is licensed under the MIT License, see theLICENSE.ContributeIf you’d like to contribute, simply forkthe repository, commit your changes
to themasterbranch (or branch off of it), and send a pull request. Make
sure you add yourself toAUTHORS.RoadmapTBDHistory0.1.0 (2016-06-11)Initial Commit!