Saravanan666/pypi-org huggingface dataset:
Package: api-bridge
APIBridgeJoiningjsonAPI calls togetherInstallationpip install api_bridgeUsageThe API-classAPI(url:str,method:Method=Method.GET,result_filter:Optional[Callable[[Dict[str,Any]],Dict[str,Any]]]=None,validate:Optional[Callable[[Dict[str,Any]],bool]]=None,post_data:Optional[Dict[str,Any]]=None)urlThe url to run a request withmethodThe Enum fromapi_bridge.methods.Method[eitherMethod.GETor.POST; defaults to.GET]result_filterA filter for the retrieved json dataapi_bridge.filter.Filter[defaults toNone]Filter(**out:str)outThe items of the filtered dataexamples:Filter(lat='latitude',long='longitude')# {'lat': data['latitude'], 'long': data['longitude']}Filter(sunrise='results sunrise')# spaces represent {'sunrise': data['results]['sunrise']}validateAn additional test based on the received data in addition to the http-status-code [defaults to None]example:validate=lambdadata:data['status']=='successful'post_dataData ifMethod.POSTwas providedRequestsThere are two ways to run a requestfromapi_bridge.apiimportAPIfromapi_bridge.filterimportFilterfromapi_bridge.containerimportContainerLOCATION_URL='https://ipapi.co/json/'TIME_URL='https://api.sunrise-sunset.org/json?lat={lat}&lng={long}&date=today'Thechain-methodresult=API.chain(API(LOCATION_URL,result_filter=Filter(lat='latitude',long='longitude')),API(TIME_URL,validate=lambdaresponse:response['status']=='OK',result_filter=Filter(sunrise='results sunrise')))result=={'sunrise':'4:08:10 AM'}The (esoteric) operator-method>or>>result = API('https://ipapi.co/json/', result_filter=Filter(lat='latitude', long='longitude')) > \
                API('https://api.sunrise-sunset.org/json?lat={lat}&lng={long}&date=today', validate=lambda response:
                    response['status'] == 'OK', result_filter=Filter(sunrise='results sunrise')) > \
                Container()

result == {'sunrise': '4:08:10 AM'}Importantthe gt and rshift operator mehtod must terminate with anOperator(), which can be treated a dict afterwards
Package: api-browser
api-browserBrowse API documentationInstallationYou can usepipxto install this tool.Install pipxRunpipx install api-browserYou can also usepip:pipinstallapi-browserUsageSeeapi_browser --helpfor all details.api_browser openapi <filename>Load the OpenAPI file and show Redoc documentation. Refresh the page to load any changes to the OpenAPI file.DevelopmentTo contribute to this library, first checkout the code. Then create a new virtual environment:cdapi-browser
python-mvenvvenvsourcevenv/bin/activateNow install the dependencies and test dependencies:pipinstall-e'.[test]'To run the tests:pytest
Package: api-buddy
API BuddyRight now, only OAuth2 authentication is supported. It's the most common, and current gold standard for security best practices. Also most APIs use it. That said, I have no beef with all the APIs out there using something else, so feel free to open a ticket if you want something else supported. 🎟You can also always manually set headers.InstallationAs long as you have python 3.7 or higher (I recommend usingpyenv), just:pipinstallapi-buddyUsageFirst, specify the API you're exploring in your preferences# ~/.api-buddy.yamlapi_url:https://some.api.comThen it's as easy as:apigetsome-endpoint=>200{"look":"I haz data","thx":"API Buddy"}HTTP Method defaults toget:apithis-endpoint# same as first exampleYou can add query params in key=val format:apiget\my/favorite/endpoint\first_name=cosmo\last_name=kramerYou can also add request body data in JSON format:apipost\some-endpoint\'{"id": 1, "field": "value"}'🤔 Note the single-quotes. You can expand this accross multiple lines:apipost\some-endpoint\'{"id": 1,"field": "value"}'Preferences 👉Argumentshttp_method: (optional, default=get) The HTTP method to use in your request.It should be one of:getpostpatchputdeleteendpoint: (required) The relative path to an API endpoint.AKA you don't need to type the base api url again here.params: (optional) A list ofkey=valquery paramsdata: (optional) A JSON string of requets body data.You can't use this withgetbecause HTTP.Options-h,--help: Show the help message-v,--version: Show the installed versionDevelopmentRequires:poetryPython 3.7Suggest using:pyenvSteps to start working:Build and create the local venv withbin/setupMake sure everything works withbin/testTry the local cli withpoetry run api --helpFind other management commands withbin/list
Package: apicall
apicall - User-friendly RESTful API & JSON-RPC ClientUsage$apicallendpointhttps://example.com/rest-api/v1
$restcallpost/users-d'{"name": "bob"}'$restcallget/users/10
$restcallget/users/search'name=bob'$restcalldelete/users/10

