Saravanan666/pypi-org huggingface dataset:
Package: apiflows
apiflows testingA yaml data-drive HTTP API testing tools.usagepip3 install apiflows
python3 -m apiflows [-c config.py]  -t testcases/github.yamlconfiguration(config.py)#!/bin/env python3

import uuid
import logging

# common headers
HEADERS = {
    'content-type': 'application/json',
    'x-token': '1234',
}

# common extracts
EXTRACTS = {
    'USERNAME':'allen'
}

def pre_testing():
    """
    pre testing
    """
    logging.debug("pre_testing()...")
    HEADERS['x-apiflows-id'] = str(uuid.uuid4())

def pre_request(apicase):
    """
    pre request
    """
    # TODO here
    logging.debug("pre_request()...")
    apicase.set_header("mycookie", "PHPSESSIONID=apiflows")
    return apicase

def do_request(apicase):
    logging.debug("do_request()...")
    apicase.do_request()
    return apicase

def parse_response(apicase):
    """
    parse HTTP response
    """
    logging.debug("parse_response()...")
    code = apicase.parse_status_code()
    headers = apicase.parse_response_headers()
    body = apicase.parse_response_body()
    return {'code': code, 'headers': headers, 'body': body}

def post_request(apicase):
    """
    post request
    """
    # TODO
    logging.debug("post_request()...")
    response = apicase.get_response()
    if response is not None:
        logging.debug("    RESPONSE: " + response.text)
    
    return apicase

def post_testing():
    """
    post testing
    """
    # TODO
    logging.debug("post_testing()...")testcase example(github.yaml)---
apicases:
- name: 获取GitHub API列表(Get Github API list)
  url: https://api.github.com
  method: GET
  headers:
    x-token: 5678
  data: '{"username":"apiflows"}'
  extracts:
    RATE_LIMIT_URL: $.rate_limit_url
    PUBLIC_GISTS_URL: $.public_gists_url
    ENCODING:
      in: headers
      exp: "$.Content-Encoding"
  assertions:
  - exp1: "$.hub_url"
    comparator: neq
    exp2: ""
  - exp1: "{{ENCODING}}"
    comparator: eq
    exp2: gzip
  - exp1: "{{RATE_LIMIT_URL}}"
    comparator: contains
    exp2: https
  - exp1: "{{PUBLIC_GISTS_URL}}"
    comparator: match
    exp2: (https:\/\/)comparatorseqneqcontainsmatchtest result0:testcases/github.yaml
[获取GitHub API列表(Get Github API list)]: https://api.github.com/?username=allen
	EXTRACTOR:
		EXTRACT [RATE_LIMIT_URL]=https://api.github.com/rate_limit
		EXTRACT [PUBLIC_GISTS_URL]=https://api.github.com/gists/public
		EXTRACT [ENCODING]=gzip
	ASSERTIONS:
		$.hub_url = https://api.github.com/hub [neq] 
		{{ENCODING}} = gzip [eq] gzip
		{{RATE_LIMIT_URL}} = https://api.github.com/rate_limit [contains] https
		{{PUBLIC_GISTS_URL}} = https://api.github.com/gists/public [match] (https:\/\/)for developmentpython3 -m build
