n8n_py
The n8n_py SDK connects the n8n-nodes-python-function custom node with your python functions.
Examples
Hello World
Returns a hello world json response
from n8n_py import expose_function, String
from n8n_py.handler import handle
@expose_function("Hello World", "returns a friendly greeting", {
"name": String(friendly_name="Name", description="Name of person to greet", required=True, default="Alice")
})
def hello_world(name: str): dict[str, str]: # Exposed functions must return a JSON serializable dictionary
return {
"greeting": f"Hello {name}!"
}
handle() # Starts the n8n_py server and exposes the function declared above
Multi-File Projects
n8n_py can handle functions from anywhere as long as they are imported into the handler, and have the @expose_function decorator
File Structure
multi-file/
mapping.py
hello_world.py
hello_world.py
from n8n_py import expose_function, String
@expose_function("Hello World", "returns a friendly greeting", {
"name": String(friendly_name="Name", description="Name of person to greet", required=True, default="Alice")
})
def hello_world(name: str): dict[str, str]: # Exposed functions must return a JSON serializable dictionary
return {
"greeting": f"Hello {name}!"
}
mapping.py
from n8n_py.handler import handle
import hello_world as _ # Includes the exposed function.
handle() # Starts the n8n_py server and exposes all imported functions
Metadata
Release files for n8n-py 0.0.6
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 | |
|---|---|---|---|---|
| n8n_py-0.0.6.tar.gz | 2.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| n8n_py-0.0.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.3 kB
Release files / n8n_py-0.0.6.tar.gz
| Download URL | n8n_py-0.0.6.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
28169a5884404c4d9da09d01869f583e3fb63ef947373eb969cbd1cde0e84fdb
|
|
BLAKE2b-256 checksum How to use checksums |
4710a1bd01690d9e442157a53bc9d7e1c6237903f0ebf0b27d7db28c0b6c792a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.5
|
Release files / n8n_py-0.0.6-py3-none-any.whl
| Download URL | n8n_py-0.0.6-py3-none-any.whl |
|---|---|
| Size | 3.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
dc1e237203ee2083475e32b781a2ae1079a771d06908ec99a7c460df962f5ae1
|
|
BLAKE2b-256 checksum How to use checksums |
9d77b45ecc11d7beaf3b3a9b79f4a6765ae4b5fc3fb243949cd5a2c07320c1c9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.5
|
Security for n8n-py 0.0.6
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.