Giter VIP home page Giter VIP logo

openapi_to_sdk's Introduction

Vector API to SDK.

Python SDK for API automation. Currently supports FastAPI implementation.

It is used as below:

from automation_tool.sdk_automation import PythonSDKBuilder
sdk = PythonSDKBuilder(
    url="https://api.vctr.ai",
    inherited_properties=['username', 'api_key'],
    decorators=['retry()'],
)
sdk.to_python_file(import_strings=['from vectorai.api.utils import retry'])

Sample Output:

# This python file is auto-generated. Please do not edit.
from vectorai.api.utils import retry


class ViAPIClient:
	def __init__(self, username, api_key, ):
		self.username = username		
		self.api_key = api_key		

	@retry()
	def request_api_key(self,email, description, referral_code, ):
		"""Request an api key
Make sure to save the api key somewhere safe. If you have a valid referral code, you can recieve the api key more quickly.
    
Args
========
username: Username you'd like to create, lowercase only
email: Email you are using to sign up
description: Description of your intended use case
referral_code: The referral code you've been given to allow you to register for an api key before others

"""
		return requests.post(
			url='https://api.vctr.ai//project/request_api_key',
			json=dict(
				username=self.username,
				email=email, 
				description=description, 
				**kwargs)).json()

Improvements

  • Add more documentation.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.