Saravanan666/pypi-org huggingface dataset:
Package: restarter
restarterrestarteris a little utility to restart services if referenced objects
like executables or shared libraries have changed on disk. The goal is to ensure
that all services run current versions of their software. This is important for
example after security updates.Usagerestartertakes a pidfile as required argument. If the service is stale, that
means there are replaced objects still held in memory,restarterexecutes the
restart command passed via the–restartoption:restarter --restart "/etc/init.d/atd restart" /var/run/atd.pidThere is also the possibility to speficy a “hard restart” command that is
executed if the regular restart command fails.See the output ofrestarter –helpfor a list of all supported options.Stopped ServicesStopped services are gracefully ignored:restarterdoes nothing if the pidfile
does not exist or the pid referenced therein is not running. This behaviour can
be modified with the–failoption. Note thatrestarteralways fails when
the service was running but did not come up again after restart.Release History0.4.4 (2014-10-10)Add Python 3.3 compatibility.Correct source URL.Correct packaging issues.0.4.2 (2011-10-25)Ignore trailing lines in pid files as produced by PostgreSQL.0.4.1 (2011-08-03)Packaging issue: version.txt was not included in source distribution.0.4 (2011-03-18)Improve error messages.Fix double exception on restart failures.0.3 (2011-02-16)–exclude/-x specifies mmap’ed objects to ignore.Add a little bit of documentation in README.txt.0.2 (2011-02-14)Packaging issues.0.1b1Initial public release.
Package: restartlet
Restartlet========What?-----An extension of gevent_ greenlet and pool that allow a greenlet that exits exceptionally to restart with the same function and arguments it initially started with.. _gevent: http://www.gevent.org/Usage----------.. code-block:: pythonfrom restartlet import RestartableGreenlet.. code-block:: pythonfrom restartlet import RestartPoolInstalling----------Through Pypi:$ easy_install restartletOr the latest development branch from Github:$ git clone git@github.com:fiebiga/restartlet.git$ cd restartlet$ [From virtualenv] python setup.py install$ [No virtualenv] sudo python setup.py installSupport-------You may email myself at fiebig.adam@gmail.com
Package: restaurant-service-flask
# Restaurant Service - Flask Version
Small web-app used to test the [pact-test](https://github.com/Kalimaha/pact-test) library.## Test` $ ./bin/test.sh `## Run` $ ./bin/start.sh `## Available endpointsMenu: [http://localhost:8080/](http://localhost:8080/)Single Menu Item: [http://localhost:8080/42/](http://localhost:8080/42/)
Package: rest-auth-multitoken
Rest Auth Multitokendjango-rest-authis a great package
for authentication with django, however it lacks the possibility of allowing a user
to have multiple auth tokens. Thus a user has a single token shared across all his
clients, and when he logs out from one client he gets logged out of all his clients.rest-auth-multitoken solves this problem by adding  multiple tokens support for a single user to django-rest-auth.Installationinstallrest-auth-multitoken> pip install rest-auth-multitokenThen in django'ssettings.py:add it toINSTALLED_APPS:# settings.pyINSTALLED_APPS=[...'rest_auth_multitoken',...]add it toREST_FRAMEWORK's  config:# settings.pyREST_FRAMEWORK={'DEFAULT_AUTHENTICATION_CLASSES':(...'rest_auth_multitoken.utils.MultiTokenAuthentication',...),}configuredjango-rest-authto userest-auth-multitoken:# settings.pyREST_AUTH_TOKEN_CREATOR='rest_auth_multitoken.utils.multitoken_create'REST_AUTH_TOKEN_MODEL='rest_auth_multitoken.models.Token'Finally include the newMultitokenLogoutViewandMultitokenRegisterViewinurls.py, just beforedjango-rest-auth's urls:# urls.pyfromrest_auth_multitoken.viewsimport(MultitokenRegisterView,MultitokenLogoutView,)urlpatterns=[...path('api/auth/logout/',MultitokenLogoutView.as_view()),path('api/auth/registration/',MultitokenRegisterView.as_view())path('api/auth/registration/',include('rest_auth.registration.urls'))path('api/auth/',include('rest_auth.urls')),...]Now everytime a user logs in he'll get a new token, even if he's logged in from another client.
Package: restbl
restblLibrary to manipulate the resource size table (RSTB/RESTBL) inThe Legend of
Zelda: Tears of the KingdomExample UsagefromrestblimportResourceSizeTablewithopen("ResourceSizeTable.product.112.rsizetable.zs","rb")asfile:table=ResourceSizeTable.from_binary(file.read())asserttable.get_size("Actor/TwnObj_HatenoObj_A_12.engine__actor__ActorParam.bgyml")==6184table.set_size("Actor/TwnObj_HatenoObj_A_12.engine__actor__ActorParam.bgyml",666)asserttable.get_size("Actor/TwnObj_HatenoObj_A_12.engine__actor__ActorParam.bgyml")==666LicenseThis project is licensed under the GPLv3+ license.
Package: restcache
I wrote this so I could stop abusing people’s REST APIs whenever I was
developing tools. Currently this will only cache GET requests, and
nothing else. If you want more features, let me know!Quick Usage:from restcache import QueryCache
qc = QueryCache()
qc.json_query('https://bitbucket.org/api/1.0/repositories/galaxy/galaxy-central/tags/')Thejson_querycall makes aurllib2request, and stores it in.cache/{base64encoded url}.On initialization, QueryCache will check through the cache directory and
load any files.
Package: restcall
restcallA small JSON-based command-line utility to make REST calls.Installationrestcallis distributed as a Python package and can be installed usingpip.python -m pip install restcallUsageGenerate a templaterestcall -t get-service-name.json

restcall -t post-service-name.jsonImport template from curl commandrestcall -u curl-command.txt get-service-name.jsonThecurl-command.txtfile contains the curl command.Modify the generated templateThe generated template looks like this:{"url":"","httpMethod":"POST","reqAuthType":"none","reqAuthToken":"","reqContentType":"","reqHeaders":{},"reqPayload":"","resFile":""}Edit the template and populate the required values.
Here are the parameters, their meaning and the allowed values:url - the REST URLhttpMethod - GET, POST, PUT, PATCH, DELETEreqAuthType -none,bearer,bearer_generate,basicreqAuthTokenthe actual token if the reqAuthType isbearerfilepath to the restcall template to generate the token if the reqAuthType isbearer_generateusername:passwordif the reqAuthType isbasicreqContentType - the request content type. eg.application/jsonreqHeaders - the request headersreqPayload - the request body. If binary, provide the file path.resFile - the file path for storing response externallyMake the REST callrestcall get-service-name.jsonIt will generate the response fileget-service-name-res.json.Output equivalent curl command:restcall -c get-service-name.jsonSSLBy default SSL certificate verification is disabled.LicenseThis repository and the files under it are licensed under the MIT license.
Package: rest_channels
REST channelsdjango-channelswithdjango-rest-frameworkunder the same roof.InstallationThe easiest way to install the latest version is by usingpip/easy_installto pull it from PyPI:pip install rest_channelsAdd'rest_channels'to yourINSTALLED_APPSsetting.INSTALLED_APPS = (
    ...
    'rest_channels',
)You may also use Git to clone the repository from Github and install it
manually:git clone https://github.com/KhasanovBI/rest_channels
python setup.py installLicenseThe BSD LicenseContributed byBulat Khasanov
Package: rest-cli
Rest CLIIf you love ?Beautiful restful web service withstandardarchitectureThefastestway to get things done with less human codingEasy way tosynchronizefrom components to documentationWell tested structure withexplicitrequest & responsePowered by anindustrialframework with outstanding performanceThen this powerful tool is the right choice for you.PrerequisiteDockerPython 2.7 with pipPHP 7.2 with composerInstallation$ pip install rest-cliRoad mapCreate web service base on a lightweight skeletonDatabase schema migrationReverse schema to model - repository - service and dependency injectorsSupport built-in query annotationsCompile api routes and generate controller with integration testsServe and test applicationGenerate swagger documentation base on api routes (in-progress)Support response header & type casting for complex RequestSupport Service - Repository symbolic link to comply top down architectureExport service interfaces for inter-communicationSupport RPC exception via response verificationUsagesCreate web service application--quite : Quite mode without asking anything about configuration--force : Force creating application without complaining about existing project--mysql : Start a mysql container with default information$ rest create <awesome-service>Change directory to service and write some migrations atsrc/Shared/Migration$ rest migrateSynchronize model - repository - service - controller - test casesTo create some awesome apis, update your routes atconfig/api/*.json$ rest syncView route listTo see which routes are configured and manage apis$ rest routeServe your application to test in browser$ rest serveTest your application with PHPUnit$ rest testCheck current version$ rest versionUpdate new version of rest-cli ?$ rest upgradeNeed more help ?$ rest --helpAPI DocumentationAfterrest syncyou can serve your service withrest serveSwagger Documentation should be ready athttp://localhost:8000/docsLicenseRest CLI and related projects are licensed under theMITThanks for the sponsor fromGO1 Company~ Happy Coding ~
Package: rest-client
RESTful Client for tornado with support cookies.Example:# encoding: utf-8
from tornado.ioloop import IOLoop
from tornado.gen import coroutine, Return
from rest_client.async import RESTClient

io_loop = IOLoop.current()

@coroutine
def repo_list():
    client = RESTClient(headers={'User-Agent': 'curl/7.43.0'})
    # check api
    yield client.get('https://api.github.com/users/octocat/orgs')

    response = yield client.get('https://api.github.com/repos/vmg/redcarpet/issues?state=closed')
    data = sum(map(lambda x: x.comments, response.body))
    print('Total comments: {0}'.format(data))

exit(io_loop.run_sync(repo_list))
Package: rest-client-micro
RestClientMicroRun REST callsUsagefromrest_client_micro.rest_clientimportRESTClientasrcfromrest_client_micro.rest_objectimportRESTObjectasrorest_object=ro()rest_object.endpoint='https://api.scryfall.com/cards/named'rest_object.params={'exact':'Overgrown Tomb'}rest_client=rc()result=rest_client.execute(rest_object)print(result)e.gruns a Magic the Gathering card search against the exact name 'Overgrown Tomb'.Returns the content of the response{'error':False,'response':"{\"object\":\"card\",\"id\":\"eff1f52c-5c43-4260-aaa0-6920846a191c\",\"oracle_id\":\"975ec9a3-6f20-4177-8211-82526e092538\",\"multiverse_ids\":[453003],\"mtgo_id\":69919,\"arena_id\":68734,\"tcgplayer_id\":175196,\"cardmarket_id\":363554,\"name\":\"Overgrown Tomb\",.....ll\"}}"}Or an object describing an error{"error":True,"description":"Resource not found"}or{"error":True,"description":"Unterminated string starting at: line 1 column 14 (char 13)"}Buildpython-mbuild
python-mtwineuploaddist/*
Package: rest_condition
rest\_condition===============Complex permissions flow for `django-rest-framework`_.Installation------------The easiest way to install the latest version is by usingpip/easy\_install to pull it from PyPI:::pip install rest_conditionYou may also use Git to clone the repository from Github and install itmanually:::git clone https://github.com/caxap/rest_condition.gitpython setup.py installExample-------.. code:: pythonfrom rest_framework.response import Responsefrom rest_framework.views import APIViewfrom rest_framework.permissions import BasePermissionfrom rest_condition import ConditionalPermission, C, And, Or, Notclass Perm1(BasePermission):def has_permission(self, request, view):# You permissions check herereturn Trueclass Perm2(BasePermission):def has_permission(self, request, view):# You permissions check herereturn False# Example of possible expressionsexpr1 = Or(Perm1, Perm2)  # same as: C(Perm1) | Perm2expr2 = And(Perm1, Perm2)  # same as: C(Perm1) & Perm2expr3 = Not(Perm1)  # same as: ~C(Perm1)expr4 = And(Not(Perm1), Or(Perm1, Not(Perm2)))  # same as: ~C(Perm1) & (C(Perm1) | ~C(Perm2))# Using expressions in API viewsclass ExampleView(APIView):permission_classes = [Or(And(Perm1, Perm2), Not(Perm2)), ]# Or just simple:# permission_classes = [C(Perm1) & Perm2 | ~C(Perm2), ]def get(self, request, format=None):content = {'status': 'request was permitted'}return Response(content)class OtherExampleView(ExampleView):# Using ConditionalPermission classpermission_classes = [ConditionalPermission, ]permission_condition = (C(Perm1) & Perm2) | (~C(Perm1) & ~C(Perm2))License-------The MIT License (MIT)Contributed by `Max Kamenkov`_.. _django-rest-framework: http://django-rest-framework.org/.. _Maxim Kamenkov: https://github.com/caxap/
Package: restcord.py
restcord.pyAn asynchronous Python client for Discord's REST API.You can aquire an application token from Discord'sdeveloper portalbut please
take care to read through Discord's developerterms of serviceandpolicy documentas you agree to use this library in accordance with these terms.Find Discord's REST API documentationhere.Requirementspython>=3.6.0asyncioaiohttpjsonInstallpip3installrestcord.pyImportfromrestcordimportRestCordfromrestcord.errorsimport(BadRequest,Forbidden,NotFound,RateLimited,InternalServerError,BadGateway)InitialiseYou can initialise the RestCord client with an application token, but you may also provide your own asyncio event loop, aiohttp client session.client=RestCord("Your Discord application token here")StructureRestCord is structured in the same way as Discord's REST APIdocumentation. Once you have initialised RestCord you will have access to channel_client, emoji_client, guild_client, user_client and voice_client objects, which contain asynchronous methods to communicate with API end points.Example: get a guild objectIn this example, we use RestCord to perform a GET request to Discord'sguildAPI end point, which will return a guild object. Printing this object will output some basic details about the guild such as id and name but the object contains fields as per the documentation.try:asyncwithclientasrc:guild=awaitrc.guild_client.get_guild(guild_id=265561352683126786)print(guild)exceptForbiddenasex:print(ex)AsyncContextManagerRestCord can be used with or without the AsyncContextManager. Using it will ensure that any open aiohttp client sessions are closed.asyncwithclientasrc:voice_regions=awaitrc.voice_client.get_voice_regions()Or more granularly:asyncwithclient.guild_clientasgc:channel=awaitgc.get_channel(265586371178135562)print(channel)If you do not use the AsyncContextManager, you must call the close() function on RestCord to close any open aiohttp client sessions.member=awaitclient.guild_client.get_member(265561352683126786,50527603626344448)awaitclient.close()ErrorsIf Discord return error HTTP status codes, RestCord will throw a relevent exception for you to handle in your own way.Example: add a reaction to a messageIn this example we try to add a reaction to a message. There are several things to be aware of here:Does our application have permission to add reactions to messages? If not, a Forbidden exception will be thrown.Have we URL encoded the emoji as per specified by thedocumentation. If not, a BadRequest exception will be thrown.This particular end point has strict rate limits. If we have already added a reaction to the message we may be rate limited. In this case a RateLimited exception will be thrown and you can get more information about that limit from the exception object.try:asyncwithclient.channel_clientascc:awaitcc.add_reaction(331893934454472707,736436235140333599,emoji="msq:285508293596807168")exceptForbiddenasex:print(ex)exceptBadRequestasex:print(ex)exceptRateLimitedasex:ifex.is_global:print(f'Global rate limit has been hit. Retry in{ex.retry_after:.2f}seconds.')else:print(f'Rate limit hit. Retry in{ex.retry_after:.2f}seconds.')
Package: rest-db-client
REST DB ClientA simple Python3 library for connecting to RESTful databases.InstallationInstall via pip:$ pip install rest-db-clientExamplefromrest_db_clientimportRestDbClientclient=RestDbClient(port=6501)domain=client['Galaxy']model=domain['SolarSystem']datasets=[{'planet':'Jupiter','moons':69},{'planet':'Mars'},{'planet':'Earth','moons':1,'inhabited':True},]model.insert(datasets)DocumentationThe API documentation is indocs/api.md.ContributeIssue Tracker:https://gitlab.com/librecube/lib/python-rest-db-client/-/issuesSource Code:https://gitlab.com/librecube/lib/python-rest-db-clientTo learn more on how to successfully contribute please read the contributing
information in theLibreCube guidelines.SupportIf you are having issues, please let us know. Reach us atMatrixor viaEmail.LicenseThe project is licensed under the MIT license. See theLICENSEfile for details.
Package: restdbio-api-wrapper
Restdb.io API WrapperThis package is an API Wrapper for the websiterestdb.io, which allows for online databases. The API calls to the databases rely on the Rest API, I just made python classes and methods to make things easier to work with. The package is still in development stage, and I have so far only been able to implement aCollectionAPIclass, along with custom decorators and exceptions.Installationpipinstallrestdbio_api_wrapperorpython-mpipinstallrestdbio_api_wrapperUsageUsing the package to connect to your database onrestdb.iois pretty straightforward. First of all, you need yourdburlandx-apikey.dburlis mostly the same as your database name in theDatabases dashboard. Head over to the following link to see your api key:https://restdb.io/account/databases/<dburl>/apiThen, put the following line in your code:fromrestdbio_api_wrapperimportConnectionProceed to creating aConnectionobject:database_connection=Connection(<dburl>,<x-apikey>)Everything will be set up for you after this. You can access theCollectionAPIobject automatically created within theConnectionobject using the.collection_apiattribute. Through yourCollectionAPIobject, you are able to make API calls directed at your collection in your database. For example:result=database_connection.collection_api.get_records_from_collection("demo_collection",q={"first_name":"Jack"})You can of course, use different methods, customize your queries, use additional parameters likemax,skip,filter,groupby,aggregateand so on. Issue the following line to see all methods available:help(database_connection.collection_api)ContributingAs I've said earlier, this package is still in development stage. Should you have any issues or ideas, feel free to contribute. You can also e-mail me:hesenisgenderli999@gmail.com
Package: restdf
RestDFRestDFis a command line utility for running anypandas.DataFramecompatible datasets as a Rest API, with built-inSwaggerUIsupport.Source code:https://github.com/Mukhopadhyay/restdfLicense:MITDocumentation:http://restdf.rtfd.io/Geting Started withRestDFThe goal of this project was to make the API creation process from a dataset simpler. So, the execution is kept as minimal as possible. For example,RestDFcan be run like any other python module using the-mflag, additional flags can be used to configure the server.
Following will start a server withthisdataset onlocalhost:5000/docspython-mrestdfhttps://raw.githubusercontent.com/cs109/2014_data/master/diamonds.csvFor a more detailed description of all available flags and option please refer to this documentation onCommand Line Arguments.EndpointsThe responses fromRestDFcan be categorized into following three broad categories:DocsMetadataDataPlease refer tothispage for more detailed documentation on the available endpoints.Testing:RestDFtests are written usingpytest. For more detailed documentation on testing this module please go to the following page:Testing RestDFDocumentationsRead the documentaion online at:http://restdf.rtfd.io/Or build it locally from thedocs/directory usingLinux:makehtmlWindowsmake.bathtml
Package: restdyn
RestDyn is a dynamic rest client built on top of the excellentrestkitlibrary.It aims to be able to handle any uris for any apis.How it work ?Let’s say we want to fetch the json API of the great servicehttp://www.example.com. Their api is served fromhttp://api.example.com/1.0/:>>> from restdyn import Client
>>> ExampleAPI = Client('http://api.example.com/1.0/')Now we want to get the result fromhttp://api.example.com/1.0/users/search?q=Timy:>>> results = ExampleAPI.users.search(q='Timy')That’s it !resultsis a json object.Going furtherAdding arguments automaticallySometimes some api are a bit tricky. Previously, the version of the api was part of the resource but what if we have to specify it for each request:http://api.example.com/user/search?v=1.0&q=TimyWe can specify one or more params which will be automatically add to the query:>>> ExampleAPI = Client('http://api.example.com')
>>> ExampleAPI.set_persistent_params(v="1.0")or you can pass a dict:>>> ExampleAPI.set_persistent_params({'v':'1.0'})Customize resourcesSome apis like Twitter add.jsonafter the resource but before the query :https://api.twitter.com/1/search.json&q=Timy. We can do it like this:>>> TwitterAPI = Client('https://api.twitter.com/1', end_resource='.json')
>>> results = TwitterAPI.search(q='Timy')Post process resultSometimes you may have to clean up the result before send it back. You can do it by overloading theClient.post_process_resultmethod.Example:Google’s web service won’t send an http error 400 if the request failed. Instead, it will send a custom result:http://ajax.googleapis.com/ajax/services/search/web?q=Earth%20Daywill send back:{"responseData": null, "responseDetails": "invalid version", "responseStatus": 400}Let’s say we want to catch the error and raise an RequestFailed exception with a custom message which is in the “responseDetails” field:class CustomGoogleAPI(Client):
    def post_process_result(self, result):
        if result["responseStatus"] == 400:
            raise RequestFailed(result['responseDetails'])
        return resultThat’s it ! Don’t forget to return the result at the end of thepost_process_resultmethod.>>> GoogleAPI = CustomGoogleAPI('http://ajax.googleapis.com/ajax/services')
>>> GoogleAPI.search.web(q="toto")
Traceback (most recent call last):
...
RequestFailed: invalid versionAdding a trailing slashIf the api you are dealing have a slash in all its urls, you can configure restdyn to add it:>>> example_api = Client('http://api.example.com', add_trailing_slash=True)