Skip to main content

Toy

Express-like Python backend for beginners — MongoDB, JWT, WebSockets, nested file routing.

Default port: 313.

Install

pip install toypy

Create a project

mkdir my-api
cd my-api
toy make
python main.py

Or: toy run

Beginner style

Put this one line at the top of files you edit (main.py, routes, controllers):

from toy.injected import *  # framework wiring — you can ignore this line

db = connect_mongo()

use("/api", "routes/api.py")

@get("/health")
def health(req):
    return makeResponse(200, data={"ok": True})

app.run(host=settings.HOST, port=settings.PORT, reload=settings.RELOAD)

With RELOAD = True in settings.py, saving a file restarts the server automatically. Set RELOAD = False in production.

Nest routes up to 5 layers with use("/prefix", "file.py").
Attach controllers like Node: get("/", usersController.list).

See START_HERE.md and toy help first after toy make. Full docs in docs/.

Commands

toy make          # scaffold project
toy make --force  # overwrite scaffold files
toy run           # run main.py with the loader
toy --help
toy --version

Metadata

Release files for toypy 0.1.22

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

Source distribution (sdist)

Source distribution for toypy 0.1.22
File Size Uploaded Provenance Actions
toypy-0.1.22.tar.gz 964.5 kB Without provenance Details for toypy-0.1.22.tar.gz

Built distribution (wheel)

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

Total release size: 2.1 MB

Release files / toypy-0.1.22.tar.gz

Download URL toypy-0.1.22.tar.gz
Size 964.5 kB
Tags Source
SHA-256 checksum
How to use checksums
89e08024cad184811adfa9614698c44cd7f9d58fc120a1fc06604491cf31cc24
BLAKE2b-256 checksum
How to use checksums
b18c329457bb9acfcf08ad8e722c16b922909071f9b4684e669fb5d7cfca9de6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Release files / toypy-0.1.22-py3-none-any.whl

Download URL toypy-0.1.22-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
e0b1321ed14e8373eee7fc81f1219cb512be13b08707fbc48630d6092dcc097a
BLAKE2b-256 checksum
How to use checksums
2478e25817fb0c5f103361e4ece643f8da50607c6aa84851b02b33b2f4954f5c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.6

Security for toypy 0.1.22

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.

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