Skip to main content

A lightweight wrapper around Flask with built-in Cloudflare tunneling and colored logging.

Project description

Flask Mini API

A powerful, lightweight wrapper around Flask designed for rapid development. It completely eliminates boilerplate code and comes with built-in colored logging, simplified routing, security decorators, and instant Cloudflare tunneling.

Features

  • 🚀 Instant Webhook/API: Minimal setup required.
  • 🌍 Built-in Cloudflare Tunnel: Expose your local server to the internet instantly using cloudflare=True.
  • 🎨 Beautiful Colored Logging: Replaces default ugly Werkzeug logs with clean, timed, and colored terminal outputs.
  • 🛡️ Decorators out-of-the-box: Easy @rate_limit, @cache, @require_key, and @require_json_fields.
  • 🗄️ Memory Store: A built-in key-value memory store for fast prototyping without setting up a database.

Installation

pip install flask-mini-api

Quick Start Example

from flask_mini_api.flask_api import app, routes, run_app, require_key, rate_limit

1. Simple API Route (Automatically returns JSON)

routes.api_route("ping", lambda: {"status": "ok", "message": "Pong!"})

2. Advanced Route with rate limiting and API Key protection

@require_key("my-secret-key-123") @rate_limit(max_requests=5, per_seconds=60) def get_secure_data(): return {"data": "This is highly classified"}

routes.api_route("secure", get_secure_data)

3. Start the server (Starts locally and opens a public Cloudflare URL!)

if name == "main": run_app(p=5000, cloudflare=True) Advanced Features Route Groups Need to prefix your routes like /api/v1/? Use route_group:

from flask_mini_api.flask_api import route_group

api_v1 = route_group("/api/v1") api_v1.api_route("users", lambda: {"users": ["Alice", "Bob"]}) In-Memory Database For fast prototyping, you don't need Redis. Use the built-in store:

from flask_mini_api.flask_api import store

store.set("server_status", "maintenance") print(store.get("server_status")) Maintenance Mode Easily lock down your API with one function (returns 503 for all endpoints except /health):

from flask_mini_api.flask_api import maintenance_mode

maintenance_mode(True) License This project is open-source and available under the MIT License.

Project details


Download files

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

Source Distribution

flask_mini_api-0.1.1.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

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

flask_mini_api-0.1.1-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

Details for the file flask_mini_api-0.1.1.tar.gz.

File metadata

  • Download URL: flask_mini_api-0.1.1.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for flask_mini_api-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5d72aa7c9b466dabe5e92baea39250a10eb62f533fc24fd84b9d3ba79793c275
MD5 c5657d1232985bbc9bd2373e9cc98904
BLAKE2b-256 837246964afa1576939076cef0935407f80845408522184acda56c0b3627902d

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_mini_api-0.1.1.tar.gz:

Publisher: publish.yml on grulgalus/flask_mini_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flask_mini_api-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: flask_mini_api-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for flask_mini_api-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a6f857eaa277bd09325d7ead0b6f7faa992b8b19f23b59fc3b8c7920e30f19a
MD5 7c9f6623745003152059003f9b13e662
BLAKE2b-256 0c2e6101fc8702f3327c885921af354452434fa726730c5ad177f022d3bbbd7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for flask_mini_api-0.1.1-py3-none-any.whl:

Publisher: publish.yml on grulgalus/flask_mini_api

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page