Skip to main content

make wrapper for RESTful API

Project description



lint PyPI version

Easy development of RESTful API wrapper


  • Get response as dataclass object you defined
  • Return type can be specified by type annotation of api function
  • All parameters (query, path variable, or json data) can be specified at once


pip install apywrapper


from apywrapper import Apy, delete, get, patch, post, put
from typing import List, no_type_check
from dataclasses import dataclass

class User:
    name: str
    id: str

class ApiClient(Apy):
    def __init__(self, token, host="":
        super().__init__(host, headers={"api-token": token})

    def get_users(self) -> List[User]:
        return {}

    def get_user(self, user_id) -> User:
        return {"user_id": user_id}

api = ApiClient(token="xxxxxxxxxxxxxxxxxx")
sh1ma = api.get_user("sh1ma") # return User object

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

apywrapper-0.1.12.tar.gz (16.5 kB view hashes)

Uploaded Source

Built Distribution

apywrapper-0.1.12-py3-none-any.whl (17.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