The Nitric SDK for Python 3
Project description
Build nitric applications with Python
The Python SDK supports the use of the Nitric framework with Python 3.11+. For more information check out the main Nitric repo.
Python SDKs provide an infrastructure-from-code style that lets you define resources in code. You can also write the functions that support the logic behind APIs, subscribers and schedules.
You can request the type of access you need to resources such as publishing for topics, without dealing directly with IAM or policy documents.
- Reference Documentation: https://nitric.io/docs/reference/python
- Guides: https://nitric.io/docs/guides/python
Usage
Starting a new project
Install the Nitric CLI, then generate your project:
nitric new hello-world py-starter
Add to an existing project
First of all, you need to install the library:
pip
pip3 install nitric
pipenv
pipenv install nitric
Then you're able to import the library and create cloud resources:
from nitric.resources import api, bucket
from nitric.application import Nitric
from nitric.context import HttpContext
publicApi = api("public")
uploads = bucket("uploads").allow("write")
@publicApi.get("/upload")
async def upload(ctx: HttpContext):
photo = uploads.file("images/photo.jpg")
url = await photo.upload_url()
ctx.res.body = {"url": url}
Nitric.run()
Learn more
Learn more by checking out the Nitric documentation.
Get in touch:
-
Join us on Discord
-
Ask questions in GitHub discussions
-
Find us on Twitter
-
Send us an email
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file nitric-1.2.3.tar.gz
.
File metadata
- Download URL: nitric-1.2.3.tar.gz
- Upload date:
- Size: 42.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fea874ac0874528abe5e9e849b7a5f05525207347ece38eb26410b681f7f22aa |
|
MD5 | 21c554b77c06ffce82cf5807ec0c091b |
|
BLAKE2b-256 | a42a190892e146b3abd95aafbdbbd8e20f66df314f7c811ab3303cc3f318fb29 |
File details
Details for the file nitric-1.2.3-py3-none-any.whl
.
File metadata
- Download URL: nitric-1.2.3-py3-none-any.whl
- Upload date:
- Size: 84.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.9.20
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e8f3bb54ae9b2f7c98b7c8c436560752f12c4411e59218907b58e70da42490c |
|
MD5 | f2de0343d562286bbf91519bdd27f58a |
|
BLAKE2b-256 | f8bd587bfcd56dc553caa6e64fdd28fcbf450c4f4844c89212c02deb4a663c8d |