Skip to main content

Rest Api Client

Project description

Overall

Rest API client for Python

Simple REST API client for Python

Installation

Use the package manager pip to install our client in Python.

pip install gawsoft-api-client

OR

pip3 install gawsoft-api-client

Usage

Write your client api

from gawsoft.api_client import Request, Response


class Client(Request):
    def __init__(
        self,
        api_key: str,
        api_version: str ='',
        api_host: str = 'http://httpbin.org',
        user_agent: str = 'Example Api Python client'
     ):
        super().__init__(api_key, api_version, api_host, user_agent)

    def info(self, link: str, params: dict = {}) -> Response:
        return self.request(link, 'POST', params)


c = Client("abc")
response = c.info("delay/1")
print(response.status_code)
print(response.data())

Tests

make test
make mypy

Release

# Release in test env
make release-test

# Real release
make release

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gawsoft_api_client-0.0.2.tar.gz (6.8 kB view hashes)

Uploaded Source

Built Distribution

gawsoft_api_client-0.0.2-py3-none-any.whl (7.7 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page