# Lilliepy Server Component
this function is able to run code far from the client into a private server (the server self-destructs after the function has been ran and returns value)
## _server
_server is the function, it takes 3 args:
* name
* func
* args
### name
name takes in "__name__", just slap that in there and you are good to go
### func
func is the function you want to execute away from the client, you dont put args in the function here
### args
args takes in parameters that are needed for the function in ```func``` to run, this is an optional parameter
# Example
```python
from lilliepy_server_component import _server
def expensive_fibonacci(n):
if n <= 1:
return n
return expensive_fibonacci(n - 1) + expensive_fibonacci(n - 2)
def no_arg_function():
return "This function takes no arguments."
result_1 = _server(__name__, no_arg_function)
result_2 = _server(__name__, no_arg_function)
print(result_1, result_2)
```
Raw data
{
"_id": null,
"home_page": "https://github.com/websitedeb/lilliepy_server",
"name": "lilliepy-server-component",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "lilliepy server components, lilliepy, reactpy",
"author": "sarthak ghoshal",
"author_email": "sarthak22.ghoshal@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/87/7f/b7d6112cf42aeaa58102cc8f62d1f210bfa461676e7558d2e8d6ce1461da/lilliepy_server_component-1.0.0.tar.gz",
"platform": null,
"description": "# Lilliepy Server Component\r\n\r\nthis function is able to run code far from the client into a private server (the server self-destructs after the function has been ran and returns value)\r\n\r\n## _server\r\n\r\n_server is the function, it takes 3 args:\r\n* name\r\n* func\r\n* args\r\n\r\n### name\r\nname takes in \"__name__\", just slap that in there and you are good to go\r\n\r\n### func\r\nfunc is the function you want to execute away from the client, you dont put args in the function here\r\n\r\n### args\r\nargs takes in parameters that are needed for the function in ```func``` to run, this is an optional parameter\r\n\r\n# Example\r\n```python\r\nfrom lilliepy_server_component import _server\r\n\r\ndef expensive_fibonacci(n):\r\n if n <= 1:\r\n return n\r\n return expensive_fibonacci(n - 1) + expensive_fibonacci(n - 2)\r\n\r\ndef no_arg_function():\r\n return \"This function takes no arguments.\"\r\n\r\nresult_1 = _server(__name__, no_arg_function)\r\nresult_2 = _server(__name__, no_arg_function)\r\nprint(result_1, result_2)\r\n```\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "a function to run code on a server, away from the client",
"version": "1.0.0",
"project_urls": {
"Homepage": "https://github.com/websitedeb/lilliepy_server"
},
"split_keywords": [
"lilliepy server components",
" lilliepy",
" reactpy"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3a9dc038cce3305ed27e6f12d800b3a9c93769ffc9fbd4517e4328d809cac9cc",
"md5": "76dd1b955cd08cfd83b9f7bf3b55d71f",
"sha256": "72c76d924b61ab880bf1069e072f8bbf8a27a2d32c767c1ec6786f63606cc296"
},
"downloads": -1,
"filename": "lilliepy_server_component-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "76dd1b955cd08cfd83b9f7bf3b55d71f",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 2877,
"upload_time": "2024-12-28T00:31:08",
"upload_time_iso_8601": "2024-12-28T00:31:08.534334Z",
"url": "https://files.pythonhosted.org/packages/3a/9d/c038cce3305ed27e6f12d800b3a9c93769ffc9fbd4517e4328d809cac9cc/lilliepy_server_component-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "877fb7d6112cf42aeaa58102cc8f62d1f210bfa461676e7558d2e8d6ce1461da",
"md5": "01037c05687dae97f6b5091e66ceb2ee",
"sha256": "86a331a666cca594b699d43bb3f0a4dd0baaea4ff747aad5da4b81fd5b1d90a0"
},
"downloads": -1,
"filename": "lilliepy_server_component-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "01037c05687dae97f6b5091e66ceb2ee",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 2532,
"upload_time": "2024-12-28T00:33:03",
"upload_time_iso_8601": "2024-12-28T00:33:03.990648Z",
"url": "https://files.pythonhosted.org/packages/87/7f/b7d6112cf42aeaa58102cc8f62d1f210bfa461676e7558d2e8d6ce1461da/lilliepy_server_component-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-28 00:33:03",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "websitedeb",
"github_project": "lilliepy_server",
"github_not_found": true,
"lcname": "lilliepy-server-component"
}