Package: absarsnew
Getting Started with APIMATIC CalculatorGetting StartedIntroductionSimple calculator API hosted on APIMATICInstall the PackageThe package is compatible with Python versions2 >=2.7.9and3 >=3.4.
Install the package from PyPi using the following pip command:pipinstallabsarsnew==1.1You can also view the package at:https://pypi.python.org/pypi/absarsnewInitialize the API ClientThe following parameters are configurable for the API Client:ParameterTypeDescriptiontimeoutfloatThe value to use for connection timeout.Default: 60max_retriesintThe number of times to retry an endpoint call if it fails.Default: 3backoff_factorfloatA backoff factor to apply between attempts after the second try.Default: 0The API client can be initialized as follows:fromapimaticcalculator.apimaticcalculator_clientimportApimaticcalculatorClientfromapimaticcalculator.configurationimportEnvironmentclient=ApimaticcalculatorClient(environment=,)Client Class DocumentationAPIMATIC Calculator ClientThe gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.ControllersNameDescriptionsimple_calculatorGets SimpleCalculatorControllerAPI ReferenceList of APIsSimple CalculatorSimple CalculatorOverviewGet instanceAn instance of theSimpleCalculatorControllerclass can be accessed from the API Client.simple_calculator_controller = client.simple_calculatorGet CalculateCalculates the expression using the specified operation.:information_source:NoteThis endpoint does not require authentication.defget_calculate(self,operation,x,y)ParametersParameterTypeTagsDescriptionoperationOperationTypeEnumTemplate, RequiredThe operator to apply on the variablesxfloatQuery, RequiredThe LHS valueyfloatQuery, RequiredThe RHS valueResponse TypefloatExample Usageoperation=OperationTypeEnum.MULTIPLYx=222.14y=165.14result=simple_calculator_controller.get_calculate(operation,x,y)Model ReferenceEnumerationsOperation TypeOperation TypePossible operators are sum, subtract, multiply, divideClass NameOperationTypeEnumFieldsNameSUMSUBTRACTMULTIPLYDIVIDEUtility Classes DocumentationApiHelperA utility class for processing API Calls. Also contains classes for supporting standard datetime formats.MethodsNameDescriptionjson_deserializeDeserializes a JSON string to a Python dictionary.ClassesNameDescriptionHttpDateTimeA wrapper for datetime to support HTTP date format.UnixDateTimeA wrapper for datetime to support Unix date format.RFC3339DateTimeA wrapper for datetime to support RFC3339 format.Common Code DocumentationHttpResponseHttp response received.ParametersNameTypeDescriptionstatus_codeintThe status code returned by the server.reason_phrasestrThe reason phrase returned by the server.headersdictResponse headers.textstrResponse body.requestHttpRequestThe request that resulted in this response.HttpRequestRepresents a single Http Request.ParametersNameTypeTagDescriptionhttp_methodHttpMethodEnumThe HTTP method of the request.query_urlstrThe endpoint URL for the API request.headersdictoptionalRequest headers.query_parametersdictoptionalQuery parameters to add in the URL.parametersdict | stroptionalRequest body, either as a serialized string or else a list of parameters to form encode.filesdictoptionalFiles to be sent with the request.