Skip to main content
liteapi

Lite Framework, Easy Coding, High Performance, No Dependencies, Tested for Production

Features

  • Lite with no dependencies
    • The framework built using standard python libraries and does not need third party pre-requisites.
  • Easy Code
    • The framework designed to allow different levels of skillsets to use the code and learn it fast.
  • Supported
    • Our team is committed to review, test and resolve any issues related to the framework interactively. Please don’t hesitate to submit your problem in github’s issue section.

Requirements

Python 3.6+

Installation

pip install liteapi

Usage

from liteapi import liteapi,BaseAPIRequest

app = liteapi()

@app.register('/')
class rootMethod (BaseAPIRequest):
    def get(self):
        return {'message': 'Thank you for using liteapi'}

app.run()
  • Import the framework using
from liteapi import liteapi,BaseAPIRequest
  • Create an app instance of liteapi
app = liteapi()
  • Note: to change the socket binding you can pass the host and port arguments to liteapi as below
app = liteapi(host='0.0.0.0', port=8080)
  • Register class for each URI (The class has to be subclass from BaseAPIRequest)
@app.register('/')
class rootMethod (BaseAPIRequest):
  • Inside your class, define your methods of get, delete, post, put
def get(self):
    return {'message': 'Welcome to liteapi'}
  • Run your instance
app.run()

Example

The below example shows different method use cases for liteapi:

@app.register('/{tenant:str}')
class tenantMethod (BaseAPIRequest):
    def get(self, tenant):
        return {'message': 'Hello', 'tenant': tenant, 'query': self.request.query_string}
    def put(self, tenant):
        return {'method': 'Put', 'tenant': tenant, 'json': self.request.json}
    def post(self, tenant):
        return {'method': 'Post', 'tenant': tenant, 'json': self.request.json}
    def delete(self, tenant):
        return {'method': 'Delete', 'tenant': tenant, 'json': self.request.json}

Documentaion

Click Here to access the documentation

License

This project is licensed under the terms of GPL-3.0 license.

Download files

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

Source Distribution

liteapi-0.5.2.tar.gz (42.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

liteapi-0.5.2-py3-none-any.whl (46.8 kB view details)

Uploaded Python 3

File details

Details for the file liteapi-0.5.2.tar.gz.

File metadata

  • Download URL: liteapi-0.5.2.tar.gz
  • Upload date:
  • Size: 42.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.8

File hashes

Hashes for liteapi-0.5.2.tar.gz
Algorithm Hash digest
SHA256 e653c2a2291d87b664937088804043287d146d8e1e06ce775a382d7b985481b2
MD5 fae107f18d6127cd68a081de1633d9b9
BLAKE2b-256 03816ae7245feee7f46763d622cd235b1695605536a4297ba6edde85b9e536f8

See more details on using hashes here.

File details

Details for the file liteapi-0.5.2-py3-none-any.whl.

File metadata

  • Download URL: liteapi-0.5.2-py3-none-any.whl
  • Upload date:
  • Size: 46.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.7.8

File hashes

Hashes for liteapi-0.5.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bbb1ee4306b9f3d1d831d15e000ea7f3918aee5725dd9534b94eb7843b13ce18
MD5 de8ad054f430a3d9b2cc97d011895796
BLAKE2b-256 6da6a2ca8959d87854c4860970619ed057c6d80a05f6671112441738c41e7b24

See more details on using hashes here.

Release history Release notifications | RSS feed

0.5.3

2 files

This release

0.5.2 This release

2 files

0.5.1

2 files

0.5.0

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.1

2 files

0.2

2 files

0.1

2 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