Skip to main content

Flask Api Resource

package flask to use conveniently like django

Usage

Step 1

from flask import Flask
from flask_api_resource import FlaskApiResource

app = Flask(__name__)
app.config['INSTALL_APPS'] = []  # your application app like user
api = FlaskApiResource()
api.init_app(app=app)  # this can auto scan your resource

Step 2

According to your logic to create different app

user
    __init__.py
    apis
        user.py
# user.py
from flask_api_resource.api import BaseResource
from flask_api_resource.decorator import get

class UserResource(BaseResource):
    
    def get_urls(self):
        return [
            ('/detail', self.detail)
        ]
    
    @get
    def detail(self):
        return self.success({'id': 1})
# __init__.py

def register(api):
    from .apis.user import UserResource
    api.register(UserResource)

Step 3

run the Flask app server and open the http://127.0.0.1:5000/rest/user/detail

Metadata

Release files for flask-api-resource 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-api-resource 0.1.2
File Size Uploaded Provenance
flask-api-resource-0.1.2.tar.gz 3.1 kB Without provenance Details

Release files / flask-api-resource-0.1.2.tar.gz

Download URL flask-api-resource-0.1.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6eeddbe47a4fffacfe16a762dfd9c3720b30c19a41adccae373b7b3a91b1a13c
BLAKE2b-256 checksum
How to use checksums
3b7ff9017ec4d966adee6d2058a60d8293595ca5f45ce5518df9712f7905e524
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

Security for flask-api-resource 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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