Saravanan666/pypi-org huggingface dataset:
Package: openapigateway
openapigatewayCreate an Amazon API Gateway from an OpenAPI 3 Document.AWS CDK Construct that creates an Amazon API Gateway HttpApi based on a
parameterized OpenAPI 3 Document.InstallationpipinstallopenapigatewayUsageExample 1: API backed by Lambda Functionopenapi.yaml:[...]paths:/pets:get:summary:List all petsresponses:[...]x-amazon-apigateway-integration:uri:"${API_LAMBDA_ARN}"type:"AWS_PROXY"httpMethod:"POST"connectionType:"INTERNET"payloadFormatVersion:"2.0"x-amazon-apigateway-request-validator:validateRequestBody:truevalidateRequestParameters:true[...]open_api_stack.py:fromaws_cdkimportcore,aws_iamasiam,aws_lambdaas_lambdafromopenapigatewayimportOpenApiGatewayclassOpenApiStack(core.Stack):def__init__(self,scope:core.Construct,construct_id:str,**kwargs)->None:super().__init__(scope,construct_id,**kwargs)# function that handles api request(s)api_lambda=_lambda.Function([...])# create api from openapi document and replace paramsopenapi=OpenApiGateway(self,"OpenAPI Gateway",openapi_path="openapi.yaml",param_value_dict={"API_LAMBDA_ARN":api_lambda.function_arn},fail_on_warnings=True,)# grant HttpApi permission to invoke api lambda functionapi_lambda.add_permission(f"Invoke By{openapi.http_api.node.id}Permission",principal=iam.ServicePrincipal("apigateway.amazonaws.com"),action="lambda:InvokeFunction",source_arn=openapi.http_api_arn,)DocumentationDevelopment setupoptional: use virtualenv# create virtualenv on MacOS and Linuxpython3-mvenv.venv# activate virtualenvsource.venv/bin/activateinstall dependenciesTo install this package, along with the tools you need to develop and publish
it, run the following:pipinstall-e".[dev]"ContributingFork this repositoryCreate your feature branch (git checkout -b feature/fooBar)Commit your changes (git commit -am 'Add some fooBar')Push to the branch (git push origin feature/fooBar)Create a new Pull RequestLicenseMIT
Package: openapi-generator-cli
OpenApi Generator PIP Package GeneratorOpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and
configuration automatically given an OpenAPI Spec (both 2.0 and 3.0 are supported). Please seeOpenAPITools/openapi-generatorThis project checks themaven repositoryonce a day for a new version and will publish this new version automatically as a python package.InstallationYou can install the package either in a virtual environment or globally.# install the latest version of "openapigenerator"pipinstallopenapigenerator# install a specific version of "openapigenerator"pipinstallopenapigenerator==4.2.0After installationopenapi-generatorcommand will be available in your virtual environment or globally
depending on your installationTo check the version, for example. Type the following command# this will print the correct version numberopenapi-generatorversionFurther DocumentationPlease refer to theofficial openapi-generator docsfor
more information about the possible arguments and a detailed usage manual of the command line interface.Like the package?Please leave a star.Have suggestions or feedback?Please raise an issue, happy to hear from you :)
Package: openapi-jira-client
openapi-jira-clientA client library for accessing The Jira Cloud platform REST APIUsageFirst, create a client:fromopenapi_jira_clientimportClientclient=Client(base_url="https://api.example.com")If the endpoints you're going to hit require authentication, useAuthenticatedClientinstead:fromopenapi_jira_clientimportAuthenticatedClientclient=AuthenticatedClient(base_url="https://api.example.com",token="SuperSecretToken")Now call your endpoint and use your models:fromopenapi_jira_client.modelsimportMyDataModelfromopenapi_jira_client.api.my_tagimportget_my_data_modelfromopenapi_jira_client.typesimportResponsemy_data:MyDataModel=get_my_data_model.sync(client=client)# or if you need more info (e.g. status_code)response:Response[MyDataModel]=get_my_data_model.sync_detailed(client=client)Or do the same thing with an async version:fromopenapi_jira_client.modelsimportMyDataModelfromopenapi_jira_client.api.my_tagimportget_my_data_modelfromopenapi_jira_client.typesimportResponsemy_data:MyDataModel=awaitget_my_data_model.asyncio(client=client)response:Response[MyDataModel]=awaitget_my_data_model.asyncio_detailed(client=client)Things to know:Every path/method combo becomes a Python module with four functions:sync: Blocking request that returns parsed data (if successful) orNonesync_detailed: Blocking request that always returns aRequest, optionally withparsedset if the request was successful.asyncio: Likesyncbut the async instead of blockingasyncio_detailed: Likesync_detailedby async instead of blockingAll path/query params, and bodies become method arguments.If your endpoint had any tags on it, the first tag will be used as a module name for the function (my_tag above)Any endpoint which did not have a tag will be inopenapi_jira_client.api.defaultBuilding / publishing this ClientThis project usesPoetryto manage dependencies  and packaging.  Here are the basics:Update the metadata in pyproject.toml (e.g. authors, version)If you're using a private repository, configure it with Poetrypoetry config repositories.<your-repository-name> <url-to-your-repository>poetry config http-basic.<your-repository-name> <username> <password>Publish the client withpoetry publish --build -r <your-repository-name>or, if for public PyPI, justpoetry publish --buildIf you want to install this client into another project without publishing it (e.g. for development) then:If that projectis using Poetry, you can simply dopoetry add <path-to-this-client>from that projectIf that project is not using Poetry:Build a wheel withpoetry build -f wheelInstall that wheel from the other projectpip install <path-to-wheel>
Package: openapi-lookup
OpenAPI LookupA collection of tools and scripts for making the life of security analysts
easier, faster, and more efficient.InstallationInstallopenapi-lookupfrom the Python Package Index:$pipinstallopenapi-lookupUsage$openapis--helpContributingContributions are welcome! Please see [CONTRIBUTING.md][contributing] for more
information.LicenseDistributed under the terms of theMITlicense,openapi-lookupis
free and open source software.IssuesIf you encounter any problems, please [file an issue][issues] along with a
detailed description.
Package: openapi-markdown
OpenAPI Documentation GeneratorThis is a Python script that generates API documentation from an OpenAPI specification file.RequirementsPython 3.xjsonPyYAMLopenapi-coreJinja2Developmentpip install -r requirement.txtinstall a project in editble modepip install -e ./run tests - not unit testspython tests/test.pyUsagefromopenapi_markdown.generatorimportto_markdownapiFile="./tests/openapi.json"outputFile="api_doc.md"to_markdown(apiFile,outputFile)Deploypython3 -m pip install --upgrade twine./pypi.sh
Package: openapi-model-generator
openapi_model_generatorThis library allows us to generate django models and drf serializers using an OpenAPI schema.HowTo Usepipinstallopenapi_model_generator