$apicallendpointhttps://example.cmo/json-rpc/v1
$jsonrpccallcreate_account'bob'$jsonrpccallget_account10$jsonrpccallsearch_accounts_by_name'bob'$jsonrpccalldelete_account10RequirementsPython 3.7 or laterjq commandyapf command(For development)mypy command(For development)py.test(For development)InstallationNOTE: If you want develop the apicall, see the "Development" section.Please run the following command.$python3.7-mpipinstallgit+https://github.com/yuuki0xff/apicallArgumentsapicall auth header
apicall auth header set NAME VALUE
apicall auth header unset NAME ...
apicall auth basic
apicall auth basic set USER PASSWORD
apicall auth basic unset
apicall endpoint [URLS ...]

restcall METHOD URL [QUERIES ...]
jsonrpccall FUNC [ARGS ...]DevelopmentPlease run the following commands.
When install succeed, apicall commands are installed to your computer.
If you edited some codes under the git repository, changes are applied immediately to the behavior of apicall command.$gitclonehttps://github.com/yuuki0xff/apicall
$cdapicall
$python3.7-mpipinstall-e'.[dev]'TODOImprove help messages and documentation.Support gRPC protocol.
Package: api-calls
API_CALLSThis package makes it easy to make api calls in python by abstracing all the logic you'd otherwise use with other packages such as requestsThis package requires requests 2.31.0 or later versionsExample usage below:from api_calls import ApiCalls


class CatService(ApiCalls):
    base_url = "https://cat-fact.herokuapp.com"
    timeout = 500

    def get_random_cat_fact(self):
        response = self.make_request(
            "/facts/random", method="get", params={"amount": 5})
        return response


