Saravanan666/pypi-org huggingface dataset:
Package: api.mock
# APIMockHelper[![PyPI version](https://badge.fury.io/py/api.mock.svg)](https://pypi.python.org/pypi/api.mock/1.0.4)Push config files to Android device. See more https://github.com/brucezz/APIMock## InstallationInstall by `pip`:```pip install api.mock --upgrade```## USAGE> $ api.mock -h```API Mock Helper.Usage:api.mock [init | push] [-d DIR] [-v | --verbose]api.mock clean remote [-d DIR] [-v | --verbose]api.mock clean local [-v | --verbose]api.mock (-h | --help)api.mock --versionOptions:init                Generate default config files.push                Push configs to Android device.clean remote        Remove config files on Android device.clean local         Remove local config files.-d DIR              The location of config files (default current directory).-v --verbose        Print more messages.-h --help           Show this message.--version           Show version.More information see:https://github.com/brucezz/APIMockHelperhttps://github.com/brucezz/APIMock```
Package: api-mocker-generator
API Mockerconfig and test
data generator based on Swagger/OpenAPI Spec.Installation$pipinstallapi-mocker-generatorUsageusage: local_main.py [-h] --swagger SWAGGER --output OUTPUT [--verbose]

optional arguments:
  -h, --help         show this help message and exit
  --swagger SWAGGER  Location of swagger document. Could be HTTP endpoint or
                     local file system
  --output OUTPUT    Output directory for configuration and mocked responses
  --verboseExample command$ api-mocker-generator --swagger http://localhost:8080/api-docs --output ./outRunning locally during development$ python local_main.py --swagger http://localhost:8080/api-docs --output ./outVerbose debuggingTo turn on verbose output for debugging, set the--verboseargument.Publishing Updates to PyPiFor the maintainer, increment the version number in
api_mocker_generator.py and run the following:dockerbuild-f./Dockerfile.buildenv-tnamuan/api_mocker_generator:build.dockerrun--rm-it--entrypointpythonnamuan/api_mocker_generator:buildsetup.pypublishEnter the username and password for pypi.org repo when prompted
Package: apimodels
APIModelAdvanced models for non-standard modern JSON APIs.Documentation:https://apimodel.readthedocs.io/en/latest/Source Code:https://github.com/thesadru/apimodelAdvanced models for non-standard modern JSON APIs. Supports extensive conversion and validation with several tools to help speed up development.
Works with both synchronous and asynchronous models seamlessly.
Fully tested and type-hinted.Key FeaturesSeamless data parsing through annotations.Supports extensive conversion and validation.Automatic code generation from json to speed up development.Inspired by pydantic to ensure familiarity.Localization support.Fully tested and type-hinted.No requirements.ExampleYou can see more examples in the docs.importtypingimportdatetimeimportapimodelclassUser(apimodel.APIModel):id:intusername:strprofile:str# UNIX or ISO parsingcreated_at:datetime.datetime@apimodel.validator()def_complete_profile_url(self,profile:str)->str:"""Take the raw profile ID and turn it into a full url"""returnf"https://example.com/assets/profile/{profile}.png"# inheritanceclassAttendee(User):status:typing.Literal["attending","interested","absent"]|None=None@apimodel.root_validator()def_parse_status(self,values:dict[str,typing.Any])->dict[str,typing.Any]:"""Take the entire JSON and update it accordingly"""# made for non-standard APIsif"attending"invalues:values["status"]="attending"ifvalues["attending"]else"absent"elif"interested"invalues:values["status"]="interested"ifvalues["interested"]else"absent"# excess values get thrown awayreturnvaluesclassEvent(apimodel.APIModel):# allow easily renaming fieldstime:datetime.datetime=apimodel.Field(alias="happening_at")# clean nested modelsattendees:list[User]
Package: apimon
An exporter about prometheus, written in Python, mainly provides monitoring of api data functions, as follows:
     1. Request quantity
     2. Request duration per second
     3. The number being requested
     4. The last request took timeFor details, please see:https://github.com/prometheus/client_pythonUsage example:
"""from apimon import ApiMonitor

apimonitor = ApiMonitor(app_name="your app name")
apimonitor.setup_metrics(app)  # your app object instance

"""
Package: apim-subscription-manager
APIM Subscriptions ManagerPython utility which manages users and their API subscriptions on the Azure API Management.PrerequisitesService principal with correct permissions on the subscription where APIM is deployedTenant IDClient IDClient Secret
Subscription ID where APIM is deployedSubscription ID
Resource group where APIM is deployedResource group name
APIM NameName of the APIM instance
Package: apimyapi
A simple python wrapper for Google Maps API.
Use it to get the formatted address or co-ordinates of any location.The code is Python 2, but Python 3 compatible.InstallationFast install:pip install mygmapFor a manual install get this package:wget https://github.com/nikhilkumarsingh/mygmap/archive/master.zip
unzip master.zip
rm master.zip
cd mygmap-masterInstall the package:python setup.py installExamplefromgeoimportlocator# get formatted address of any locationprintlocator.get_address("rohini, delhi")# get co-ordinates of locationprintlocator.get_coordinates("delhi")Here is the output:Rohini, New Delhi, Delhi, India
(28.7040592, 77.10249019999999)
Package: apin
1、什么是apinapin是一个无需写代码，就可以完成接口自动化测试的框架，只需要通过json或yaml文件编写非常简洁的用例数据，即可完成接口自动化测试，并生成自动化测试报告。旨在帮助更多不会写代码的小伙伴掌握接口自动化测试的能力。框架使用起来非常简单，易上手，只需要几个小时就能掌握！目前只是第一个版本，还存在一些问题和功能，后续会继续完善，在使用的过程中发现问题，可以通过邮箱反馈开发者：柠檬班-木森email：musen_nmb@qq.com2、安装apinapin是基于python3.6开发的，安装前请确认你的python版本>3.6安装命令pip install apin3、使用文档：https://apin.readthedocs.io/en/latest/
Package: apinator-databricks
Apinator-Databricksapinatorbindingsfor theDatabricks API.Examplefromapinator_databricks.commonimportDatabricksContextfromapinator_databricks.unity_catalogimportDatabricksUnityCatalogApi,uc_modelcontext=DatabricksContext(access_token="TOKEN",# Will be kept secretaccount="account",)api=DatabricksUnityCatalogApi(context)shares:uc_model.ShareList=api.datashares.list()forshareinshares.shares:assertisinstance(share,uc_model.SharePartial)# Not necessary, pydantic guarantees this...
Package: aping-cli
apingA tool to ping multiple hosts at once and export results as Prometheus metrics.Relies onhttps://github.com/romana/multi-ping/(seehttps://stackoverflow.com/a/45746002).Installationpipinstallaping-cliUsageTo run the tool, type:aping"google-dns-1=8.8.8.8""google-dns-2=8.8.4.4"Sample output:Prometheus metrics server available at http://127.0.0.1:8000
google-dns-1 (8.8.8.8): 100.78ms, google-dns-2 (8.8.4.4): 100.78ms
google-dns-1 (8.8.8.8): 123.73ms, google-dns-2 (8.8.4.4): 122.97ms
google-dns-1 (8.8.8.8): 111.99ms, google-dns-2 (8.8.4.4): 112.96ms
google-dns-1 (8.8.8.8): 112.76ms, google-dns-2 (8.8.4.4): 113.86msIn Linux/MacOS environments, ICMP packets can only be sent by processes with root
privileges (this is a requirement of themulti-pingpackage, whichapinguses).
In those cases, the recommended invocation command would be:sudo-E"$(whichaping)""google-dns-1=8.8.8.8""google-dns-2=8.8.4.4"ContributingLocal developmentHow to set up a local environment:python-mvenvvenvsource./venv/bin/activate

python-mpipinstall-Upip
pipinstall-e.-rrequirements-dev.txt

pre-commitinstallResourcesGrafana:Default username and password are bothadmin.https://grafana.com/tutorials/grafana-fundamentals/https://grafana.com/docs/grafana/latest/getting-started/build-first-dashboard/https://grafana.com/docs/grafana/latest/setup-grafana/configure-docker/#run-grafana-container-with-persistent-storage-recommendedPrometheus:https://prometheus.io/docs/concepts/metric_types/https://prometheus.io/docs/practices/histograms/https://github.com/prometheus/client_pythonhttps://prometheus.io/docs/prometheus/latest/getting_started/
Package: api-nichotined
APIThis package is used for REST API classbased, author used it for API flow testing.JSON body response will be converted to python data type. Made it easier for you to use.This package is extending python requests libraryhttps://github.com/requests/requests/How to install$ pip3 install api-nichotinedHow to distribute to pypi$ python setup.py sdist bdist_wheel && python -m twine upload dist/*Usage examplefromAPIimportGet,Postfromimport_fileimporthostpost_body={"name":"Nicholas Frederick"}classGetRequest(Get):def__init__(self,latitude:str,longitude:str):super().__init__()self.url="{0}/dummy?latitude={1}&longitude={2}".format(host["serviceHost"],latitude,longitude)self.headers={"Content-Type":"application/json","Authorization":"TOKEN"}self.execute()classPostRequest(Post):def__init__(self,body:Data):super().__init__()self.url="{0}/dummy".format(host['serviceHost'])self.headers={"Content-Type":"application/json","Authorization":"TOKEN"}self.json=bodyself.execute()if__name__=="__main__":get_data=GetRequest('106','80')post_data=PostRequest(post_body)assertget_data.address_name=="somewhere"assertpost_data.status_code==200Mocker usageBeforehand, edit or extendmocker.pyand add your desired response on that file.$ mitmproxy -p 8888 -s API/modules/mocker/mocker.py
Package: apininja
apininjaapininjais a simple CLI automation tool that generates a small boilerplate module
that serves as api for database models or other models. Currently it generates the basic
CRUD operations as well as functions for serializing a single object to dictionary.Sample OutputA sample output forapininja MyModel# API Created for my_modeldefserialize_my_model(data):return{"id":data.id}defserialize_my_models(lst):serialized=[]foriteminlst:serialized.append(serialize_my_model(item))returnserializeddefmy_model_list_api(lst):returnserialize_my_models(lst)defmy_model_detail_api(data):returnserialize_my_model(data)defmy_model_create_api(*args,**kwargs):passdefmy_model_update_api(*args,**kwargs):passdefmy_model_delete_api(*args):passInstallationpipinstallapininjaUsageapininjaUserModel
Package: apio-django
#Project Description[Currently only Django Framework supported]Apio helps in monitoring of Applications. You can easily integrate(see setup below) it with your application and instantly start tracking errors and performance metrics.##SetupInstallation instructions:https://www.youtube.com/watch?v=tpx4mTuv0-0Create an account onApio signupRegister an application onApio onboardingInstall Apio-django using pippip install apio-djangoAddapio-djangoto your installed Apps in yoursettings.py.Addapio_django.middleware.ApioMiddlewareto list of MiddlewareAddapplication_keyreceived after you onboarded your application on step 2 in yoursettings.pyAPIO_D = { "application_key": generated_application_key }Thats it :) Now on any error you will receive an email on the registered email id and also you can see all the details of your application on the dashboard ofApio##Disclaimer
The Apio service is currently in beta testing phase. We don't take any responsbility of continued service or issues that may arise.##Contact (any queries)Email:apio.monitor@gmail.com
Package: apiogram
ApiogramSimple wrapper for aiogram - little framework for comfortable develop telegram botsimportloggingfrommagic_configimportConfigfromapiogramimportstart_pollingdefmain():"""Main function"""# Logging module configurationlogging.basicConfig(level=logging.DEBUGifConfig.DEBUGelselogging.INFO)# Dafult configuration get from Config objectstart_polling()if__name__=="__main__":"""Run main function"""main()
Package: api-omie
Api Omie (NAO OFICIAL)*Aviso: este projeto nao tem ligacao nenhuma com a omieUse a documentacao oficial!Downloadpipinstallapi-omieComo usarPara usar basta chamar o metodo, 
e passar os argumentos-chave que seram empacotados e transmitidos para api como no exemplofromomieapiimportOmiemeu_app=Omie('key#######','secreet######')r=meu_app.listar_produtos(pagina=1)print(r)
Package: api-orm
=======api-orm=======Interact with API endpoints as Python objects and manage resources in an ORMy wayInstallation============Python version supported: 3.6+.. code-block::pip install api-ormAbout=====We have written many small clients to different APIs. It usually becomes acouple of functions like:.. code-block:: pythonclient.get_customers()client.new_customer()# etcWhen writing our client for our accounting API we wanted a more declarative wayof accessing our data. Also the API supported OData which allows for filteringon all parameters. This made request look more like database access thansimple REST endpoints. So we wanted an interface more like a database ORM.We use django a lot so we would like something we are used to.This library is an attempt to extract the ORM parts of our Visma client so thatwe can reuse the framework for a bunch of other API clients.We want an api very alike the Django ORM:.. code-block:: pythonall_customers = Customer.api.all()a = Customer(**customer_data)a.save()some_customers = Customer.api.filter(name='Dave').exclude(invoice_postal_code__startswith='25')Before we have to write alot of custom validation but in this framework we usethe awesome serializer library marshmallow to transform python objects toHTTP-request data and back. This gives us a declarative way of defining ourmodels and it comes included with validation of schemas and fields.There are also tools available to generate models from and API specificationwhich greatly reduces the implementation time.=========Changelog=========The format is based on `Keep a Changelog: https://keepachangelog.com/en/1.0.0/`,and this project adheres to `Semantic Versioning: https://semver.org/spec/v2.0.0.html`Unreleased----------Added^^^^^Changed^^^^^^^Deprecated^^^^^^^^^^Removed^^^^^^^Fixed^^^^^Security^^^^^^^^
Package: apip
apipAn easy, high level wrapper for the PyPi API. It wraps Pip and PyPi into an easier to use package in Python.FeaturesEasy to use, high level API.Fully asynchronous and non-blocking.InstallationRequires Python 3.7+To installapipon PyPi, runpipinstallapipAPI CoverageThis table covers the coverage of apipFeatureSupportedInstalling PackagesError PortingPypi API*Getting individual version packages: This feature does not have full coverage yet.QuickstartTo get started and see whatapipcan do, run some example programs.>>>importapip>>>importasyncio>>>pip=apip.Pip()>>>asyncio.run(pip.get("module"))>>>print(asyncio.run(pip.list()))
Package: apiparse
.. sectnum::.. contents:: Table Of Contents********apiparse********Parse the patterns of apis of each module=======Purpose=======This program is used to list all the basic building block apis insources or files to understand the fundamental complexity of the programdevelopment. The basic devleoquestion to be answered:- How may threads? types of threads/processes?- How much memory? Greedy and non-greedy memory allocation?- Atomic Locks and thread synchronization?- System APIs used?=====Usage=====Command Line------------Usage: python -m apiparseOptions:--version             show program's version number and exit-h, --help            show this help message and exit-a, --showall         Show all apis-g APIGROUP, --group=APIGROUPapi groups:-p, --showpath        list file xtension paths-f FILENAME, --file=FILENAMEfilename-d DESTNDIR, --destn=DESTNDIRDestination Directory-t, --tree            Show Directory TreeAPI---.. code-block::import apiparsef = apiparse.apiparse.funcnode()f.showapis()
Package: apipclima
PClima APIPClima API - Módulo para recuperação de dados climáticos do PCBr.DESCRIPTIONA documentação do Projeto pode ser encontrada no Portal
      http://pclima.inpe.br/
As escolhas para o download de dados são definidas através 
 de um JSON que pode ser gerado utilizando do Portal API.
      http://pclima.inpe.br/analise/API

versão do Python em que foi testada: 3.6
 
exemplo de uso da API

Token: consultar a documentação para a geração do Token

Copiar o Token, no arquivo $HOME/.pclimaAPIrc (em ambiente Unix/Linux/Mac).
No Windows colocar o arquivo .pclimaAPIrc no diretório inicial do usuário (ex. C:\User\Cliente)


import clima as pcl

Client = pcl.Client()

data = Client.getData(
{ "formato": "CSV", "conjunto": "PR0002", "modelo": "MO0003", "experimento": "EX0003", "periodo": "PE0000", "cenario": "CE0001", "variavel": "VR0001", "frequenciaURL": "Mensal", "frequencia": "FR0003", "produto": "PDT0001", "localizacao": "Ponto", "localizacao_pontos": "-23.56/-46.62", "varCDO": "tasmax" }
)

Client.save(data,"file.csv")
Package: apipe
A-PipeA-Pipeallows to create data pipelines with lazy computation and caching.Features:Lazy computation and cache loadingPickle and parquet serializationSupport for hashing ofnumpyarrays andpandasDataFramesSupport fordask.DelayedobjectsInstallationpipinstallapipeExamplesSimple function cachingimporttimeimportapipeimportnumpyasnpfromloguruimportlogger@apipe.eager_cached()defload_data(table:str):time.sleep(1)arr=np.ones(5)logger.debug(f"transferred array data from table={table}")returnarrlogger.info("start loading data")# --- First pass: transfer data and save on diskdata=load_data("weather-ldn")logger.info(f"finished loading data:{load_data()}")# --- Second pass: load data from diskdata=load_data("weather-ldn")logger.info(f"finished loading data:{load_data()}")Data pipeline with lazy execution and cachingimportapipeimportpandasaspdimportnumpyasnpfromloguruimportlogger# --- Define data transformations via step functions (similar to dask.delayed)@apipe.delayed_cached()# lazy computation + caching on diskdefload_1():df=pd.DataFrame({"a":[1.,2.],"b":[0.1,np.nan]})logger.debug("Loaded{}records".format(len(df)))returndf@apipe.delayed_cached()# lazy computation + caching on diskdefload_2(timestamp):df=pd.DataFrame({"a":[0.9,3.],"b":[0.001,1.]})logger.debug("Loaded{}records".format(len(df)))returndf@apipe.delayed_cached()# lazy computation + caching on diskdefcompute(x,y,eps):assertx.shape==y.shapediff=((x-y).abs()/(y.abs()+eps)).mean().mean()logger.debug("Difference is computed")returndiff# --- Define pipeline dependenciests=pd.Timestamp(2019,1,1)eps=0.01s1=load_1()s2=load_2(ts)diff=compute(s1,s2,eps)# --- Trigger pipeline execution (first pass: compute everything and save on disk)logger.info("diff:{:.3f}".format(apipe.delayed_compute((diff,))[0]))# --- Trigger pipeline execution (second pass: load from disk the end result only)logger.info("diff:{:.3f}".format(apipe.delayed_compute((diff,))[0]))See more examples in anotebook.
Package: apipkg
Welcome to apipkg !With apipkg you can control the exported namespace of a Python package and
greatly reduce the number of imports for your users.
It is asmall pure Python modulethat works on CPython 3.7+,
Jython and PyPy. It cooperates well with Python’shelp()system,
custom importers (PEP302) and common command-line completion tools.Usage is very simple: you can require ‘apipkg’ as a dependency or you
can copy paste the ~200 lines of code into your project.Tutorial exampleHere is a simplemypkgpackage that specifies one namespace
and exports two objects imported from different modules:# mypkg/__init__.pyimportapipkgapipkg.initpkg(__name__,{'path':{'Class1':"_mypkg.somemodule:Class1",'clsattr':"_mypkg.othermodule:Class2.attr",}}The package is initialized with a dictionary as namespace.You need to create a_mypkgpackage with asomemodule.pyandothermodule.pycontaining the respective classes.
The_mypkgis not special - it’s a completely
regular Python package.Namespace dictionaries containname: valuemappings
where the value may be another namespace dictionary or
a string specifying an import location.  On accessing
an namespace attribute an import will be performed:>>>importmypkg>>>mypkg.path<ApiModule 'mypkg.path'>>>>mypkg.path.Class1# '_mypkg.somemodule' gets imported now<class _mypkg.somemodule.Class1 at 0xb7d428fc>>>>mypkg.path.clsattr# '_mypkg.othermodule' gets imported now4 # the value of _mypkg.othermodule.Class2.attrThemypkg.pathnamespace and its two entries are
loaded when they are accessed.   This means:lazy loading - only what is actually needed is ever loadedonly the root “mypkg” ever needs to be imported to get
access to the complete functionalitythe underlying modules are also accessible, for example:frommypkg.subimportClass1Including apipkg in your packageIf you don’t want to add anapipkgdependency to your package you
can copy theapipkg.pyfile somewhere to your own package,
for example_mypkg/apipkg.pyin the above example.  You
then import theinitpkgfunction from that new place and
are good to go.Feedback?If you have questions you are welcome tojoin the#pytestchannel onirc.libera.chat(using an IRC client, viawebchat, or viaMatrix).create an issue on thebugtracker
Package: apipool
Welcome toapipoolDocumentationapipoolallows developer manipulate multi api key at same time. For example, if single api key has 1k/day quota, then you can register 10 api keys, and letapipoolto automatically rotate the key.Features:automatically rotate apikey.built-in usage statistics, easy to search bytime,status,apikey. You can deploy stats collector on any cloud relational database.clean api, minimal code is required to implement complex feature.Example:there’s a google geocoding example at:https://github.com/MacHu-GWU/apipool-project/blob/master/examples/google_geocoding.pyTutorialLet’s walk through with a twitter api example, the api client we use ispython-twitter:https://github.com/bear/python-twitter.Thepython-twitterusage:importtwitter# create api clientapi=twitter.Api(consumer_key="consumer_key"z,consumer_secret="consumer_secret",access_token_key="access_token",access_token_secret="access_token_secret",)# make api callstatuses=api.GetUserTimeline(screen_name="trump")Theapipoolusage:importtwitterfromapipoolimportApiKey,ApiKeyManagerclassTwitterApiKey(ApiKey):def__init__(self,consumer_key,consumer_secret,access_token_key,access_token_secret)self.consumer_key=consumer_keyself.consumer_secret=consumer_secretself.access_token_key=access_token_keyself.access_token_secret=access_token_secretdefuser_01_get_primary_key(self):returnself.access_token_keydefuser_02_create_client(self):returntwitter.Api(consumer_key=self.consumer_key,consumer_secret=self.consumer_secret,access_token_key=self.access_token_key,access_token_secret=self.access_token_secret,)defuser_03_test_usable(self,client):statuses=client.GetUserTimeline(screen_name="trump")iflen(statuses)>=5:returnTrueelse:returnFalseapikey_data_list=[{"consumer_key":xxx,"consumer_secret":xxx,"access_token_key":xxx,"access_token_secret":xxx,},{...},{...},]apikey_list=[TwitterApiKey(**apikey_data)forapikey_datainapikey_data_list]manager=ApiKeyManager(apikey_list=apikey_list)DummyClient:now we can use themanager.dummyclientobject like how we use thetwitter.Api()object. However, the apikey is automatically rotated, and usage events are also automatically recorded.manager.check_usable()# the api key is automatically rotated under the hoodstatuses=manager.dummyclient.GetUserTimeline(screen_name="trump")for_inrange(10):manager.dummyclient.GetUserTimeline(screen_name="trump")StatsCollector:now we can usemanager.statsobject to access usage stats, and also query usage events.>>>manager.stats.usage_count_stats_in_recent_n_seconds(){"xxx access_token_key":3,"xxx access_token_key":4,"xxx access_token_key":3}>>>fromapipoolimportStatusCollection>>>events_list=list(manager.stats.query_event_in_recent_n_seconds(n_seconds=24*3600,status_id=StatusCollection.c1_Success.id,))>>>events_list[Event(apikey_id=xxx,finished_at=datetime(xxx),status_id=xxx),Event(...),...]Quick LinksInstallapipoolis released on PyPI, so all you need is:$pipinstallapipoolTo upgrade to latest version:$pipinstall--upgradeapipool