python-mopenapi_model_generator{open_api_path.json}{destination}python-mopenapi_model_generator{open_api_path.yaml}{destination}As an example:python-mopenapi_model_generatorschema.esb.jsonbase_dirorpython-mopenapi_model_generator/home/user/schema.esb.json/home/user/base_dirThis command creates base models and serializers based on its models into the directory provided.Then you can use them to define models and serializers in your Django+DRF application.models.py:fromutilsimportdefine_modelsfrombase_dirimportbase_modelsdefine_models(['Model1','Model2',...],base_models,locals())serializers.py:fromutilsimportdefine_serializersfrombase_dirimportbase_serializersfrom.importmodelsdefine_serializers(['Model1','Model2',...],base_serializers,locals(),models)After that you can use them:importpydocmodel_1=pydoc.locate('{django_app}.models.Model1')model_2=pydoc.locate('{django_app}.models.Model2')...serializer_1=pydoc.locate('{django_app}.serializers.Model1Serializer')serializer_2=pydoc.locate('{django_app}.serializers.Model2Serializer')
Package: openapi-parser
OpenAPI 3.0 ParserThis package provides functionality to analyzeOpenAPI 3.0 Specificationfiles
and build clients and servers from that specification.For more details, please refer theProject DocumentationExample UsageFrom the command line:$python-mopenapi_parserdata/petstore.yamlFrom the Python:fromopenapi_parser.exporterimportPackageWriterfromopenapi_parser.parser.loaderimportOpenApiParserdefmain():parser=OpenApiParser.open('data/petstore.yaml')parser.load_all()package_writer=PackageWriter(parser)package_writer.write_package()return0if(__name__=='__main__'):exit_code=main()exit(exit_code)TODOs:Model generator:Core functionalityClass inheritance supportEnums supportRequired properties in combination withreadOnly/writeOnlyDiscriminator property supportCyclic refs resolutionSupport ofadditionalPropertiesinside classClient generatorCore functionalitySmart body encodingSmart response decodingstyle-encodingschemaandcontentinside parameters conflict supportEnums for parameters supportCookies parameters supportMethods descriptionsAuthorization supportMetadata extractorVersionLicenceDescriptionServersSecurity definitionsServer generatorTest coverageDocumentationCommand-line interfaceBasic CLI supportExtended CLI supportSee Also:Project DocumentationOpenAPI 3.0 SpecificationJSON Schema Standard
Package: openapi-perf
OpenAPI Perf🤖Automatic OpenAPI Performance Testing🤖Documentation:https://openapi-perf.awtkns.comSource Code:https://github.com/awtkns/openapi-perfContinous Integration:https://github.com/awtkns/openapi-perf-actionThis project will make use of the OpenAPI schema to build an automated REST API performance testing and benchmarking tool. OpenAPI defines an interface for REST APIs allowing automated generation of an API schema which provides insights on the API's usage and expected input and response values. Using the OpenAPI schema we hope automatically generate tests covering all endpoints. We will use these generated tests to both test for endpoint correctness and to gather relevant performance metrics such as response time. We will finally generate an informative report on endpoint performance and correctness, allowing developers to quickly determine potentially problematic endpoints and endpoints that would benefit most from optimization.Installationpipinstallopenapi-perfUsageTest GenerationThis will create generate property-based performance tests for an endpoint and save the test schema to your results directory.fromopenapi_perfimportOpenAPIPerfop=OpenAPIPerf(endpoint_url="http://localhost:5000",results_dir="/path/to/results/directory")You can also load existing tests from a test schema file like this:op=OpenAPIPerf(test_schema_path="path/to/test_schema.json")Schema files can be modified to configure test execution.Test ExecutionTo run these tests, useop.run()This will generate a report pdf file in your results directoryFor detailed usage, refer to ourdocs
Package: openapipy
OpenAPI概述OpenAPI集成了各类第三方的 SDK。安装pip3 install openapipy使用支付宝https://opendocs.alipay.com/open/270/105898fromopenapi.providers.alipayimportClient,Resultclient=Client(app_id='2016081500252288',app_private_key_path='./resources/app_private_test2',app_cert_public_key_path='./resources/appCertPublicKey_2016081500252288_test.crt',alipay_root_cert_path='./resources/alipayRootCert_test.crt',alipay_cert_public_key_path='./resources/alipayCertPublicKey_RSA2_test.crt',is_sandbox=True)pc_pay_params=client.build_query_params(client.build_params('alipay.trade.page.pay',{'subject':'popmart-molly','out_trade_no':'pc123456','total_amount':'999.99','product_code':'FAST_INSTANT_TRADE_PAY'},notify_url='http://47.94.172.250:9527/api/v1/pay/alipay/',return_url='http://47.94.172.250:9527/api/v1/pay/alipay/'))pc_pay_url=f'{client.API_BASE_URL}?{pc_pay_params}'print(pc_pay_url)result:Result=client.request('get','alipay.trade.query',params={'out_trade_no':'pc123456',# 'trade_no': ''})print(result)微信importjsonfromopenapi.providers.wechat.payimportClientwxpay_api=Client(app_id='app_id',mch_id='mch_id',api_key_path='api_key_path',is_sandbox=False)# 查询订单result=wxpay_api.request('post','/pay/orderquery',data={# 'out_trade_no': '9wfafGR31rCytY68wSFcXCII','transaction_id':'4200001591202211145504991626'})print(result)data={'body':'米诺地尔町','out_trade_no':'1232112359910','total_fee':1,'spbill_create_ip':'127.0.0.1','notify_url':'htt','trade_type':'NATIVE','attach':json.dumps({'x':1})}# 创建订单 -> pcresult=wxpay_api.request('post','/pay/unifiedorder',data=data)print(result)# 创建订单 -> h5data.update(trade_type='MWEB',out_trade_no='1231asd1222')result=wxpay_api.request('post','/pay/unifiedorder',data=data)print(result)# 创建订单 -> jsapi, 微信内data.update(trade_type='JSAPI',out_trade_no='21321asd12311313',openid='ofwIAuEgpTZZwdPc1aort93xO')result=wxpay_api.request('post','/pay/unifiedorder',data=data)print(result)ifresult.result_code==wxpay_api.codes.SUCCESS:jsapi_data=wxpay_api.get_jsapi_data(result.data['prepay_id'])print(jsapi_data)抖店https://op.jinritemai.com/docs/api-docs/13/54fromopenapi.providers.doudianimportClientasDouDianClient,Resultclient=DouDianClient('your_appid','your_secret','your_shop_id')# 获取商品列表result:Result=client.request('post','/product/listV2',data={'page':1,'size':10})print(result)小鹅通https://api-doc.xiaoe-tech.com/?s=/2&page_id=420fromopenapi.providers.xiaoetongimportClientasXiaoetongClient,Resultclient=XiaoetongClient('your_appid','your_secret','your_client_id')# 获取分销人列表result:Result=client.request('post','/xe.distributor.list.get/1.0.0',data={})print(result)支持2022 By ZhichaoLiu.
Package: openapi-pydantic-models
openapi-pydantic-modelsOpenAPI Specification v3.1.0objects implemented
aspydanticmodels.Installpipinstallopenapi-pydantic-modelsUsageIt can load whole OpenAPI specification:importrequestsimportyamlfromopenapi_pydantic_modelsimportOpenAPIObjecturl="https://rapidocweb.com/specs/petstore_extended.yaml"response=requests.get(url)data=yaml.full_load(response.text)spec=OpenAPIObject.model_validate(data)All parts of OpenAPI object tree are represented by Python classes with static type
infos:repr(spec.paths["/pet/{petId}/uploadImage"].post.responses["200"])ResponseObject(description='successful operation',headers=None,content={'application/json':MediaTypeObject(schema_={'$ref':'#/components/schemas/ApiResponse'},example=None,examples=None,encoding=None)},links=None)Any object from object tree can always be exported back to OpenaAPI data (model_dump) viamodel_dump()method:spec.paths["/pet/{petId}/uploadImage"].post.responses["200"].model_dump(){'description':'successful operation','content':{'application/json':{'schema':{'$ref':'#/components/schemas/ApiResponse'}}}}Loading specification performs minimal (unavoidable) validation: it rises exception for
unknown fields:fromopenapi_pydantic_modelsimportResponseObjectdata={"description":'successful operation',"foo":"bar"}obj=ResponseObject.model_validate(data)# ValidationError: 1 validation error for ResponseObject# foo#   extra fields not permitted (type=value_error.extra)Any other validations defined by OpenAPI Specification are not implemented.openapi-pydantic-modelsintends to make programmatic editing of OpenAPI specifications
easier and developer friendly (compared to working with "raw"dict-s). Complex spec
validations are already implemented in other packages.Even though "extra" fields in input are not allowed,4.9 Specification
Extensionsare fully and
transparently supported for objects that allow them:data={"description":'successful operation',"x-foo":"bar","x-bar":[42]}obj=ResponseObject.model_validate(data)obj.extensionsExtensionsStorage({'x-foo':'bar','x-bar':[42]})obj.model_dump(){'description':'successful operation','x-foo':'bar','x-bar':[42]}And of course, all objects can be edited:obj.description="ZOMG!"obj.extensions["x-baz"]={1:{2:3}}obj.model_dump(){'description':'ZOMG!','x-foo':'bar','x-bar':[42],'x-baz':{1:{2:3}}}where specification extensions are protected from invalid keys:obj.extensions["baz"]=34# KeyError: 'baz'obj.extensions["x-baz"]=34# OKWhere are the docs for this thing?Makes no sense writing them sinceOpenAPI
Specificationis already fully and excellently
documented.In OpenAPI docs, wherever you see "Foo Object" you can findclass FooObjectinopenapi-pydantic-models. Reverse works too: if you want to know what isopenapi_pydantic_models.ServerObjectcheck4.8.5 Server
ObjectWhere are the tests?There is one!I know :-( !This was written during one lazy weekend afternoon. When I get one of those again, I
might add more tests.
Package: openapi-python-generator
Openapi Python GeneratorDocumentation:hereFeaturesEase of use. Provide input, output and the library, and the generator will do the rest.Type safety and type hinting.OpenAPI python generatormakes heavy use of pydantic models to provide type-safe data structures.Support for multiple rest frameworks.OpenAPI python generatorcurrently supports the following:httpxrequestsaiohttpAsync and sync code generation support, depending on the framework. It will automatically create both for frameworks that support both.Easily extendable using Jinja2 templates. The code is designed to be easily extendable and should support even more languages and frameworks in the future.Fully tested. Every generated code is automatically tested against the OpenAPI spec and we have 100% coverage.Usage as CLI or as library.RequirementsPython 3.7+InstallationYou can installOpenapi Python GeneratorviapipfromPyPI:$pipinstallopenapi-python-generatorUsagePlease see theQuick start pagefor details.RoadmapSupport for all commonly used http libraries in the python ecosystem (requests, urllib, ...)Support for multiple languagesSupport for multiple authentication schemesSupport custom themesContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,Openapi Python Generatoris free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsSpecial thanks to the peeps fromopenapi-schema-pydantic,
which already did a lot of the legwork by providing a pydantic schema for the OpenAPI 3.0.0+ specification.This project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.
Package: openapi-readme
OpenAPI Readme GeneratorGenerates Markdown suitable for a README file from a localopenapi.jsonfile.This tool is still under development, progress so far is only a days work so
there is a lot to do with extra functionality and refactoring.UsageOptions SummaryOptions in Detail--route-level--injectTODOUsageopenapi-readme [OPTIONS]Run this in the same directory as youropenapi.jsonfile. By default the
Markdown output will be printed to the console, but you can redirect it out to
a file too.The particular styling of the generated Markdown is currently hardcoded, though
plans are afoot to implement some sort of themeing.Options Summary--route-level INTEGER: Number of heading levels to use.  [default: 4]--inject / --no-inject: Inject generated output into a README file.  [default: False]--install-completion: Install completion for the current shell.--show-completion: Show completion for the current shell, to copy it or customize the installation.--help: Show this message and exit.Options in Detail--route-levelSpecify the heading level for each Route in the generated documentation. This
defaults to4if not specified, ie:#### **`GET`** _/user/list_--injectInjects the new Markdown directly into aREADME.mdfile in the current
directory, if it is found.
You need to add the placeholder comment<!-- openapi-schema -->to your markdown where you want it to be injected:This is some preceeding text### API Schema description<!-- openapi-schema -->### Next sectionThe document continues unaffected after the injection.Existing (previously injected) Schemas will bereplacedby this new data.TODOFuture improvement plansTake more info from theopenapi.jsonfile
Package: openapi-resolver
OpenAPI ResolverThis module recursively parses openapi specs resolving references.TestTests run locally viatoxOr viacircleci-localcircleci buildUsageThe module has an embedded script that can be run via$ python -m openapi_resolver --help

    usage: __main__.py [-h] src_file [dst_file]

    Recursively resolves and bundles OpenAPI v3 files.

    positional arguments:
      src_file    An OpenAPI v3 yaml file.
      dst_file    Destination file, default is stdout.

    optional arguments:
      -h, --help  show this help message and exitTo create an openapi bundle from a spec file just run$ python -m openapi_resolver sample.yamlYou can use this module to normalize two specs before diffing, eg:$ python -m openapi_resolver one.yaml normal-one.yaml
    $ python -m openapi_resolver two.yaml normal-two.yaml
    $ diff normal-one.yaml normal-two.yaml
Package: openapi-scanner
OpenAPI Vulnerability ScannerCommand-line tool for pentestingOpenAPI, formerly known as Swagger.用于渗透测试 OpenAPI 的命令行工具 以前称为 Swagger。$pipxinstallopenapi_scanner
$openapi-scanhttps://polon.nauka.gov.pl/opi-ws/api/swagger.json--header'Authorization: Bearer XXX'$openapi-scan--helpUseasdforpyenvto install the latest python version.
Package: openapi-schemas-pydantic
OpenAPI Schemas for PydanticDocumentation:https://openapi-schemas.dymmond.com📚Source Code:https://www.github.com/dymmond/openapi-schemas-pydanticThis library is a fork ofpydantic-openapi-schema.The library solved some known issues from the previous also forked repo and we have plans of continuing to support the fork as
well.Why the fork?We want to make sure we are able to add extras unique toEsmeraldwithout
bothering Starlite with someting that might not even be their scope. If we find common ground we will be also
contribute to Starlite to make sure they also get the latest if they don't have it already.We support everything opensource.Usage is mostly identical to upstream package.Installationpipinstallopenapi-schemas-pydanticContributingCheck thecontributingdocumentation and see how you can help.