{"id":14959600,"url":"https://github.com/andfanilo/streamlit-lottie","last_synced_at":"2025-04-05T07:05:09.466Z","repository":{"id":38890820,"uuid":"313140058","full_name":"andfanilo/streamlit-lottie","owner":"andfanilo","description":"Streamlit component to render Lottie animations","archived":false,"fork":false,"pushed_at":"2023-06-05T13:53:10.000Z","size":935,"stargazers_count":169,"open_issues_count":6,"forks_count":19,"subscribers_count":7,"default_branch":"main","last_synced_at":"2024-10-29T23:44:25.301Z","etag":null,"topics":["lottie","python","react","streamlit"],"latest_commit_sha":null,"homepage":"https://lottie.streamlit.app/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andfanilo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-15T22:58:44.000Z","updated_at":"2024-10-12T09:14:08.000Z","dependencies_parsed_at":"2024-06-18T20:06:49.258Z","dependency_job_id":"2382eec3-6aca-4829-ab7d-3e670cbe1702","html_url":"https://github.com/andfanilo/streamlit-lottie","commit_stats":{"total_commits":24,"total_committers":3,"mean_commits":8.0,"dds":0.375,"last_synced_commit":"3953cfc839436e84c309fc4794381962582288f4"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andfanilo%2Fstreamlit-lottie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andfanilo%2Fstreamlit-lottie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andfanilo%2Fstreamlit-lottie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andfanilo%2Fstreamlit-lottie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andfanilo","download_url":"https://codeload.github.com/andfanilo/streamlit-lottie/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247299831,"owners_count":20916190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lottie","python","react","streamlit"],"created_at":"2024-09-24T13:20:12.084Z","updated_at":"2025-04-05T07:05:09.444Z","avatar_url":"https://github.com/andfanilo.png","language":"Python","funding_links":["https://www.buymeacoffee.com/andfanilo"],"categories":[],"sub_categories":[],"readme":"# Streamlit Lottie\n\n[![Streamlit App](https://static.streamlit.io/badges/streamlit_badge_black_white.svg)](https://share.streamlit.io/andfanilo/streamlit-lottie-demo/master/app.py)\n\nIntegrate [Lottie](https://lottiefiles.com/) animations inside your Streamlit app!\n\n![](./img/demo.gif)\n\n## Install\n\n```\npip install streamlit-lottie\n```\n\n## Usage\n* Basic usage\n```python\nimport streamlit as st\nfrom streamlit_lottie import st_lottie\n\nwith st.echo():\n    st_lottie(\"https://assets5.lottiefiles.com/packages/lf20_V9t630.json\")\n\n```\n\n* Basic usage (with monkey patched `st.lottie` function)\n```python\nimport streamlit as st\nimport streamlit_lottie\n\nwith st.echo():\n    st.lottie(\"https://assets5.lottiefiles.com/packages/lf20_V9t630.json\")\n\n```\n\n* Context manager usage, using `with` notation\n```python\nimport time\n\nimport streamlit as st\nfrom streamlit_lottie import st_lottie\n\nwith st_lottie(\"https://assets5.lottiefiles.com/packages/lf20_V9t630.json\"):\n    time.sleep(5)\n\n```\n\n* Download lottie manually example\n```python\nimport time\nimport requests\n\nimport streamlit as st\nfrom streamlit_lottie import st_lottie\nfrom streamlit_lottie import st_lottie_spinner\n\n\ndef load_lottieurl(url: str):\n    r = requests.get(url)\n    if r.status_code != 200:\n        return None\n    return r.json()\n\n\nlottie_url_hello = \"https://assets5.lottiefiles.com/packages/lf20_V9t630.json\"\nlottie_url_download = \"https://assets4.lottiefiles.com/private_files/lf30_t26law.json\"\nlottie_hello = load_lottieurl(lottie_url_hello)\nlottie_download = load_lottieurl(lottie_url_download)\n\n\nst_lottie(lottie_hello, key=\"hello\")\n\nif st.button(\"Download\"):\n    with st_lottie_spinner(lottie_download, key=\"download\"):\n        time.sleep(5)\n    st.balloons()\n\n```\n\n## Development\n\n### Install\n\n- JS side\n\n```shell script\ncd frontend\nnpm install\n```\n\n- Python side\n\n```shell script\nconda create -n streamlit-lottie python=3.7\nconda activate streamlit-lottie\npip install -e .\n```\n\n### Run\n\nBoth webpack dev server and Streamlit need to run for development mode.\n\n- JS side\n\n```shell script\ncd frontend\nnpm run start\n```\n\n- Python side\n\n```shell script\nstreamlit run app.py\n```\n\n## References\n\n- [Lottie-web (Official)](https://github.com/airbnb/lottie-web)\n- [react-lottie (chenqingspring)](https://github.com/chenqingspring/react-lottie)\n- [lottie-react-web (felippenardi)](https://github.com/felippenardi/lottie-react-web)\n- [lottie-react (gamote)](https://github.com/gamote/lottie-react)\n- [lottie-react (LottieFiles)](https://github.com/LottieFiles/lottie-react)\n- [react-lottie-player (mifi)](https://github.com/mifi/react-lottie-player)\n- [lottie-interactivity](https://github.com/LottieFiles/lottie-interactivity)\n\n# Support me\n\n\u003ca href=\"https://www.buymeacoffee.com/andfanilo\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/default-orange.png\" alt=\"Buy Me A Coffee\" height=\"41\" width=\"174\"\u003e\u003c/a\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandfanilo%2Fstreamlit-lottie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandfanilo%2Fstreamlit-lottie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandfanilo%2Fstreamlit-lottie/lists"}