liteapi


Nameliteapi JSON
Version 0.5.3 PyPI version JSON
download
home_page
SummaryLite python API framework
upload_time2023-10-23 09:29:02
maintainer
docs_urlNone
author
requires_python>=3.6
licenseGNU General Public License v3 (GPLv3)
keywords liteapi lite api framework python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <img src="https://github.com/cpp-e/liteapi/raw/main/media/liteapi-logo.png" alt="liteapi" style="max-width: 100%">

---

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
```bash
pip install liteapi
```

## Usage
```python
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
```python
from liteapi import liteapi,BaseAPIRequest
```
* Create an app instance of liteapi
```python
app = liteapi()
```
* Note: to change the socket binding you can pass the host and port arguments to liteapi as below
```python
app = liteapi(host='0.0.0.0', port=8080)
```
* Register class for each URI (The class has to be subclass from BaseAPIRequest)
```python
@app.register('/')
class rootMethod (BaseAPIRequest):
```
* Inside your class, define your methods of get, delete, post, put
```python
def get(self):
    return {'message': 'Welcome to liteapi'}
```
* Run your instance
```python
app.run()
```

## Example
The below example shows different method use cases for liteapi:
```python
@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](https://github.com/cpp-e/liteapi/blob/main/docs/index.md) to access the documentation

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

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "liteapi",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "liteapi,lite,api,framework,python",
    "author": "",
    "author_email": "Kamal Abdel Wahab <kamal.abdelwahab@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/45/23/7c56b0e646f95ed56a81b3a55bcf0b959c10bdb787d55a132ec6727183fe/liteapi-0.5.3.tar.gz",
    "platform": null,
    "description": "<img src=\"https://github.com/cpp-e/liteapi/raw/main/media/liteapi-logo.png\" alt=\"liteapi\" style=\"max-width: 100%\">\r\n\r\n---\r\n\r\nLite Framework, Easy Coding, High Performance, No Dependencies, Tested for Production\r\n\r\n## Features\r\n* **Lite with no dependencies**\r\n    * The framework built using standard python libraries and does not need third party pre-requisites.\r\n* **Easy Code**\r\n    * The framework designed to allow different levels of skillsets to use the code and learn it fast.\r\n* **Supported**\r\n    * Our team is committed to review, test and resolve any issues related to the framework interactively. Please don\u2019t hesitate to submit your problem in github\u2019s issue section.\r\n\r\n## Requirements\r\nPython 3.6+\r\n\r\n## Installation\r\n```bash\r\npip install liteapi\r\n```\r\n\r\n## Usage\r\n```python\r\nfrom liteapi import liteapi,BaseAPIRequest\r\n\r\napp = liteapi()\r\n\r\n@app.register('/')\r\nclass rootMethod (BaseAPIRequest):\r\n    def get(self):\r\n        return {'message': 'Thank you for using liteapi'}\r\n\r\napp.run()\r\n```\r\n* Import the framework using\r\n```python\r\nfrom liteapi import liteapi,BaseAPIRequest\r\n```\r\n* Create an app instance of liteapi\r\n```python\r\napp = liteapi()\r\n```\r\n* Note: to change the socket binding you can pass the host and port arguments to liteapi as below\r\n```python\r\napp = liteapi(host='0.0.0.0', port=8080)\r\n```\r\n* Register class for each URI (The class has to be subclass from BaseAPIRequest)\r\n```python\r\n@app.register('/')\r\nclass rootMethod (BaseAPIRequest):\r\n```\r\n* Inside your class, define your methods of get, delete, post, put\r\n```python\r\ndef get(self):\r\n    return {'message': 'Welcome to liteapi'}\r\n```\r\n* Run your instance\r\n```python\r\napp.run()\r\n```\r\n\r\n## Example\r\nThe below example shows different method use cases for liteapi:\r\n```python\r\n@app.register('/{tenant:str}')\r\nclass tenantMethod (BaseAPIRequest):\r\n    def get(self, tenant):\r\n        return {'message': 'Hello', 'tenant': tenant, 'query': self.request.query_string}\r\n    def put(self, tenant):\r\n        return {'method': 'Put', 'tenant': tenant, 'json': self.request.json}\r\n    def post(self, tenant):\r\n        return {'method': 'Post', 'tenant': tenant, 'json': self.request.json}\r\n    def delete(self, tenant):\r\n        return {'method': 'Delete', 'tenant': tenant, 'json': self.request.json}\r\n```\r\n\r\n## Documentaion\r\n[Click Here](https://github.com/cpp-e/liteapi/blob/main/docs/index.md) to access the documentation\r\n\r\n## License\r\nThis project is licensed under the terms of GPL-3.0 license.\r\n",
    "bugtrack_url": null,
    "license": "GNU General Public License v3 (GPLv3)",
    "summary": "Lite python API framework",
    "version": "0.5.3",
    "project_urls": {
        "Bug Tracker": "https://github.com/cpp-e/liteapi/issues",
        "Homepage": "https://github.com/cpp-e/liteapi"
    },
    "split_keywords": [
        "liteapi",
        "lite",
        "api",
        "framework",
        "python"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7d2f7804740afa57a919ee6cdf19f61b95edf1d9368812838b181539cdd225a",
                "md5": "fd0432527e091d837b88b97e617da70d",
                "sha256": "cbfbe127870828df00296d94ed6241b4990fedac7b0dc05b3343ec9a45b18b77"
            },
            "downloads": -1,
            "filename": "liteapi-0.5.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "fd0432527e091d837b88b97e617da70d",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 47066,
            "upload_time": "2023-10-23T09:29:00",
            "upload_time_iso_8601": "2023-10-23T09:29:00.198073Z",
            "url": "https://files.pythonhosted.org/packages/a7/d2/f7804740afa57a919ee6cdf19f61b95edf1d9368812838b181539cdd225a/liteapi-0.5.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "45237c56b0e646f95ed56a81b3a55bcf0b959c10bdb787d55a132ec6727183fe",
                "md5": "95c478ce34fc41bb075123b2eb12eb57",
                "sha256": "a5ae3fd9270efa5134889861dfe287b080a9bff41987e404d5ac4df64b55d012"
            },
            "downloads": -1,
            "filename": "liteapi-0.5.3.tar.gz",
            "has_sig": false,
            "md5_digest": "95c478ce34fc41bb075123b2eb12eb57",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 43103,
            "upload_time": "2023-10-23T09:29:02",
            "upload_time_iso_8601": "2023-10-23T09:29:02.115459Z",
            "url": "https://files.pythonhosted.org/packages/45/23/7c56b0e646f95ed56a81b3a55bcf0b959c10bdb787d55a132ec6727183fe/liteapi-0.5.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-10-23 09:29:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "cpp-e",
    "github_project": "liteapi",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "liteapi"
}
        
Elapsed time: 1.76287s