data, error = CatService().get_random_cat_fact()To install, run:pip install api_calls
Package: apicast
ApicastAboutApicast acquires bee flight forecast information published by Deutscher Wetterdienst (DWD).Development:Hiveeyes » DWD-Prognose BienenflugLive API:https://apicast.hiveeyes.org/(also on HTTP)SetupCLI version:pip install apicastHTTP API:pip install apicast[service]SynopsisDisplay list of states and sites:apicast beeflight stationsDisplay list of location slugs:apicast beeflight stations --slugsAcquire information for given location slugbrandenburg/potsdam:apicast beeflight forecast --station=brandenburg/potsdamAcquire information for given location slugbrandenburg/potsdam, output as table in Markdown format:apicast beeflight forecast --station=brandenburg/potsdam --format=table-markdownOutput as table in JSON machine readable format:apicast beeflight forecast --station=brandenburg/potsdam --format=json-machineHTTP APIStart HTTP API service:apicast serviceStart HTTP service with dynamic code reloading:apicast service --reloadThen navigate to:open http://localhost:24640/Exampleapicast beeflight forecast --station=brandenburg/potsdam[
    {
        "Datum": "Mo 01.06.",
        "morgens": "stark",
        "mittags": "intensiv",
        "abends": "stark"
    },
    {
        "Datum": "Di 02.06.",
        "morgens": "stark",
        "mittags": "intensiv",
        "abends": "intensiv"
    },
    {
        "Datum": "Mi 03.06.",
        "morgens": "intensiv",
        "mittags": "intensiv",
        "abends": "intensiv"
    }
]Testsmake testContent attributionsThe copyright of data, particular images and pictograms are held by their respective owners, unless otherwise noted.DataSource:https://www.dwd.de/DE/leistungen/biene_flug/bienenflug.htmlhttps://www.dwd.de/DE/fachnutzer/freizeitgaertner/1_gartenwetter/_node.htmlDocumentation:https://www.dwd.de/DE/fachnutzer/landwirtschaft/dokumentationen/allgemein/bienenflug_doku.htmlhttps://www.dwd.de/DE/fachnutzer/landwirtschaft/dokumentationen/isabel/meinagrar_bienenflug.htmlData copyright: © Deutscher Wetterdienst (DWD), Agricultural Meteorology DepartmentLogo pictureDescription:      A bee swarm on an oak tree in Plymouth, UKDate:             21 June 2009Source:           Own workAuthor:           NilfanionCamera location:  50° 24′ 38.3″ N, 4° 09′ 28.2″ WLicense:          Creative Commons Attribution-Share Alike 3.0 UnportedURL:https://commons.wikimedia.org/wiki/File:Bee_swarm_in_Plymouth.jpg
Package: api-cerved-tutorial
API-CERVED TUTORIALQuesto package ha l'intento di mostrare le varie funzionalità offerte dall'API prodotta da Cerved.
Il sito ufficiale dell'API è:https://apps-developer.cerved.com/di proprietà dellaCerved Group S.p.a..L'intenzione del codice contenuto inquesto repository e solo quello di mostrare come implementare le chiamate all'API.Per poter utilizzare il servizio offerto dallaCerved Group S.p.a.sarà necessario effettuare la registrazione sul loro sito per ottenere le credenziali ed in particolare unaCONSUMER_KEYche dovrete inserire nel file settings.py.Nota: fate attenzione a non pubblicare o diffondere erroneamente la vostra CONSUMER_KEY!In questo tutorial vengono implementati solo alcuni dei servizi offerti dall'API:Entity Search: permette di effettuare una ricerca libera in base al codice fiscale per le presone fisiche oppure in base alla partita iva o alla ragione sociale per le imprese. Utile per ricercare il codiceid_soggettoche viene richiesto per le altre ricerche.main.py -p entity -e 'CHIAVE DI RICERCA'*Entity Profile: permette di avere i dati relativi ad un profilo in base alla ricerca per id_soggetto.main.py -p profile -i 'ID_SOGGETTO'*Entity Contacts: permette di avere i dati relativi ai contatti di un profilo in base alla ricerca per id_soggetto.main.py -p contacts -i 'ID_SOGGETTO'Entity PEC: permette di avere la PEC di un profilo in base alla ricerca per id_soggetto.main.py -p pec -i 'ID_SOGGETTO
Package: apiclarity
Python APIClarity clientPython client package forAPIClarityinteraction.APIClarityis a modular tool that addresses several aspects of API Security, focusing specifically onOpenAPI based APIs. APIClarity approaches API Security in 2 different ways:Captures all API traffic in a given environment and performs a set of security analysis to discover all potential security problems with detected APIsActively tests API endpoints to detect security issues in the implementation of such APIs.UsageTheClientSessionclass is based onrequests.Sessionand can be used similarly. To configure the session, provide aClientSettingsobject:fromapiclarityimportClientSession,ClientSettingsapiclarity_session=ClientSession(ClientSettings(apiclarity_endpoint="http://apiclarity",default_timeout=(9.0,3.0),))apiInfo=apiclarity_session.getInventory()forapiinapiInfo.items:print(f"received:{api}\n")The settings can also be retrieved from the environment during creation of theClientSettingsobject, given here with the defaults:APICLARITY_ENDPOINT="http://apiclarity:8080"TELEMETRY_ENDPOINT="http://apiclarity:9000"HEALTH_ENDPOINT="http://apiclarity:8081"ContributingPull requests and bug reports are welcome. Please seeCONTRIBUTING.md.LicenseThe code is released under theApache 2.0 License.
Package: apicli
ApiCliApiCli is a python library that allow using a common code-base to create a REST API and a CLI that can interact with your API.TODOsCreate endpoint from route defined using decoratorsPropose at least bearer authentication from API sideExpose API endpoints to manage authentication when enabledDefine commands to authenticate from CLIContributeInstall project dependencies using pipenv. This will install apicli in editable mode from local folder.pipenv installIf you want to test generated openapi documentation, you can use swagger-ui.Ifswagger-ui/submodule is empty, init submodule using this commandgit submodule update --initThen inswagger-ui/folder, install dependencies and run web interface with commandnpm run devBy default, swagger-ui will be served athttp://localhost:3200If you want UI to automatically open the specs from your local apicli server, editswagger-ui/dev-helpers/index.html
Package: apiclient
Tiny framework for buildinggoodAPI client libraries thanks tourllib3.HighlightsThreadsafely reuses connections with Keep-Alive (via urllib3).Small and easy to understand codebase perfect for extending and building upon.Built-in support for rate limiting and request throttling.Functional examples for theKlout APIand theFacebook OpenGraph API.ExamplesHow to make your own super-simple client API library:>>> from apiclient import APIClient
>>> class AcmePublicAPI(APIClient):
...    BASE_URL = 'https://localhost:1234/'

