Observed since 20 Oct, 17:40 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
abstract-flask
A composable toolkit for standing up Flask APIs without repeating yourself.
The staged bundle provides ops.sh ACTION [--plan] and scripts/*.sh for local Python installs and PyPI/GitHub push paths. Its Python source and pyproject.toml are at this directory's root.
A composable toolkit for standing up Flask APIs without repeating yourself. Handles blueprint discovery, CORS, request parsing, endpoint introspection, and route generation — so the only code you write is the code that matters.
pip install abstract_flask
# my_api/__init__.py
from . import routes
from abstract_flask import get_Flask_app
app = get_Flask_app(routes=routes, allowed_origins=["https://yourdomain.com"])
That's it. Blueprints are discovered from any *_bp objects in your routes module, CORS is applied, and introspection endpoints are registered automatically.
app = get_Flask_app(
name="my_api", # Flask app name (default: caller's __name__)
routes=routes, # module to scan for *_bp Blueprints
bp_list=None, # or pass blueprints explicitly
url_prefix="v1", # prefix for blueprint registration + filtered /endpoints
allowed_origins=["https://example.com"],
supports_credentials=True,
)
from abstract_flask import main_flask_start
main_flask_start(app, key_head="MYAPI", env_path=".env")
# reads MYAPI_DEBUG, MYAPI_HOST, MYAPI_PORT from env
abstract_flask/
├── abstract_flask.py # App factory, CORS, audit logging, introspection
├── request_utils/
│ ├── request_utils.py # get_request_data, extract_request_data
│ ├── get_requests.py # required_keys, execute_request, get_spec_kwargs
│ └── parse_utils.py # parse_request, parse_and_spec_vars
├── network_utils/
│ └── ip_utils.py # get_host_ip, get_user_ip, get_ip_addr
├── user_utils/
│ └── user_utils.py # get_user_name (from request or fallback)
└── generator/
├── generateFlaskRoute.py # Auto-generate Flask routes from Python files
└── help_utils.py # ?help introspection for any endpoint
abstract_flask.py)| Function | Purpose |
|---|---|
get_Flask_app(...) | One-call app factory: blueprints, CORS, logging, introspection |
get_bp(name, abs_path) | Create a named Blueprint with a logger |
main_flask_start(app) | Run the app using env-driven host/port/debug |
Every app gets these endpoints for free:
GET /endpoints — all registered routesGET /<prefix>/endpoints — routes under that prefixGET /prefixes — unique top-level route segmentsrequest_utils/)from abstract_flask.request_utils import get_request_data, required_keys, parse_request
get_request_data(req) — Returns a dict from JSON body, form data, or query string (checked in that order).extract_request_data(req, res_type) — Full extraction: user, IP, headers, cookies, files, metadata. Pass res_type to narrow scope.required_keys(keys, req, defaults) — Validate that required keys are present; returns the data dict or a 400 error payload.parse_request(req) — Split a request into positional args and kwargs.get_spec_kwargs(var_types, args, **kwargs) — Type-coerced argument extraction against a schema.generator/)Auto-generate Flask endpoints from plain Python files:
from abstract_flask.generator import generate_from_files
source = generate_from_files(
directory="./my_functions",
bp_name="auto_bp",
url_prefix="generated",
)
Every public function becomes a GET/POST endpoint. Async functions are preserved. Pass ?help to any generated endpoint to get parameter introspection via offer_help.
Register routes programmatically against an existing blueprint:
from abstract_flask.generator import register_category
register_category(bp, "math", {
"add": lambda a, b: a + b,
"multiply": lambda a, b: a * b,
})
# creates /math/add, /math/multiply
network_utils/)from abstract_flask.network_utils import get_host_ip, get_user_ip
user_utils/)from abstract_flask.user_utils import get_user_name
Resolves username from the request's .user attribute, falling back to IP-based lookup via UserIPManager.
flask, flask_cors, werkzeugabstract_utilities, abstract_security, abstract_queriesMIT
putkoff — partners@abstractendeavors.com
get_Flask_app accepts a nested route dictionary directly. Callable leaves keep
its original GET/POST and { "result": ... } response convention. A route spec
leaf can describe exact Flask behavior:
from abstract_flask import get_Flask_app
routes = {"fleet": {"worker": {
"view": worker_detail,
"rule": "/fleet/workers/<worker_id>",
"methods": ["GET"],
"inputs": "path", # or "merged" for query/form/JSON plus URL variables
"response": "native", # or "result" for the original response wrapper
}}}
app = get_Flask_app(name="fleet", routes=routes, dual_prefix="/api")
A spec may use rules for several URL aliases and endpoint to name the
Flask endpoint. strict_slashes defaults to False; set it to True when
migrating an exact existing URL contract. Native responses preserve Flask
responses, status tuples, streaming responses, and ordinary dictionaries.
URL variables take precedence over submitted fields in merged input mode.
An arm entry point in arms_group may export a route dictionary as well as a
Blueprint. The factory creates and mounts its Blueprint automatically.
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
flaskEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | flask | runtime |
flask-corsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | flask-cors | runtime |
werkzeugEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | werkzeug | runtime |
abstract-essentialsEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | abstract-essentials | runtime |
abstract-apisEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | abstract-apis | runtime |
abstract-queriesEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | abstract-queries | runtime |
abstract-utilitiesEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | abstract-utilities>=0.2.2.794 | runtime |
psycopgEnvironment{
"extras": "binary",
"marker": "extra == \"users\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | psycopg[binary]; extra == "users" | runtime |
aiohttpEnvironment{
"extras": "",
"marker": "extra == \"aiohttp\"",
"requires_python": ">=3.6",
"evaluation": "NOT_EVALUATED"
} | aiohttp; extra == "aiohttp" | runtime |
bdist_wheel · 33.73 KB · Python py3
sdist · 34.62 KB · Python source
Shared repository data · GitHub
Observed since 20 Oct, 17:40 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:326df6527d1fe6a21d1e475d0ca539768983da19a03cc54471920a9a4ece91bd