Skip to main content

Getting Started with APIMATIC Calculator

Getting Started

Introduction

Simple calculator API hosted on APIMATIC

Install the Package

The package is compatible with Python versions 2 >=2.7.9 and 3 >=3.4. Install the package from PyPi using the following pip command:

pip install version-test-v3==1.0.8

You can also view the package at: https://pypi.python.org/pypi/version-test-v3

Initialize the API Client

The following parameters are configurable for the API Client:

Parameter Type Description
environment Environment The API environment.
Default: Environment.PRODUCTION
timeout float The value to use for connection timeout.
Default: 60
max_retries int The number of times to retry an endpoint call if it fails.
Default: 3
backoff_factor float A backoff factor to apply between attempts after the second try.
Default: 0

The API client can be initialized as follows:

from apimaticcalculator.apimaticcalculator_client import ApimaticcalculatorClient

client = ApimaticcalculatorClient(
    environment = Environment.PRODUCTION,)

Test the SDK

You can test the generated SDK and the server with test cases. unittest is used as the testing framework and nose is used as the test runner. You can run the tests as follows:

Navigate to the root directory of the SDK and run the following commands

pip install -r test-requirements.txt
nosetests

Client Class Documentation

APIMATIC CalculatorClient

The gateway for the SDK. This class acts as a factory for the Controllers and also holds the configuration of the SDK.

Controllers

Name Description
simple_calculator Provides access to SimpleCalculatorController

API Reference

List of APIs

Simple Calculator

Overview

Get instance

An instance of the SimpleCalculatorController class can be accessed from the API Client.

simple_calculator_controller = client.simple_calculator

Get Calculate

Calculates the expression using the specified operation.

ℹ️ Note This endpoint does not require authentication.

def get_calculate(self,
                 options=dict())
Parameters
Parameter Type Tags Description
operation OperationTypeEnum Template, Required The operator to apply on the variables
x float Query, Required The LHS value
y float Query, Required The RHS value
Response Type

float

Example Usage
collect = {}
operation = OperationTypeEnum.MULTIPLY
collect['operation'] = operation

x = 222.14
collect['x'] = x

y = 165.14
collect['y'] = y

result = simple_calculator_controller.get_calculate(collect)

Model Reference

Enumerations

Operation Type

Possible operators are sum, subtract, multiply, divide

Class Name

OperationTypeEnum

Fields
Name Description
SUM Represents the sum operator
SUBTRACT Represents the subtract operator
MULTIPLY Represents the multiply operator
DIVIDE Represents the divide operator

Utility Classes Documentation

ApiHelper

A utility class for processing API Calls. Also contains classes for supporting standard datetime formats.

Methods

Name Description
json_deserialize Deserializes a JSON string to a Python dictionary.

Classes

Name Description
HttpDateTime A wrapper for datetime to support HTTP date format.
UnixDateTime A wrapper for datetime to support Unix date format.
RFC3339DateTime A wrapper for datetime to support RFC3339 format.

Common Code Documentation

HttpResponse

Http response received.

Parameters

Name Type Description
status_code int The status code returned by the server.
reason_phrase str The reason phrase returned by the server.
headers dict Response headers.
text str Response body.
request HttpRequest The request that resulted in this response.

HttpRequest

Represents a single Http Request.

Parameters

Name Type Tag Description
http_method HttpMethodEnum The HTTP method of the request.
query_url str The endpoint URL for the API request.
headers dict optional Request headers.
query_parameters dict optional Query parameters to add in the URL.
parameters dict | str optional Request body, either as a serialized string or else a list of parameters to form encode.
files dict optional Files to be sent with the request.

Release files for version-test-v3 1.0.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for version-test-v3 1.0.8
File Size Uploaded
version-test-v3-1.0.8.tar.gz 15.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for version-test-v3 1.0.8
File Interpreter ABI Platform
version_test_v3-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 40.1 kB

Release files / version-test-v3-1.0.8.tar.gz

Download URL version-test-v3-1.0.8.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4ee9852b440a5690d87e334491b3147b86c533083ff615c2e4fb21caa336f8f9
BLAKE2b-256 checksum
How to use checksums
0014a44d0cb0d81595bca38fc510d3e291dd35c97e87ba8d95f33d3f69d485be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8

Release files / version_test_v3-1.0.8-py3-none-any.whl

Download URL version_test_v3-1.0.8-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6143c6302e958ebc728c631dfd0b0df9ec56ab9002e2d0c0252b3f25fd428a48
BLAKE2b-256 checksum
How to use checksums
ce7d1ddb60d4f3ba06c63e41498ad5ab456a640ec4a1fb530d4cadc8732b5321
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.3

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page