n8n-py


Namen8n-py JSON
Version 0.0.6 PyPI version JSON
download
home_pageNone
SummaryPython SDK for n8n-nodes-python-function
upload_time2024-08-27 07:28:09
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # n8n_py

The n8n_py SDK connects the [n8n-nodes-python-function](https://www.npmjs.com/package/n8n-nodes-python-function) custom node with your python functions.

## Examples

### Hello World

Returns a hello world json response

```python
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_

```python
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_

```python
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
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "n8n-py",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "pyscripter99 <ryder@retzlaff.family>",
    "download_url": "https://files.pythonhosted.org/packages/47/10/a1bd01690d9e442157a53bc9d7e1c6237903f0ebf0b27d7db28c0b6c792a/n8n_py-0.0.6.tar.gz",
    "platform": null,
    "description": "# n8n_py\n\nThe n8n_py SDK connects the [n8n-nodes-python-function](https://www.npmjs.com/package/n8n-nodes-python-function) custom node with your python functions.\n\n## Examples\n\n### Hello World\n\nReturns a hello world json response\n\n```python\nfrom n8n_py import expose_function, String\nfrom n8n_py.handler import handle\n\n@expose_function(\"Hello World\", \"returns a friendly greeting\", {\n\t\"name\": String(friendly_name=\"Name\", description=\"Name of person to greet\", required=True, default=\"Alice\")\n})\ndef hello_world(name: str): dict[str, str]: # Exposed functions must return a JSON serializable dictionary\n\treturn {\n\t\t\"greeting\": f\"Hello {name}!\"\n\t}\n\nhandle() # Starts the n8n_py server and exposes the function declared above\n```\n\n### Multi-File Projects\n\nn8n_py can handle functions from anywhere as long as they are imported into the handler, and have the @expose_function decorator\n\n#### File Structure\n\n```\nmulti-file/\n\tmapping.py\n\thello_world.py\n```\n\n_hello_world.py_\n\n```python\nfrom n8n_py import expose_function, String\n\n@expose_function(\"Hello World\", \"returns a friendly greeting\", {\n\t\"name\": String(friendly_name=\"Name\", description=\"Name of person to greet\", required=True, default=\"Alice\")\n})\ndef hello_world(name: str): dict[str, str]: # Exposed functions must return a JSON serializable dictionary\n\treturn {\n\t\t\"greeting\": f\"Hello {name}!\"\n\t}\n```\n\n_mapping.py_\n\n```python\nfrom n8n_py.handler import handle\nimport hello_world as _ # Includes the exposed function.\n\nhandle() # Starts the n8n_py server and exposes all imported functions\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Python SDK for n8n-nodes-python-function",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/pyscripter99/n8n-py",
        "Issues": "http://github.com/pyscripter99/n8n-py/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9d77b45ecc11d7beaf3b3a9b79f4a6765ae4b5fc3fb243949cd5a2c07320c1c9",
                "md5": "5229b6a5b05a5231c6e48d452fdbac2c",
                "sha256": "dc1e237203ee2083475e32b781a2ae1079a771d06908ec99a7c460df962f5ae1"
            },
            "downloads": -1,
            "filename": "n8n_py-0.0.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5229b6a5b05a5231c6e48d452fdbac2c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 3342,
            "upload_time": "2024-08-27T07:28:08",
            "upload_time_iso_8601": "2024-08-27T07:28:08.373365Z",
            "url": "https://files.pythonhosted.org/packages/9d/77/b45ecc11d7beaf3b3a9b79f4a6765ae4b5fc3fb243949cd5a2c07320c1c9/n8n_py-0.0.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4710a1bd01690d9e442157a53bc9d7e1c6237903f0ebf0b27d7db28c0b6c792a",
                "md5": "11822024984e758adaba970e6fec5b18",
                "sha256": "28169a5884404c4d9da09d01869f583e3fb63ef947373eb969cbd1cde0e84fdb"
            },
            "downloads": -1,
            "filename": "n8n_py-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "11822024984e758adaba970e6fec5b18",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 2949,
            "upload_time": "2024-08-27T07:28:09",
            "upload_time_iso_8601": "2024-08-27T07:28:09.429974Z",
            "url": "https://files.pythonhosted.org/packages/47/10/a1bd01690d9e442157a53bc9d7e1c6237903f0ebf0b27d7db28c0b6c792a/n8n_py-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-27 07:28:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "pyscripter99",
    "github_project": "n8n-py",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "n8n-py"
}
        
Elapsed time: 1.08058s