twine upload dist/*
Package: apifoncier
Présentation du moduleapifoncierest un module Python qui propose
une boîte à outils pour interagir plus facilement avecl'API
Données foncières du Cerema.Il permet d'interroger facilement les différentes bases de données
foncières produites par le Cerema et la DGALN directement en Python.InstallationpipinstallapifoncierDocumentation du moduleLa documentation complète est accessible au lien suivant :https://rcadot.github.io/py.apifoncier/Des exemples sous forme de notebook sont également proposées.QuickstartQuelques exemples pour démarrer :## Récupérer des données de consommation d'espace sur une communeimportapifoncier.ind_conso_espaceasconsodf=conso.communes(code_insee='59350')## Récupérer des données de prix sur une communeimportapifoncier.ind_prixasprixdf=prix.communes(code_insee='59350')## Récupérer des transactions issues de DVF+ sur une communeimportapifoncier.dvf_opendataasdvfdf=dvf.mutations(code_insee='59350')# avec les geometriesgdf=dvf.geomutations(in_bbox=[3,50,3.01,50.01])RessourcesPour retrouver toutes les informations sur les données foncières :datafoncier.cerema.frDictionnaire et documentation sur toutes les variables :doc-datafoncier.cerema.frPour en savoir plus sur l’API données foncières du
cerema.
Package: api-for-iot-module
API for IoT ModuleAPI for IoT Module contains functions to be used for implementing a API for a camera moduleFree software: MIT licenseDocumentation:https://api-for-iot-module.readthedocs.io.RunStart virtual environment
python3 -m venv venv
. venv/bin/activate
export FLASK_APP=app.pyFeaturesThe API has features to capture both video and still images from the raspberry pi camera and makes use of picamera methods to do so. The way that this API formats its data is by sending non-image data in the form of JSON objects, while image and video frames are send as JPEG binary objects.The API has methods to change various camera settings, which include the following:Frame rateBrightnessContrastSaturatioinSharpnessExposure modeImage effect (such as denoise, negative, cartoon and many other effects)The API also have a motion detection function, where it compares the data of successive frames in the form of a numpy array and gives a alert when there are signficant changes between frames.CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-08-12)First release on TestPyPI.
Package: apify
Apify SDK for PythonThe Apify SDK for Python is the official library to createApify Actorsin Python. It provides useful features like Actor lifecycle management, local storage emulation, and Actor
event handling.If you just need to access theApify APIfrom your Python applications,
check out theApify Client for Pythoninstead.InstallationThe Apify SDK for Python is available on PyPI as theapifypackage.
For default installation, using Pip, run the following:pipinstallapifyFor users interested in integrating Apify with Scrapy, we provide a package extra calledscrapy.
To install Apify with thescrapyextra, use the following command:pipinstallapify[scrapy]DocumentationFor usage instructions, check the documentation onApify Docs.ExamplefromapifyimportActorfrombs4importBeautifulSoupfromhttpximportAsyncClientasyncdefmain()->None:asyncwithActor:# Read the input parameters from the Actor inputactor_input=awaitActor.get_input()# Fetch the HTTP response from the specified URLasyncwithAsyncClient()asclient:response=awaitclient.get(actor_input['url'])# Process the HTML contentsoup=BeautifulSoup(response.content,'html.parser')# Push the extracted dataawaitActor.push_data({'url':actor_input['url'],'title':soup.title.string,})What are Actors?Actors are serverless cloud programs that can do almost anything a human can do in a web browser.
They can do anything from small tasks such as filling in forms or unsubscribing from online services,
all the way up to scraping and processing vast numbers of web pages.They can be run either locally, or on theApify platform,
where you can run them at scale, monitor them, schedule them, or publish and monetize them.If you're new to Apify, learnwhat is Apifyin the Apify platform documentation.Creating ActorsTo create and run Actors through Apify Console,
see theConsole documentation.To create and run Python Actors locally, check the documentation forhow to create and run Python Actors locally.GuidesTo see how you can use the Apify SDK with other popular libraries used for web scraping,
check out our guides for usingRequests and HTTPX,Beautiful Soup,Playwright,Selenium,
orScrapy.Usage conceptsTo learn more about the features of the Apify SDK and how to use them,
check out the Usage Concepts section in the sidebar,
particularly the guides for theActor lifecycle,working with storages,handling Actor eventsorhow to use proxies.
Package: apify-client
Apify API client for PythonThe Apify API Client for Python is the official library to access theApify APIfrom your Python applications.
It provides useful features like automatic retries and convenience functions to improve your experience with the Apify API.If you want to develop Apify Actors in Python,
check out theApify SDK for Pythoninstead.InstallationRequires Python 3.8+You can install the package from itsPyPI listing.
To do that, simply runpip install apify-clientin your terminal.UsageFor usage instructions, check the documentation onApify Docs.Quick Startfromapify_clientimportApifyClientapify_client=ApifyClient('MY-APIFY-TOKEN')# Start an actor and wait for it to finishactor_call=apify_client.actor('john-doe/my-cool-actor').call()# Fetch results from the actor's default datasetdataset_items=apify_client.dataset(actor_call['defaultDatasetId']).list_items().itemsFeaturesBesides greatly simplifying the process of querying the Apify API, the client provides other useful features.Automatic parsing and error handlingBased on the endpoint, the client automatically extracts the relevant data and returns it in the
expected format. Date strings are automatically converted todatetime.datetimeobjects. For exceptions,
we throw anApifyApiError, which wraps the plain JSON errors returned by API and enriches
them with other context for easier debugging.Retries with exponential backoffNetwork communication sometimes fails. The client will automatically retry requests that
failed due to a network error, an internal error of the Apify API (HTTP 500+) or rate limit error (HTTP 429).
By default, it will retry up to 8 times. First retry will be attempted after ~500ms, second after ~1000ms
and so on. You can configure those parameters using themax_retriesandmin_delay_between_retries_millisoptions of theApifyClientconstructor.Support for asynchronous usageStarting with version 1.0.0, the package offers an asynchronous version of the client,ApifyClientAsync,
which allows you to work with the Apify API in an asynchronous way, using the standardasync/awaitsyntax.Convenience functions and optionsSome actions can't be performed by the API itself, such as indefinite waiting for an actor run to finish
(because of network timeouts). The client provides convenientcall()andwait_for_finish()functions that do that.
Key-value store records can be retrieved as objects, buffers or streams via the respective options, dataset items
can be fetched as individual objects or serialized data and we plan to add better stream support and async iterators.
Package: apify-scrapy-executor
Apify Scrapy ExecutorSupport module forApify Scrapy Migrator. Runs migrated Scrapy
project and uploads result to Apify default dataset.UsageSinceapify-clientdoes not fully support local runs yet, migrated
Scrapy projects work best on Apify Cloud. Apify Scrapy Migrator is recommended to be used with Apify Scrapy Migrator on
Apify Cloud.But for people who want to earn their results, here is a small example.# import SpiderExecutor classfromapify_scrapy_executorimportSpiderExecutor# create instance of the Spider executor class with scrapy class as an argumentspider_executor=SpiderExecutor(scrapy_class)# run the scrapy project with dataset_id argument to save the result and args_dict for scrapy inputspider_executor.run(dataset_id=apify_dataset,args_dict=actor_input)
Package: apify-scrapy-migrator
Apify Scrapy MigratorThis tool enables you to run scrapy project on Apify Cloud.UsageFirst runinstall the package -pip install apify-scrapy-migratorlocate your scrapy project and migrate -apify-scrapy-migrator -m DESTINATIONUpload to Apify cloudThere are multiple ways how to do it. You can copy your source files to Apify Cloud manually or import code via Github. But it is recommended to use Apify CLI.install Apify CLI. Guidehere.log in with your account -apify logingo to your migrated project -cd DESTINATIONpush your project to Apify Cloud -apify pushUpdate migration filesIf you want to update every file -apify-scrapy-migrator -m DESTINATIONIf you want to update your input -apify-scrapy-migrator -i DESTINATIONIf you want to updaterequirements.txt-apify-scrapy-migrator -r DESTINATION
Package: apify-shared
Apify Shared PythonTheapify-shared-pythonis a Python library for containing constants and utilities which are used across
our other Python projects likeapify-client-pythonandapify-sdk-python.If you want to develop Apify Actors in Python,
check out theApify SDK for Pythoninstead.InstallationRequires Python 3.8+You can install the package from itsPyPI listing.
To do that, simply runpip install apify-sharedin your terminal.
Package: apigatewaydisconnectapi
Provides a boto3 client class by the same name with a disconnect method for
disconnecting websocket clients.The boto3 client for managing API Gateway connected websockets provides
a mechanism for posting data back to a client, but does not provide
a mechanism for forcing the disconnect of a client. It is left up to
the developer to build a signature version 4 authentication and
make the DELETE call themselves.This package creates a boto3 client class calledapigatewaydisconnectapithat supports disconnecting a client. The client object is created in the
same way that theapigatewaymanagementapiis created.classApiGatewayDisconnectApi.ClientA low-level client representing ApiGatewayDisconnectApiimportapigatewaydisconnectapiimportboto3client=boto3.client('apigatewaydisconnectapi')disconnect(**kwargs)Disconnects the specified connectionRequest Syntaxresponse=client.disconnect(ConnectionId='string')ParametersConnectionId(string) –[REQUIRED]The identifier of the connection that a specific client is using.ReturnsNone
Package: apigateway-sdk-python
API Gateway SDK для подписи запросов на PythonДля вызова API опубликованных c режимом аутентификации APP, запрос должен быть подписан при помощи APP_KEY и SECRET_KEY.
Для подписи запросов используются API Gateay SDK на одном из поддерживаемых языков программирования.ПререквизитыPython 3.8 и выше;pip 19.3.x и выше;requests 2.6 и выше.Подключение SDK к проектуУстановите SDK:pipinstallapigateway-sdk-pythonИмпортируйте в проект библиотеку signer из apigateway-sdk-python и библиотеку requests.fromapigateway_sdk_pythonimportsignerimportrequestsПример использования SDKВ проекте с подключенным SDK создайте новый signer и передайте в негоAPP_KEYиSECRET_KEY.sig=signer.Signer()sig.Key="key"sig.Secret="secret"Создайте запрос, в котором укажите метод, URI, заголовки и тело запроса.r=signer.HttpRequest("POST","https://my-domain.example.com/v1/test",{"x-stage":"RELEASE"},"body")Вызовите функцию для подписывания запроса. Функция автоматически добавит заголовкиX-Sdk-DateиAuthorization.sig.Sign(r)Обратитесь к API и просмотрите ответ.resp=requests.request(r.method,r.scheme+"://"+r.host+r.uri,headers=r.headers,data=r.body)print(resp.status_code,resp.reason)print(resp.content)
Package: api-gateway-v2-to-wsgi
api-gateway-v2-to-wsgitranslation from the aws api gateway v2.0 lambda event to wsgiinstallationpipinstallapi-gateway-v2-to-wsgiusageimportapi_gateway_v2_to_wsgifrom...importapp# app is your wsgi callable, such as the `Flask(...)` object from `flask`lambda_handler=api_gateway_v2_to_wsgi.make_lambda_handler(app)sample applicationfor a full sample, seetesting/examplemore informationfor more information on how I set up my lambda, seetesting/example.md.additionally, see theapi gateway documentation(though it's not very good
at the time of writing so glhf)seems thelambda integration guideis slightly better
Package: apigee-ci-tool
APIGEE CI ToolThis small module has been built with the whole purpose of making Apigee CICD easier.The first iteration consists ofpolicyParser:This makes the process of policy population of Apigee API Proxies easier. Doing this in the UI is very simple but, when we want to do this programmatically is not the same case. In CICD pipelines for example, building an ecosystem that enables the developers to interact with their proxies adding, modifing and removing policies is crucial. That's why this module exists.Future version:targetParser.This is a work in progress. Future versions to come.Documentation will be released soon.
Package: apigee-python
Apigee - Python|pypi| |build| |coverage| |license|In this repository, you'll find all the information about integrating Apigee with Python.What is Apigee?Apigee helps you to:Interact with the apigee edge apiCreate a free Apigee AccountGo toApigee_ and click Sign Up.InstallationYou can install the apigee Python SDK using the following command... code-block::pip install apigee-pythonFor python3, use the following command.. code-block::pip3 install apigee-pythonManagement SDK UsageTo use the management library you will need to instantiate an Apigee objectfrom apigee_python.v1.organizations import Apis

org_name = 'myorg'
username = 'xxx'
password = 'xxx'

client = Apis(org_name, username, password)

results = client.get()
print(results)
Package: apigentools
apigentools - Generate API Clients with EasePurposeThe purpose of the apigentools package is providing an easy way to generate API clients fromOpenAPI v3 specificationfor multiple languages usingopenapi-generator.Key ConceptsDefinition of structure ofSpec Repo- A repository with all the configuration for apigentools and openapi-generator as well as the actual OpenAPI spec of your APIReproduciblecode generationA recommendedworkflowAbility topatch openapi-generator templatesas well asadd your own templatesGet ItDocumentation:https://apigentools.readthedocs.ioInstall from PyPI:pip install apigentoolsDefault container image with useful tooling:datadog/apigentools:latest
Package: api-geoguessr
This is a Geoguessr API client written in Python. It allows you to interact with the Geoguessr API, such as getting information about users, challenges, maps, and scores.To install the package, run the following command:pip install geoguessr-apiOnce the package is installed, you can create a client object by passing your NCFA cookie to the constructor:fromgeoguessr_asyncimportGeoguessrclient=Geoguessr("your_ncfa_cookie")To get your NCFA cookie, login to geoguessr, open your dev tools (Ctrl+Shift+I), go to Storage/Cookies and copy the value of_ncfa.You can then use the client object to get information about users, challenges, maps, and scores. For example, to get information about an user with his ID, you can use the following code:user=client.get_user_infos(userId)TheProfileobject will contain information such as your username, country, and number of games played.To get information about a challenge, you can use the following code:challenge=client.get_challenge_infos("https://geoguessr.com/challenge/xxxx")TheChallengeobject will contain information such as the challenge name, description, and time limit.To get information about a map, you can use the following code:map=client.get_map_infos("https://geoguessr.com/maps/xxxx")TheMapobject will contain information such as the map name, size, and location.To get information about a score, you can use the following code:score=client.get_challenge_score("https://geoguessr.com/challenge/xxxx")TheScoreobject will contain information such as the players' name, score, and time.When getting the score of a challenge, it automatically plays it, pinging (0, 0) each round.Example: Get results of a challenge as a list of dictionnariesscore=client.get_challenge_score("https://geoguessr.com/challenge/xxxx")scores=[]forsinscore:d_player={"userId":s.userId,"userName":s.playerName,"total":s.totalScore,"roundPoints":s.gamePlayerGuessesRoundScoreInPoints,"roundTimes":s.gamePlayerGuessesTime}scores.append(d_player)print(scores)I hope you find this package useful! Please let me know if you have any questions or feedback.
Package: apigo
apigoget a fast REST mock server out of the boxInstallationpipinstall-Uapigoor install withPoetrypoetryaddapigoThen you can runapigo--help🛡 LicenseThis project is licensed under the terms of theMITlicense. SeeLICENSEfor more details.📃 Citation@misc{apigo,
  author = {nidhaloff},
  title = {get a fast REST mock server out of the box},
  year = {2021},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/nidhaloff/apigo}}
}CreditsThis project was generated withpython-package-template.
Package: apigpio
apigpioapigpio - an asyncio-based python client for pigpiopigpioprovides a very
convenientpigpioddaemon which can be used through a pipe or socket interface
to access GPIOs on the Raspberry Pi.apigpiois a python client library that uses asyncio to access thepigpioddaemon. It’s basically a (incomplete) port of the original python client provided with pigpio.Installationapigpio is available on Pypi and can be installed with pip:pip install apigpioTo install it from sources: :git clonehttps://github.com/PierreRust/apigpio.gitcd apigpio
python setup.py installUsageSee the examples in thesamplesdirectory.
Package: apigpio-mpf
apigpioapigpio - an asyncio-based python client for pigpioForked fromhttps://github.com/PierreRust/apigpiobecause it is kind of unmaintained.
We added some more feature (I2C) and fixed Python 3.7 support.pigpioprovides a very
convenientpigpioddaemon which can be used through a pipe or socket interface
to access GPIOs on the Raspberry Pi.apigpiois a python client library that uses asyncio to access thepigpioddaemon. It’s basically a (incomplete) port of the original python client provided with pigpio.Installationapigpio is available on Pypi and can be installed with pip:pip install apigpio-mpfTo install it from sources:git clone https://github.com/missionpinball/apigpio.git
cd apigpio
python setup.py installUsageSee the examples in thesamplesdirectory.
Package: api-gpt4
GPT-4 APIThe GPT4 API project aims to provide an automated interface for interacting with the GPT-4 (Generative Pre-trained Transformer 4) model developed by OpenAI. GPT-4 is a state-of-the-art natural language processing model capable of generating human-like text based on input prompts.DescriptionTheGPT-4 APIis an interface for interacting with the powerful GPT-4 language model. It allows you to generate natural language text, perform question-answering tasks, and more. Whether you're building chatbots, content generators, or creative writing tools, GPT-4 has got you covered!Table of ContentsPrerequisitesInstallationUsageFeaturesContributingLicensePrerequisitesMake sure you have the following installed-Python: You'll need Python installed on your system.Selenium: We'll be using Selenium for web automation.InstallationClone this repository:gitclonehttps://github.com/anupammaurya6767/GPT4.gitInstall dependencies:pipinstallseleniumOrpip install api-gpt4Set up your GPT-4 credentials (Microsoft account username, password, etc.) inconfig.ini.UsageInitialize the GPT-4 API:fromapi.gpt4importGPT4ap=GPT4(config_file='config.ini')Log in to the GPT-4 service:ap.login()Ask questions or generate text:question='What is the meaning of life?'ap.ask_question(question,max_t=10)response=ap.get_response()Close the API connection when done:ap.close()FeaturesNatural Language Generation: Create human-like text.Question-Answering: Get accurate answers to queries.Customizable: Fine-tune GPT-4 for specific tasks.Scalable: Handle large volumes of requests.ContributingContributions are welcome! If you find a bug or have an enhancement idea, please open an issue or submit a pull request.LicenseThis project is licensed under the MIT License - see theLICENSEfile for details.