perseus-restful-api-framework


Nameperseus-restful-api-framework JSON
Version 1.28.4 PyPI version JSON
download
home_pagehttps://github.com/majormode/perseus-restful-api-server-framework
SummaryPython server framework for quickly building RESTful APIs with minimal effort
upload_time2024-03-03 10:44:06
maintainer
docs_urlNone
authorDaniel CAUNE
requires_python>=3.9,<4.0
licenseProprietary
keywords perseus resful api server framework
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Perseus: RESTful API Server Framework

Perseus is a Python framework for quickly building RESTful API servers with minimal effort.

Perseus provides an initial set of core services that supports the following features:

- Client application registration with API keys generation
- Client application access control with RESTful request signature
- Client application and RESTful API server version compatibility check
- User authentication and session management
- Team/group management
- RESTful request logging with data sensitiveness support
- RESTful service automatic discovery
- HTTP request query parameters & body JSON message automatically parsing (depending on the HTTP method used) with data type check and conversion

Perseus is based on [Tornado](https://www.tornadoweb.org/) for handling client network connection.

## RESTful API Request Handler

```python
from majormode.perseus.service.base_http_handler import HttpRequest
from majormode.perseus.service.base_http_handler import HttpRequestHandler
from majormode.perseus.service.base_http_handler import http_request

import AttendantService


class AttendantServiceHttpRequestHandler(HttpRequestHandler):
    @http_request(r'^/attendant/session$',
                  http_method=HttpRequest.HttpMethod.POST,
                  authentication_required=False,
                  sensitive_data=True,
                  signature_required=False)
    def sign_in(self, request):
        email_address = request.get_argument(
            'email_address',
            data_type=HttpRequest.ArgumentDataType.email_address,
            is_required=True)

        password = request.get_argument(
            'password',
            data_type=HttpRequest.ArgumentDataType.string,
            is_required=True)

        return AttendantService().sign_in(request.app_id, email_address, password)
```

## Configure the environment variables

```env
# Copyright (C) 2021 Majormode.  All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

# Connection properties of the RESTful API server instances.  Defaults
# to 127.0.0.1:8081.
API_SERVER_HOSTNAME=127.0.0.1
API_SERVER_PORTS=

# Root path of the Network File System (NFS) -- referring to the
# distributed file system (not the protocol) -- where the Content
# Delivery Network (CDN) files are stored into, such as avatars, etc.
CDN_NFS_ROOT_PATH=

# Hostname of the Content Delivery Network (CDN) server that hosts media
# files such as avatars, etc.
CDN_URL_HOSTNAME=

# Environment stage of the API server instances.  Possible values are:
#
# - dev
# - int
# - staging
# - prod
#
# Defaults to `dev`.
ENVIRONMENT_STAGE=

# Connection properties to a Memcached server (a distributed memory
# object caching system).  Defaults to 127.0.0.1:11211.
MEMCACHED_HOSTNAME = '127.0.0.1'
MEMCACHED_PORT = 11211

# Threshold for the logger to level.  Logging messages which are less
# severe than the specified level will be ignored; logging messages
# which have this severity level or higher will be emitted.  Possible
# values are:
#
# - debug
# - info
# - warning
# - error
# - critical
#
# Default to 'debug'.
LOGGING_LEVEL=

# Environment variables to select default parameter values to connect
# to PostgreSQL Relational Database Management System.
PG_HOSTNAME=localhost
PG_PORT=5432
PG_DATABASE_NAME=
PG_USERNAME=
PG_PASSWORD=
```

## Run the RESTful API Server Processes

```bash
$ fab start --port=65180,65181,...
```

Hashtags/Topics: `#perseus` `#restful` `#api` `#server` `#framework` `#python`

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/majormode/perseus-restful-api-server-framework",
    "name": "perseus-restful-api-framework",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9,<4.0",
    "maintainer_email": "",
    "keywords": "perseus,resful,api,server,framework",
    "author": "Daniel CAUNE",
    "author_email": "daniel.caune@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/1a/f1/7e9aa8fa4280e6c29a5c78e09ae1a712eb75502653a78a0c39d06becab1f/perseus_restful_api_framework-1.28.4.tar.gz",
    "platform": null,
    "description": "# Perseus: RESTful API Server Framework\n\nPerseus is a Python framework for quickly building RESTful API servers with minimal effort.\n\nPerseus provides an initial set of core services that supports the following features:\n\n- Client application registration with API keys generation\n- Client application access control with RESTful request signature\n- Client application and RESTful API server version compatibility check\n- User authentication and session management\n- Team/group management\n- RESTful request logging with data sensitiveness support\n- RESTful service automatic discovery\n- HTTP request query parameters & body JSON message automatically parsing (depending on the HTTP method used) with data type check and conversion\n\nPerseus is based on [Tornado](https://www.tornadoweb.org/) for handling client network connection.\n\n## RESTful API Request Handler\n\n```python\nfrom majormode.perseus.service.base_http_handler import HttpRequest\nfrom majormode.perseus.service.base_http_handler import HttpRequestHandler\nfrom majormode.perseus.service.base_http_handler import http_request\n\nimport AttendantService\n\n\nclass AttendantServiceHttpRequestHandler(HttpRequestHandler):\n    @http_request(r'^/attendant/session$',\n                  http_method=HttpRequest.HttpMethod.POST,\n                  authentication_required=False,\n                  sensitive_data=True,\n                  signature_required=False)\n    def sign_in(self, request):\n        email_address = request.get_argument(\n            'email_address',\n            data_type=HttpRequest.ArgumentDataType.email_address,\n            is_required=True)\n\n        password = request.get_argument(\n            'password',\n            data_type=HttpRequest.ArgumentDataType.string,\n            is_required=True)\n\n        return AttendantService().sign_in(request.app_id, email_address, password)\n```\n\n## Configure the environment variables\n\n```env\n# Copyright (C) 2021 Majormode.  All rights reserved.\n#\n# Permission is hereby granted, free of charge, to any person obtaining\n# a copy of this software and associated documentation files (the\n# \"Software\"), to deal in the Software without restriction, including\n# without limitation the rights to use, copy, modify, merge, publish,\n# distribute, sublicense, and/or sell copies of the Software, and to\n# permit persons to whom the Software is furnished to do so, subject to\n# the following conditions:\n#\n# The above copyright notice and this permission notice shall be\n# included in all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\n# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\n# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\n# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\n# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n# Connection properties of the RESTful API server instances.  Defaults\n# to 127.0.0.1:8081.\nAPI_SERVER_HOSTNAME=127.0.0.1\nAPI_SERVER_PORTS=\n\n# Root path of the Network File System (NFS) -- referring to the\n# distributed file system (not the protocol) -- where the Content\n# Delivery Network (CDN) files are stored into, such as avatars, etc.\nCDN_NFS_ROOT_PATH=\n\n# Hostname of the Content Delivery Network (CDN) server that hosts media\n# files such as avatars, etc.\nCDN_URL_HOSTNAME=\n\n# Environment stage of the API server instances.  Possible values are:\n#\n# - dev\n# - int\n# - staging\n# - prod\n#\n# Defaults to `dev`.\nENVIRONMENT_STAGE=\n\n# Connection properties to a Memcached server (a distributed memory\n# object caching system).  Defaults to 127.0.0.1:11211.\nMEMCACHED_HOSTNAME = '127.0.0.1'\nMEMCACHED_PORT = 11211\n\n# Threshold for the logger to level.  Logging messages which are less\n# severe than the specified level will be ignored; logging messages\n# which have this severity level or higher will be emitted.  Possible\n# values are:\n#\n# - debug\n# - info\n# - warning\n# - error\n# - critical\n#\n# Default to 'debug'.\nLOGGING_LEVEL=\n\n# Environment variables to select default parameter values to connect\n# to PostgreSQL Relational Database Management System.\nPG_HOSTNAME=localhost\nPG_PORT=5432\nPG_DATABASE_NAME=\nPG_USERNAME=\nPG_PASSWORD=\n```\n\n## Run the RESTful API Server Processes\n\n```bash\n$ fab start --port=65180,65181,...\n```\n\nHashtags/Topics: `#perseus` `#restful` `#api` `#server` `#framework` `#python`\n",
    "bugtrack_url": null,
    "license": "Proprietary",
    "summary": "Python server framework for quickly building RESTful APIs with minimal effort",
    "version": "1.28.4",
    "project_urls": {
        "Homepage": "https://github.com/majormode/perseus-restful-api-server-framework",
        "Repository": "https://github.com/majormode/perseus-restful-api-server-framework"
    },
    "split_keywords": [
        "perseus",
        "resful",
        "api",
        "server",
        "framework"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7cb73c30db36bde877ab97df3a8dabf5750204c88c50e4a7ac75db7b33c16929",
                "md5": "313b179f9eb7480916d054022b197bf5",
                "sha256": "b85a4491f35e8c94669cc93c905abcc202636eb1a5ac89f47d29a7c6a7419549"
            },
            "downloads": -1,
            "filename": "perseus_restful_api_framework-1.28.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "313b179f9eb7480916d054022b197bf5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9,<4.0",
            "size": 5768668,
            "upload_time": "2024-03-03T10:44:01",
            "upload_time_iso_8601": "2024-03-03T10:44:01.521296Z",
            "url": "https://files.pythonhosted.org/packages/7c/b7/3c30db36bde877ab97df3a8dabf5750204c88c50e4a7ac75db7b33c16929/perseus_restful_api_framework-1.28.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1af17e9aa8fa4280e6c29a5c78e09ae1a712eb75502653a78a0c39d06becab1f",
                "md5": "5bd7a8bce2d5cf2d6721e3949e7b88f8",
                "sha256": "842f617c549dd94782007631ebd93adc4aea76fdaee69b8ffc87f82add7e8b4a"
            },
            "downloads": -1,
            "filename": "perseus_restful_api_framework-1.28.4.tar.gz",
            "has_sig": false,
            "md5_digest": "5bd7a8bce2d5cf2d6721e3949e7b88f8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9,<4.0",
            "size": 5693620,
            "upload_time": "2024-03-03T10:44:06",
            "upload_time_iso_8601": "2024-03-03T10:44:06.498430Z",
            "url": "https://files.pythonhosted.org/packages/1a/f1/7e9aa8fa4280e6c29a5c78e09ae1a712eb75502653a78a0c39d06becab1f/perseus_restful_api_framework-1.28.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-03 10:44:06",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "majormode",
    "github_project": "perseus-restful-api-server-framework",
    "github_not_found": true,
    "lcname": "perseus-restful-api-framework"
}
        
Elapsed time: 0.20343s