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
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 nitric-1.2.4.tar.gz.
File metadata
- Download URL: nitric-1.2.4.tar.gz
- Upload date:
- Size: 43.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b171317e0aa9ddf12e42eacfb58d94c5db90c065976cf2c636a1c2f18cf208bd
|
|
| MD5 |
da0358f564eb5988ef35700cf550314e
|
|
| BLAKE2b-256 |
ce6acf897d0d650eb778420999bfe1c7bde2950b609f7cc9a63a9441e87cd8d0
|
File details
Details for the file nitric-1.2.4-py3-none-any.whl.
File metadata
- Download URL: nitric-1.2.4-py3-none-any.whl
- Upload date:
- Size: 85.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a70480c86407211cca8ce0f9ae7290a654ffa79ea602c02b9e91e111825b31b5
|
|
| MD5 |
04b141ef2c45e9e3cf5cc5c00afe643f
|
|
| BLAKE2b-256 |
44b4dbeff33b12380e525f69d2c685bd991c350d17df60cf757c67545a3da30c
|