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
Metadata
Release files for nitric 1.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| nitric-1.2.4.tar.gz | 43.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nitric-1.2.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 128.0 kB
Release files / nitric-1.2.4.tar.gz
| Download URL | nitric-1.2.4.tar.gz |
|---|---|
| Size | 43.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b171317e0aa9ddf12e42eacfb58d94c5db90c065976cf2c636a1c2f18cf208bd
|
|
BLAKE2b-256 checksum How to use checksums |
ce6acf897d0d650eb778420999bfe1c7bde2950b609f7cc9a63a9441e87cd8d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.20
|
Release files / nitric-1.2.4-py3-none-any.whl
| Download URL | nitric-1.2.4-py3-none-any.whl |
|---|---|
| Size | 85.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a70480c86407211cca8ce0f9ae7290a654ffa79ea602c02b9e91e111825b31b5
|
|
BLAKE2b-256 checksum How to use checksums |
44b4dbeff33b12380e525f69d2c685bd991c350d17df60cf757c67545a3da30c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.9.20
|
Security for nitric 1.2.4
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.