>>> acme_api = AcmePublicAPI()

>>> acme_api.call('/hello')
{'what': 'world'}
>>> acme_api.call('/echo', params={"ping": "pong"})
{'ping': 'pong'}How to add rate limiting to your client API library so that we don’t exceed 10
requests per minute:>>> from apiclient import RateLimiter
>>> lock = RateLimiter(max_messages=10, every_seconds=60)
>>> acme_api = AcmePublicAPI(rate_limit_lock=lock)

>>> # Get the first 100 pages
>>> for page in xrange(100):
...     # Whenever our request rate exceeds the specifications of the API's
...     # RateLimiter, the next request will block until the next request window
...     r = acme_api.call('/stream', page=str(page))For more specific API examples, see theexamples/directory.ExtendingTo handle different calling conventions,apiclientcan be extended through
subclassing.For example, if an API requires that all arguments be JSON encoded, the_compose_urlmethod could be implemented like this:>>> class JSONArgsAPIClient(APIClient):
...     def _compose_url(self, path, params=None):
...         if params is not None:
...             params = dict((key, json.dumps(val))
...                            for (key, val) in params.iteritems())
...         return APIClient._compose_url(self, path, params=params)Or if an API returns YAML instead of JSON, the_handle_responsemethod
could be overridden:>>> class YAMLResponseAPIClient(APIClient):
...     def _handle_response(self, response):
...         return yaml.load(response.data)TODOTests.More documentation.More types of API handshakes, like OAuth and OAuth2.More examples.ContributingAny contribution is highly encouraged and desired. :)Fork on Github.Make the changes. Bonus points if changes include documentation and tests.Send a pull request.If you’re unsure if it’s a good idea,open an Issueorcontact meto discuss your proposal.
Extra juicy bonus points if you pick off some of the items in theTODOlist.LicenseMITChanges1.0.3 (2016-05-15)Python 3 fixes.1.0.2 (2011-10-20)Fixed setup.py from failing upon not seeing README.rst when installing using
easy_install.1.0.1 (2011-10-10)Fixed setup.py package not including a MANIFEST.in1.0 (2011-10-03)Published decoupled code from SocialGrapple.
Package: api-client-framework
API ConsumerCreate clients for consuming endpoints in a class-based way.Describe the endpoints using a classfromapi_client_framework.requestsimportRequestsEndpointfromapi_client_framework.requestsimportMethodsfromapi_client_framework.parsersimportNamedTupleParserfromcollectionsimportnamedtupleUser=namedtuple("User",["id","uid","password","first_name",...],rename=True)classUsersEndpoint(RequestsEndpoint):method=Methods.GETurl="https://random-data-api.com/api/v2/users"params={"response_type":"json"}parser=NamedTupleParser(User)Create your clientimportrequestsfromexamples.random_data_api.endpointsimportUsersEndpointfromexamples.random_data_api.modelsimportUserfromapi_client_framework.requestsimportRequestsClientclassRandomDataAPI(RequestsClient):"""Client for random-data-api.com"""def__init__(self):self.session=requests.Session()defget_user(self)->User:"""Retrieve a single random user"""returnself._perform_request(UsersEndpoint())AdvancedCreate your own data parsers...usingParserprotocol.Convert HTTP exceptions in your custom exceptions...by creating your ownexception_handlerDefine a base URL for all your endpoints only once...usingBaseUrlSessionfromrequests_toolbeltpackageLog responses...by addinga hookin yourrequests.Sessioninstancedefprint_response(response,*args,**kwargs):print(response.url)session=requests.Session()session.hooks.setdefault("response",[])session.hooks["response"].append(print_response)ExamplesThere's a small example in this repo, underexamples/random_data_api, which implements some endpoints ofrandom-data-api.comMade withpython-api-consumerPyWegowAPI-  A client for the public, undocumented, Wegow API
Package: apiclient-gonzalo123
Custom apiclientdbutilsInstallpip install apiclient-gonzalo123UsageInit clientfromapiclientimportApiClientclient=ApiClient(token='my_secret token',base='http://localhost:8000')GET Requestdata=client.get('/api/route',dict(param1='value1'))POST Request (with parameters in the url)data = client.post('/api/route', params=dict(param1='value1'))POST Request (with parameters in the request body)data=client.post('/api/route',body=dict(param1='value1'))
Package: api-client-http
API Client HTTPClient for sync/async query HTTP API Services.
It provides a high-level interface for managing URLs, headers, and authentication.
Based onHTTPXlibrary.FeaturesSynchronous and asynchronous HTTP requestsToken-based authenticationCustomizable headersURL managementError handlingInstallationTo install the library, use pip:pipinstallapi-client-httpUsageSynchronous clientfromapi_client_httpimportRestClientfromapi_client_http.authimportTokenAuthclient=RestClient(address="https://api.example.com/v1",endpoints={'token':'auth/token','query':'query/{}'})auth_respone=client.post('token',json={'username':'user','password':'password'})response=client.get('query','123',auth=TokenAuth(auth_respone['access_token']))Asynchronous clientfromapi_client_httpimportAsyncRestClientfromapi_client_http.authimportTokenAuthclient=AsyncRestClient(address="https://api.example.com/v1",endpoints={'token':'auth/token','query':'query/{}'})auth_respone=awaitclient.post('token',json={'username':'user','password':'password'})response=awaitclient.get('query','123',auth=TokenAuth(auth_respone['access_token']))LicenseThis project is licensed under the MIT License. See theLICENSEfile for details.
Package: api-client-jsonmarshal
Python API Client Json Marshal ExtensionInstallationpip install api-client-jsonmarshalUsageThe following decorators have been provided to marshal request data as python dataclasses to json
and to unmarshal json directly into a python dataclass.# Marshal dataclass -> json
@marshal_request(date_fmt: Optional[str] = None, datetime_fmt: Optional[str] = None)

