No project description provided
Project description
api-reponses
Api Responses is a python package useful for give an structure to your Http Response.
Installing
Installing and update using pip:
$ pip install -U api_response
A simple example
from api_responses.responses import ResponseOk as Ok
from flask import Flask
import secrets
import string
app = Flask(__name__)
@app.route("/generate-password", methods=['GET'])
def generate_simple_password():
"""Endpoint generate default password long=16 chars"""
characters = string.ascii_letters + string.digits + string.punctuation
password = ""
for _ in range(16):
password += secrets.choice(characters)
return Ok.with_results(
code=0,
message="Sucessful",
result=password
)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
api_responses-0.0.1.tar.gz
(1.6 kB
view details)
File details
Details for the file api_responses-0.0.1.tar.gz
.
File metadata
- Download URL: api_responses-0.0.1.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a0dd1c867bc7d1567226ba60a4ee732b02a00505d5276436723332b8113cd2ca |
|
MD5 | 43ba71403425521113887af17103972d |
|
BLAKE2b-256 | 3717897836cb03e38fed72137c3d55e54fe67227614825a99169360d4f78e565 |