Saravanan666/pypi-org huggingface dataset:
Package: simplerestapi
SimpleRestApiSimpleRestAPI is the library for launch REST API based on your SQLAlchemy models.Documentation:https://simplerestapi.readthedocs.io/en/latest/FeaturesMinimum code. You don't need create any endpoints. All of you need is your SQLAlchemy models.You can customize your endpoints. For example, you can deny some methods or customize the endpoint's path.Under hood SimpleApi use Starlette.Installationpip install simplerestapiAlso you need install uvicorn.pip install uvicornUsageCreatemodels.pyfromsqlalchemyimportColumn,Integer,String,create_enginefromsqlalchemy.ext.declarativeimportdeclarative_basefromsimplerestapi.endpointimportConstructEndpoint,EndpointBase=declarative_base(metaclass=ConstructEndpoint)classCustomUser(Base,Endpoint):id=Column(Integer,primary_key=True)name=Column(String)surname=Column(String)age=Column(Integer)classCar(Base,Endpoint):id=Column(Integer,primary_key=True)name_model=Column(String)production=Column(String)year=Column(Integer)You need to addmetaclass=ConstructEndpointto parametersdeclarative_baseand to inherit your table class fromEndpoint.You don't need to add attribute__tablename__to your table class, because the name of the table is constructed automatic likecls.__name__.lower().You can addclass ConfigEndpointto config your endpoint, for more information seeConfiguration endpoint.Createapp.pyimportosimportuvicornimportmodelsfromsimplerestapi.mainimportSimpleApiapp=SimpleApi(models,db='postgresql://db_user:db_pass@127.0.0.1/db_name')You can use the parameterdebug=Falseto turn off debug mode.Run applicationuvicorn app:app.app --reloadINFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)INFO:     Started reloader process [250901] using statreloadINFO:     Started server process [250903]INFO:     Waiting for application startup.INFO:     Application startup complete.Use REST APIYou can use methods GET, POST, PUT, PATCH, DELETE in endpoints:http://127.0.0.1:8000/car- GET for retrieve list ofmodels.Caritems, support filters, example?name=SomeName, POST for create new item in DB.http://127.0.0.1:8000/car/1- GET for retrieve one item with id=1, also you can use PUT, PATCH for update item, DELETE for delete item from DB.Similar endpoints are availible for all you models.
Package: simple-rest-call
simple_rest_callThis module wrapsRequestsinto a simple call,
specifically for JSON-request and JSON-response with datetime support. By default,
Windows single sign-on authentication is used for convenience in enterprise environment.rest(url:str,data=None,method:str='POST',auth=(None,None),**kwargs)url:The URL for the RESTful call.data:The payload to be passed in the request body. Any incoming Python object will be encoded as JSON content
except it is already a string or bytes.Content-Type:application/json;charset=utf-8will be added into
the request header if the object is converted to JSON inside this function.method:(default:POST) Method for the request:GET,POST,PUT,PATCH,DELETE,OPTIONS, orHEAD.auth:(The user’s default credentials are used for Windows single sign-on by default)Auth tuple to enable Basic/Digest/Custom HTTP Auth.kwargs:(optional) Please refer tohttps://requests.readthedocs.iofor other optional arguments.return:A JSON decoded object if the response content type is a valid JSON, otherwise the text content will be tried to return.A quick example can be found fromhttps://github.com/DataBooster/PyWebApi/blob/master/Sample/UserApps/MdxReader/mdx_task.pyHomepage and documentation:https://github.com/DataBooster/PyWebApiCopyright (c) 2020 Abel ChengLicense: MIT
Package: simple-rest-server
simple rest serverAn easy and simple way to test api flows.test method exampledeftest_mock_with_callback(server):# Arrangepayload="poop"url="/test"server.add_callback_response(url,lambda:payload)# Actresponse=requests.get(server.base_url+url)# Assertassert200==response.status_codeassertpayload==response.data.decode()
Package: simple-revert
Reverting ScriptsHere are two Python scripts that:Revert simple OpenStreetMap changesets.
Way and relation structural changes cannot be reverted, all other changes can.
For example, if you deleted a lot of objects, or changed many tags at once.Restore an old version of given object(s). All of their deleted references
are restored as well.If there are no errors, scripts would ask you for OSM login and password (which
are immediately forgotten) and upload the changes. Alternatively you can redirect
output to a file and open it in e.g. JOSM for reviewing and uploading.Installationpip install --user simple_revertSimple RevertSpecify changeset ids as thesimple-revertscript arguments. E.g.simple_revert 12345 12346 12348To list recent changesets by a user (e.g. you), specify their name as
the only argument:simple_revert ZverikRestore VersionTo restore an old object version, pass its type, id and version torestore_version. For the first argument you can use following formats:n12345for a node,w2342orr234234for ways and relations.node/12345,node.12345or even"way 2343"(note the quotes).https://www.openstreetmap.org/node/12345or any other similar link.https://api.openstreetmap.org/api/0.6/node/12345/6includes a version to restore.Version number should be either a positive integer, or a negative, relative
to the last version. E.g. this command will revert the last change to a node:restore_version n12345 -1To get a list of recent versions, run the script without a version argument.You can pass several objects to restore them all in one changeset:restore_version n12345 -1 w1234 -1 w1235 -1Author and LicenseWritten by Ilya Zverev, licensed under ISC license.
Package: simple-rlp
Simple RLP (Recursive Length Prefix)Encode the and decode data structures simple and fastThis module is a alternative to official Ethereumpyrlp.The pyrlp needs 5 dependencies. This alternative is write in
pure python and don't have any dependencies. Recommended use for
projects that don't need the Ethereum tools. If you already uses
the Ethereum tools uses thepyrlp.Features:Very simple usage to encode and decode lists of dataVery fast to encodeAuto serialize python objects (check supported types)Templates to convert bytes in decoded objectsNo dependenciesInstallation:pip install simple-rlpUsage:Encode:>>>importrlp>>>my_list=['python','rlp',255]>>>rlp.encode(my_list)b'\xcd\x86python\x83rlp\x81\xff'Decode:>>>importrlp>>>my_list_encoded=b'\xcd\x86python\x83rlp\x81\xff'>>>rlp.decode(my_list_encoded)[b'python',b'rlp',b'\xff']Use templates to decode and convert the bytes to python objectsSupported types:Signed integerUnsigned integerBoolFloatStringrlp.converters.UInteger# Signed integerrlp.converters.SInteger# Unsigned integerrlp.converters.Bool# Boolrlp.converters.Float# Floatrlp.converters.String# StringSigned and unsigned integer uses by default big-endian order.
If you need to use little-endian edit the static attribute:LittleEndianUInt=rlp.converters.UIntegerLittleEndianUInt.byteorder='little'String uses UTF-8 encoding by default if you need to use another then:ASCIIString=rlp.converters.StringASCIIString.encoding='ascii'Template Usage:>>>fromrlp.convertersimport*>>>importrlp>>>my_list=['rlp',1024,3.14159,True,b'\x08']>>>my_list_template=[String,UInteger,Float,Bool,None]>>>my_list_encoded=rlp.encode(my_list)>>>rlp.decode(my_list_encoded,template=my_list_template)['rlp',1024,3.141590118408203,True,b'\x08']Note: Put None object to do nothing in template.
Package: simple-roaming-certificate
Simple Roaming CertificateThis package contains the functions for creating all the certificates, keys
etc.  for Govroam, or eduroam.  The certificates are specifically designed to
work well with eduroam/Govroam and include all the features required to
ensure that as many clients as possible are compatible.It's based heavily on the python cryptography module.Usagefrom simple_roaming_certificate import gencertscsrsubject, cacert, cakey_enc, csrkey_enc, servercert, crlcert = gencerts(c,st,l,o,ou,cn,crldp,passphrase,bits)The following certificate are available for generation:RootCATo be installed on the client, as a trusted Root Certificate.
If using the CAT, upload this when creating a profile and set the "Name (CN) of Authentication Server" to idp.westeros.zz.
It can be pushed out to clients via a policy, or downloaded in 'mobileconfig' files or published on a web siteServer CertTo be installed on the RADIUS IdP.
Put this, along with the Server Key below, on to your RADIUS server and configure as part of the EAP security. Do not install the above Root CA on the server.Server KeyTo be installed on the RADIUS IdP, as above.CRLPublish at the URLhttps://<cn>/list.crl. It should be accessible by all clients. Whilst not necessary for clients to authenticate it reduces the risk of some clients rejecting the authentication.RootCA KeyTo be kept safe, along with the password used, and is required for any future server certificates, or to change the CRLNotesYou can check the certificates by running:openssl x509 -noout -text -in <certname>which will work for rootca.pem and server-cert.pemopenssl rsa -in <keyname> -checkwhich will work for server-key.pem and root-key.pemopenssl crl -noout -text -in <crlfile>which will work for list.crl
Package: simplerocks
simplerockssimple interface to rocksdbHow to install# https://github.com/facebook/rocksdb/blob/master/INSTALL.md
sudo apt-get install build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev
git clone https://github.com/facebook/rocksdb.git
cd rocksdb
NUM_PROCS=$(nproc)
sudo make -j NUM_PROCS install
# Also see this for Python installation:
# https://pypi.org/project/python-rocksdb/
Package: simple-rom-manager
# Simple ROM Manager[![Build Status](https://travis-ci.org/cmcginty/simple-rom-manager.svg?branch=master)](https://travis-ci.org/cmcginty/simple-rom-manager)
[![Status](https://img.shields.io/pypi/status/simple-rom-manager.svg)](https://pypi.python.org/pypi/simple-rom-manager)
[![Version](https://img.shields.io/pypi/v/simple-rom-manager.svg)](https://pypi.python.org/pypi/simple-rom-manager)
[![PyVersion](https://img.shields.io/pypi/pyversions/simple-rom-manager.svg)](https://www.python.org/)
[![License](https://img.shields.io/pypi/l/simple-rom-manager.svg)](https://github.com/cmcginty/simple-rom-manager/blob/master/LICENSE.md)A command-line tool for verifying console and arcade ROMs against published ROM set DAT files.For users familiar with ROM management, the goal of this tool is to implement some of the verification and file management features found in [ClrMamePro](https://mamedev.emulab.it/clrmamepro/).## AboutThere are a few groups that publish a collection of metadata for ROMs used in legacy gaming systems and arcades. In some cases the data is simply a “best-of” list for defining complete ROM set. For emulators like [MAME](https://github.com/mamedev/mame/releases) ([split](https://github.com/libretro/fbalpha/tree/master/dats)) or [FBA](https://github.com/libretro/fbalpha/tree/master/dats), a ROM may not work correctly when used with older versions of a ROM.[No-Intro](http://no-intro.org/) is one group that publish ROM sets for many gaming consoles on their [Dat-O-Matic](http://datomatic.no-intro.org/) site.Simple ROM Manager (SRM) can be used to quickly manage ROMs into a collection by confirming ROMs that are _good_, _bad_, and _missing_ and by renaming and/or re-packaging the files.## Featuressrm initcommand to put the current directory under management.## UsageSetup a top-level directory containing all of the ROMs referenced inside of a DAT file.` $ cd ~/MyRoms/System $ srm init `## InstallIt’s unlikely that your OS package manger contains a version of SRM. For now, you can install using PIP:`bash $ pip3 install srm `## Latest NewsThis software is pre-release. Please check back later for announcements or read the [design doc](DESIGN.md) for more details on what features are planned.
Package: simple-ros2-processing-tools
simple-ros2-processing-toolsA set of simple tools for ROS2 of my own making.pip install -U simple-ros2-processing-toolsNo.Tool NameTagsSummary1rosimg2mp4A simple tool to record ROS2 Image topics to MP4.2rosdepth2mp4A simple tool to record ROS2 Depth topics to MP4.3mp42rosimgThe program only Publish MP4 videos with the specified topic name and period.4ros2bagcutA tool that simply cuts rosbag files within a specified start and end date and time.5ros2bagsendA tool that uses simple logic to send topics recorded in ros2 bag one cycle at a time (not a strict cycle).
Package: simpleroute
SimpleRouteA simple router / treelib for python.UsageInstallationpip install simplerouteImportNote: as simpleroute uses two dictionaries internally rather than an OOP-based node system,Traverse replaces the standard "Node" class present in most other tree libraries.fromsimplerouteimportBaseRouter,Router,TraverseClassesrouter=BaseRouter([])# list of paths sep by /path,kwargs=router.match("SOME_STR_HERE")#match wildcards, eg /etc/1 to /etc/:numrouter=Router({})# dict of paths:datavals sep by /path,kwargs,data=router.match("SOME_STR_HERE")#match wildcards, eg /etc/1 to /etc/:numtraverse=Traverse.go(router,path="SOME_PATH_HERE")#returns an object of Traverse, optional path to go#use get_child, get_children, get_parent, get_data, get_path, get_sub to manipulate the object
Package: simplerouter
simplerouter is a simple WSGI/WebOb router partially based on
the router described inWebOb’s DIY Framework Tutorial.
Python 2.7 and Python 3.2 and newer are supported.Documentation is available atreadthedocs.org.The main git repository is available atBitbucket.Installingsimplerouter uses a setup.py script in the usual fashion, like so:$ python ./setup.py installAlternately, simplerouter is available on pypi and can be installed
using pip:$ pip install simplerouterQuick Exampleapp.py:fromsimplerouterimportRouterrouter=Router()# view names are composed of modulename:functionrouter.add_route('/post/{name}','views:post_view')router.add_route('/','views:index_view')application=router.as_wsgiif__name__=='__main__':fromwsgiref.simple_serverimportmake_servermake_server('',8000,application).serve_forever()views.py:fromwebobimportResponsedefpost_view(request):post_name=request.urlvars['name']# ... process post_namereturnResponse("Post output for%s"%post_name)defindex_view(request):returnResponse("Site index")
Package: simplerpc
SimpleRPC is a simple RPC package for Python, supporting both client
and server functions through definition of a single class.  To
implement a client and server, merely extend theSimpleRPCclass
and define the RPC functions as methods of this class, decorated with
the@remotedecorator.  (Note that the methodsclose(),ping(),connect(),listen(), andserve()are reserved,
as are thehost,port,authkey,mode, andconninstance attributes and theconnection_classclass attribute.)  To
run the server, simply call thelisten()method, which will loop
forever, accepting clients and usingeventletto spawn a thread to
serve them (implemented using theserve()method).  For the
client, simply calling the RPC method is sufficient, but the
connection can be explicitly initialized by calling theconnect()method.  The connection can be closed by callingclose(), and a
round-trip time can be obtained by using theping()method.  Note
that all function arguments and results must be serializable by the
Pythonjsonpackage.  (RPC methods may raise exceptions, as long
as the exception class is available on the client side; if it is not,
the exception will turn into anImportError.)Note that SimpleRPC is so simple that no effort is made to use a
secure connection type, such as SSL.  For this reason, the server
should be started on 127.0.0.1, to prevent snooping.  (Clients do send
an “authkey” to the server, which the server uses to authorize the
client, but this “authkey” is sent as plain text.)  It is possible to
use a more secure connection technology, such as SSL, by extending theConnectionclass and setting theconnection_classclass
attribute of theSimpleRPCsubclass to thatConnectionsubclass.
Package: simpler-pickle
Object File HandlersA wrapper for writing simpler pickle code. save and load python objects in one line.To save a python object to file system.fromOFHandlersimportsave_object,load_objectx=[iforiinrange(4)]#save object to local file system.save_object(path="./x.file",object=x)#load object to current python environmentx_loaded=load_object(path="./x.file")Installationpip install simpler-pickle
Package: simpler-rlp
Simple RLP (Recursive Length Prefix)NoteThis is a copy ofhttps://github.com/SamuelHaidu/simple-rlpwith a fix to resolve conflicting
directory names withhttps://github.com/ethereum/pyrlpEfficiently encode and decode data structures with minimal dependenciesThis module provides an alternative to the official Ethereumpyrlplibrary.While pyrlp requires 5 dependencies, this alternative is written in pure Python and has no dependencies. It is recommended for projects that do not require the full suite of Ethereum tools. If your project already uses Ethereum tools, consider usingpyrlpinstead.Features:Straightforward encoding and decoding of lists containing various data typesFast encoding processAutomatic serialization of Python objects (refer to supported types below)Templates for converting bytes into decoded objectsDependency-free implementationInstallation:pip install simpler-rlpUsage:Encoding:>>>importsimpler_rlp>>>my_list=['python','rlp',255]>>>simpler_rlp.encode(my_list)b'\xcd\x86python\x83rlp\x81\xff'Decoding:>>>importsimpler_rlp>>>my_list_encoded=b'\xcd\x86python\x83rlp\x81\xff'>>>simpler_rlp.decode(my_list_encoded)[b'python',b'rlp',b'\xff']Use templates to decode and convert bytes to Python objectsSupported Types:Signed integerUnsigned integerBooleanFloatStringrlp.converters.UInteger# Unsigned integerrlp.converters.SInteger# Signed integerrlp.converters.Bool# Booleanrlp.converters.Float# Floatrlp.converters.String# StringBoth signed and unsigned integers use big-endian byte order by default. To use little-endian, modify the static attribute:LittleEndianUInt=rlp.converters.UIntegerLittleEndianUInt.byteorder='little'String uses UTF-8 encoding by default. To use a different encoding, modify the static attribute:ASCIIString=rlp.converters.StringASCIIString.encoding='ascii'Template Usage:>>>fromsimpler_rlp.convertersimport*>>>importsimpler_rlp>>>my_list=['rlp',1024,3.14159,True,b'\x08']>>>my_list_template=[String,UInteger,Float,Bool,None]>>>my_list_encoded=simpler_rlp.encode(my_list)>>>simpler_rlp.decode(my_list_encoded,template=my_list_template)['rlp',1024,3.141590118408203,True,b'\x08']Note: Use aNoneobject in the template to leave the corresponding element unchanged.
Package: simple-rsa
Simple RSAA straightforward API to perform basic RSA-based operations.RationaleAny cryptographic library exposes all possibilities, and it should. But sometimes you just want a simplesignandvalidateAPI. That is what this wrapper module around the Cryptography module is. Nothing more, nothing less.Minimal Survival Commands%pipinstallsimple-rsaWhen running from the repo (probably in some virtualenv) install cryptography and optionallytoxis you want to run the tests:%pipinstallcryptographytoxGetting StartedThe module basically exposes the following functions:generate_key_pair()returning a tuple of private and public keysencode(key)returning an encoded keydecode(pem)returning a keysign(payload, key)returning a signaturevalidate(payload, signature, key)returning True or an Exception$python
Python2.7.15(default,Dec272018,11:55:59)[GCC4.2.1CompatibleAppleLLVM10.0.0(clang-1000.11.45.5)]ondarwin
Type"help","copyright","credits"or"license"formoreinformation.
>>>importsimple_rsaasrsa
>>>private,public=rsa.generate_key_pair()>>>rsa.encode(public)'-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5C15SFjpTCrdqB+0zFyu\nC9KJkNT1byzQPyATtLze/PNWjfqYL0RjvL4cmvmBWLeTQvnDx9SQfnQT02+4Q8Ov\nOaRTPqghEJctAh7KHwZfQzH29miC1WxXtGFcMFoAj17WPyMaOO3EcHqb4ttnAAPD\nt6B415HtGZo4oH6xY7QMj4eRceTv4++zACNHvqArO3bFFiNTBC8vCOpIg3xsYV4w\n7lQZs2lwGlzXPFJUeZglvsWTPJ54E1KabtkC/wSRFZBYtml8ZvzFfNDTOhcDyBR9\nVTV4K7iIGXG0A9C7mmj3hgALS3qSP5EK6fi51ufg98WokCLFcTSD/EphUlixazPo\nOQIDAQAB\n-----END PUBLIC KEY-----\n'>>>payload=b"something important">>>signature=rsa.sign(payload,private)>>>assertrsa.validate(payload,signature,public)>>>another_payload=b"something else">>>another_signature=rsa.sign(another_payload,private)>>>assertrsa.validate(payload,another_signature,public)Traceback(mostrecentcalllast):File"<stdin>",line1,in<module>File"simple_rsa/__init__.py",line74,invalidatehashes.SHA256()File"/usr/local/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/rsa.py",line477,inverifyself._backend,padding,algorithm,self,signature,dataFile"/usr/local/lib/python2.7/site-packages/cryptography/hazmat/backends/openssl/rsa.py",line272,in_rsa_sig_verifyraiseInvalidSignature
cryptography.exceptions.InvalidSignature
Package: simpler-sf
simpler-sfExtending the low-level Salesforce API clientSimple Salesforceto support exports in Pandas, and other features.UsageInstallpip install simpler-sfImportimportsimpler_sfsimpler_sf.simple_salesforce()importsimple_salesforceQuerySimpler-sf adds thesmart_query()method to thesimple_salesforce.Salesforceclass.The advantages over the existing methods are:Un-nesting of results for relationship queries (aka the infamous'attributes'field) (not just for one level)Query results inpd.DataframeformatNo limit on the number of output rows as insimple_salesforce.Salesforce.query()andat the same time...No need to use a different class for each Salesforce object as insf.bulk.Account.query(query)The option to filter dynamically, on large amounts of values without a limit on the number of charactersExamplesf=simple_salesforce.Salesforce(username=username,password=password,security_token=token)df=sf.smart_query('SELECT Contact.Id, Contact.FirstName, Contact.Account.Name, Campaign.Name FROM CampaignMember')print(df)Output:Contact.Id   Contact.FirstName   Contact.Account.Name      Campaign.Name
0   0032400000QZbmtAAD               Emily                 Amazon   CampaignA_2023Q2
1   0032400000eGqdZAAS             Jasmine                 Amazon   CampaignA_2023Q2
2   00324036u9QZbnGAAT                Míng              Microsoft   CampaignB_2022Q4
3   0032400000QZbygAAX           Magdalena                 Google   CampaignC_2023Q1
Package: simple-rsync
Simple Python interface for librsyncInstallpip install simple-rsyncBuildMake sure Rust toolchain is installed. If not gotohttps://rustup.rs/to install it.Create an virtual environment and run:python setup.py developfor develop build
orpython setup.py installfor release buildVerifypython setup.py testUsefromsimple_rsyncimportsignature,delta,patchbase_file="base"new_file="new"signature_file="sig"delta_file="delta"result_file="result"signature(base_file,signature_file,block_len=1024,strong_len=8)delta(new_file,signature_file,delta_file)patch(base_file,delta_file,result_file)withopen(new_file,"rb")asexpected:withopen(result_file,"rb")asresult:assertexpected.read()==result.read()Release on Mac OSXSetMACOSX_DEPLOYMENT_TARGETif you want the wheel to be compatible with older versions.
For CPython from Python.org:MACOSX_DEPLOYMENT_TARGET=10.9 python setup.py bdist_wheel.
For custom bulid oflibrsyncagain see the instructions for Windows.