Skip to main content

superfunctions

Core abstractions for the superfunctions ecosystem - database adapters and HTTP utilities

Location: packages/python-core/
Package: sfns
Import: from superfunctions.db import ... or from superfunctions.http import ...

Installation

pip install sfns

Usage

Database Adapters

from superfunctions.db import (
    Adapter,
    CreateParams,
    FindManyParams,
    WhereClause,
    Operator,
)

# Use with any adapter implementation
user = await adapter.create(
    CreateParams(
        model="users",
        data={"name": "Alice", "email": "alice@example.com"},
    )
)

# Query with filters
users = await adapter.find_many(
    FindManyParams(
        model="users",
        where=[
            WhereClause(field="email", operator=Operator.LIKE, value="%@example.com")
        ],
        limit=10,
    )
)

HTTP Abstractions

from superfunctions.http import Request, Response, RouteContext, NotFoundError

async def get_user_handler(request: Request, context: RouteContext) -> Response:
    user_id = context.params.get("id")
    
    user = await db.find_one(...)
    if not user:
        raise NotFoundError(f"User {user_id} not found")
    
    return Response(status=200, body=user)

Adapters

Install adapter packages separately based on your stack:

Database Adapters

# SQLAlchemy (coming soon)
pip install superfunctions-sqlalchemy

# Django ORM (coming soon)
pip install superfunctions-django

# Tortoise ORM (coming soon)
pip install superfunctions-tortoise

HTTP Framework Adapters

# FastAPI (coming soon)
pip install superfunctions-fastapi

# Flask (coming soon)
pip install superfunctions-flask

# Django (coming soon)
pip install superfunctions-django

Documentation

License

MIT

Metadata

Release files for sfns 0.1.0

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

Source distribution (sdist)

Source distribution for sfns 0.1.0
File Size Uploaded Provenance Actions
sfns-0.1.0.tar.gz 8.4 kB Without provenance Details for sfns-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sfns 0.1.0
File Interpreter ABI Platform Actions
sfns-0.1.0-py3-none-any.whl Python 3 none any Details for sfns-0.1.0-py3-none-any.whl

Total release size: 18.8 kB

Release files / sfns-0.1.0.tar.gz

Download URL sfns-0.1.0.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
7db3afe8de9f66de3b9ec2d965bb235483a4bc9508239b8b0695991f38796442
BLAKE2b-256 checksum
How to use checksums
79ab5991e8713738a4bae16fc1910b2579df0b44429594d1927cecb9821cd960
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / sfns-0.1.0-py3-none-any.whl

Download URL sfns-0.1.0-py3-none-any.whl
Size 10.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d57d290997d4445546c899a2afacdf0350d95bc533ad08d34957526f97ae581
BLAKE2b-256 checksum
How to use checksums
485f42f5029b5cb4793e7a4ac75f946f38eb49be6d93ccb2731b8c9e50b1bfb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for sfns 0.1.0

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.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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