Metadata-Version: 2.4
Name: toypy
Version: 0.1.2
Summary: Toy — Express-like Python backend framework with MongoDB, JWT, and WebSockets
Author: Toy
License: MIT
Project-URL: Homepage, https://pypi.org/project/toypy/
Keywords: toy,toypy,mongodb,express,jwt,websocket,backend
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: uvicorn[standard]>=0.30
Requires-Dist: starlette>=0.38
Requires-Dist: motor>=3.5
Requires-Dist: pymongo>=4.8
Requires-Dist: PyJWT>=2.8
Requires-Dist: python-dotenv>=1.0
Provides-Extra: dev
Requires-Dist: httpx>=0.27; extra == "dev"
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
Dynamic: license-file

# Toy

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

Default port: **313**.

## Install

```bash
pip install toypy
```

## Create a project

```bash
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):

```python
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 **GUIDE.md** and **MONGO.md** after `toy make`.

## Commands

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