# Unmarshal json -> dataclass
@unmarshal_response(schema: T, date_fmt: Optional[str] = None, datetime_fmt: Optional[str] = None)Usage:Define the schema for your api in python dataclasses.Add the@unmarshal_responsedecorator to the api client method to transform the response
directly into your defined schema.@unmarshal_response(List[Account])
def get_accounts():
    ...Add the@marshal_requestdecorator to the api client method to translate the incoming dataclass
into the required json for the endpoint:@marshal_request()
def create_account(account: Account):
   ...The marshalling functionality has been provided by:https://github.com/MikeWooster/jsonmarshalMore usage examples can be found there.
Package: api-client-lnx-edge
LNX Edge API ClientWritten for Python ≥ 3.7Behavioral rules of thumb:When requesting a report:Passdate(YYYY-MM-DD) strings instead ofdatetimestrings (YYYY-MM-DDTHH:MM:SS.sss) to thedateRangefield.  # TODO FIX THISTimezone shouldalwaysbe specified in the request body.EdgeAPI._get_report(...)defaults toAmerica/New_York, but can be overridden.Test script:(venv)>pytest-vNow using marshmallow for data validation on the client-side, allowing users to either specify content as JSON or as
python arguments for Create Offer endpoint.Packaging instructions found here:https://packaging.python.org/en/latest/tutorials/packaging-projects/
Package: api-client-pydantic
Python API Client Pydantic ExtensionInstallationpipinstallapi-client-pydanticUsageThe following decorators have been provided to validate request data and converting json straight to pydantic class.fromapiclient_pydanticimportserialize,serialize_all_methods# serialize request and response data@serialize(config:Optional[ConfigDict]=None,validate_return:bool=True,response:Optional[Type[BaseModel]]=None)# wraps all local methods of a class with a decorator 'serialize'.@serialize_all_methods(config:Optional[ConfigDict]=None)Usage:Define the schema for your api in pydantic classes.frompydanticimportBaseModel,FieldclassAccount(BaseModel):account_number:int=Field(alias='accountNumber')sort_code:int=Field(alias='sortCode')date_opened:datetime=Field(alias='dateOpened')Add the@serializedecorator to the api client method to transform the response
directly into your defined schema.@serialize(response=List[Account])defget_accounts():...# or@serializedefget_accounts()->List[Account]:...Add the@serializedecorator to the api client method to translate the incoming kwargs
into the required dict or instance for the endpoint:fromapiclient_pydanticimportModelDumped@serializedefcreate_account(data:AccountHolder):# data will be AccountHolder instance...create_account(data={'last_name':'Smith','first_name':'John'})# data will be a AccountHolder(last_name="Smith", first_name="John")@serializedefcreate_account(data:ModelDumped[AccountHolder]):# data will be exactly a dict...create_account(data={'last_name':'Smith','first_name':'John'})# data will be a dict {"last_name": "Smith", "first_name": "John"}For more convenient use, you can wrap all APIClient methods with@serialize_all_methods.fromapiclientimportAPIClientfromapiclient_pydanticimportserialize_all_methodsfromtypingimportListfrom.modelsimportAccount,AccountHolder@serialize_all_methodsclassMyApiClient(APIClient):defdecorated_func(self,data:Account)->Account:...defdecorated_func_holder(self,data:AccountHolder)->List[Account]:...Related projectsapiclient-pydantic-generator - Now deprecated.This code generator creates aApiClientapp from an openapi file.apiclient-pydantic-generator
Package: api-clients
Permission handler for drf API’s.DocumentationThe full documentation is athttps://api_clients.readthedocs.io.QuickstartInstall API clients permission.:pip install api_clientsAdd it to yourINSTALLED_APPS:INSTALLED_APPS=(...'api_clients.apps.ApiClientsConfig',...)Add API clients permission.’s URL patterns:fromapi_clientsimporturlsasapi_clients_urlsurlpatterns=[...url(r'^',include(api_clients_urls)),...]FeaturesTODORunning TestsDoes the code actually work?source <YOURVIRTUALENV>/bin/activate
(myenv) $ pip install tox
(myenv) $ toxCreditsTools used in rendering this package:Cookiecuttercookiecutter-djangopackageHistory0.1.0 (2019-03-10)First release on PyPI.