# Lilliepy Protect
a decorator to protect you components
## how to use
```python
from lilliepy_protect import protect
from reactpy import component, html
@component
def fallback():
return html.h1("u werent logged in...")
@protect(fallback=fallback, attr="logged_in")
@component
def ProtectedPage():
return html.h1("welcome")
```
```python
# ...
protect -> (
comp: reactpy.types.ComponentType, # the component to be protected
fallback: reactpy.types.ComponentType, # the return url or component to navigate/render
attr: str # the value to find in the scope (basically the granter code)(defaulted to "granted")
)
# ...
```
Raw data
{
"_id": null,
"home_page": "https://github.com/websitedeb/lilliept-protect",
"name": "lilliepy-protect",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "reactpy, lilliepy, lilliepy_protect",
"author": "sarthak ghoshal",
"author_email": "sarthak22.ghoshal@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/3c/c8/638609533a0b1e72c606d85ab4ce8b34cacfa9efc6f5715b215aa12fc807/lilliepy_protect-1.0.tar.gz",
"platform": null,
"description": "# Lilliepy Protect\r\n\r\na decorator to protect you components\r\n\r\n## how to use\r\n\r\n```python\r\nfrom lilliepy_protect import protect\r\nfrom reactpy import component, html\r\n\r\n@component\r\ndef fallback():\r\n return html.h1(\"u werent logged in...\")\r\n\r\n@protect(fallback=fallback, attr=\"logged_in\")\r\n@component\r\ndef ProtectedPage():\r\n return html.h1(\"welcome\")\r\n```\r\n\r\n```python\r\n\r\n# ...\r\n\r\nprotect -> (\r\n comp: reactpy.types.ComponentType, # the component to be protected\r\n fallback: reactpy.types.ComponentType, # the return url or component to navigate/render\r\n attr: str # the value to find in the scope (basically the granter code)(defaulted to \"granted\")\r\n)\r\n\r\n# ...\r\n\r\n```\r\n",
"bugtrack_url": null,
"license": null,
"summary": "A protection decorator to protect components",
"version": "1.0",
"project_urls": {
"Homepage": "https://github.com/websitedeb/lilliept-protect"
},
"split_keywords": [
"reactpy",
" lilliepy",
" lilliepy_protect"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "f6c175e4e9b9266bda9c336268efdcfb48dbad2fc77e3ec1b1f6b3a09f8d5630",
"md5": "af2f196e6d659df3285d4b414b1524f4",
"sha256": "8dfb63640f64a34ab78e50394d0137d7be8f725438daa74f39abcef84bd6e6cc"
},
"downloads": -1,
"filename": "lilliepy_protect-1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "af2f196e6d659df3285d4b414b1524f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 2339,
"upload_time": "2025-01-10T01:23:22",
"upload_time_iso_8601": "2025-01-10T01:23:22.990988Z",
"url": "https://files.pythonhosted.org/packages/f6/c1/75e4e9b9266bda9c336268efdcfb48dbad2fc77e3ec1b1f6b3a09f8d5630/lilliepy_protect-1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3cc8638609533a0b1e72c606d85ab4ce8b34cacfa9efc6f5715b215aa12fc807",
"md5": "c54cb38c863559612800ec0787159e1d",
"sha256": "19ed2bfd996765778e3d1af4876b1681b3b7ab847c8585071ede11697f105e17"
},
"downloads": -1,
"filename": "lilliepy_protect-1.0.tar.gz",
"has_sig": false,
"md5_digest": "c54cb38c863559612800ec0787159e1d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 2048,
"upload_time": "2025-01-10T01:23:25",
"upload_time_iso_8601": "2025-01-10T01:23:25.337690Z",
"url": "https://files.pythonhosted.org/packages/3c/c8/638609533a0b1e72c606d85ab4ce8b34cacfa9efc6f5715b215aa12fc807/lilliepy_protect-1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-10 01:23:25",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "websitedeb",
"github_project": "lilliept-protect",
"github_not_found": true,
"lcname": "lilliepy-protect"
}