BoneShield
Express-like Python backend framework with MongoDB (local + Atlas), JWT, and WebSockets.
Default port: 313.
Install
pip install boneshield
Create a project
mkdir my-api
cd my-api
boneshield make
python main.py
Quick example
from boneshield import App, connect_mongo, makeResponse, jwt, sockets
app = App()
db = connect_mongo()
io = sockets(app)
@app.get("/health")
async def health(req):
return makeResponse(200, data={"ok": True})
@app.post("/login")
async def login(req):
body = await req.json()
token = jwt.sign({"email": body.get("email")})
return makeResponse(200, data={"token": token})
@io.on("ping")
async def on_ping(socket, data):
await socket.emit("pong", data)
app.run() # port 313
Docs
After boneshield make, open GUIDE.md for the full API reference.
Commands
boneshield make # scaffold project in current directory
boneshield make --force # overwrite existing scaffold files
boneshield --help
boneshield --version
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
boneshield-0.1.0.tar.gz
(20.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file boneshield-0.1.0.tar.gz.
File metadata
- Download URL: boneshield-0.1.0.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d899fc6f75ec277ff0c08f159f641ae05a62deee06d4474706d9157509378aae
|
|
| MD5 |
d0a342cc783bed02edd534e8c3925eeb
|
|
| BLAKE2b-256 |
4bb7cab8ba45170dec91222871ff31e26b2866921e8ecc00208972b7981b13a8
|
File details
Details for the file boneshield-0.1.0-py3-none-any.whl.
File metadata
- Download URL: boneshield-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f5f2352aab3993349d4222339bf66a127cb9494bfb89e2be3e405595f02f741
|
|
| MD5 |
6510044c5ceeaa6276e049c9a5670459
|
|
| BLAKE2b-256 |
4bce671add040a796d1c09c300a025a040b8d0dd873a3428323ab7aff816ab65
|