{"id":16393843,"url":"https://github.com/avrabyt/fastdeck","last_synced_at":"2025-02-23T02:21:53.737Z","repository":{"id":248604254,"uuid":"829166451","full_name":"avrabyt/fastdeck","owner":"avrabyt","description":"Create and manage slide decks in pure Python. ","archived":false,"fork":false,"pushed_at":"2024-07-16T23:26:00.000Z","size":1652,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-04T04:16:03.769Z","etag":null,"topics":["presentation-slides","presentation-tools","slides","slideshow"],"latest_commit_sha":null,"homepage":"https://avrabyt.github.io/fastdeck/","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/avrabyt.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":"2024-07-15T22:30:48.000Z","updated_at":"2024-09-10T02:51:45.000Z","dependencies_parsed_at":"2024-07-17T03:10:23.490Z","dependency_job_id":null,"html_url":"https://github.com/avrabyt/fastdeck","commit_stats":null,"previous_names":["avrabyt/fastdeck"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrabyt%2Ffastdeck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrabyt%2Ffastdeck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrabyt%2Ffastdeck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrabyt%2Ffastdeck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avrabyt","download_url":"https://codeload.github.com/avrabyt/fastdeck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240258786,"owners_count":19773057,"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":["presentation-slides","presentation-tools","slides","slideshow"],"created_at":"2024-10-11T04:54:21.123Z","updated_at":"2025-02-23T02:21:53.695Z","avatar_url":"https://github.com/avrabyt.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastdeck\n\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://pypi.org/project/fastdeck/\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/fastdeck.svg\" alt=\"PyPI\"\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n    \u003ctd\u003e\n      \u003ca href=\"https://avrabyt.github.io/fastdeck/fastdeck.html#fastdeck\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/docs-latest-brightgreen.svg\" alt=\"Documentation\"\u003e\n      \u003c/a\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\nFastdeck is a Python library for creating and managing slide decks.\n\n**Fastdeck Python library is maintained to support the app ⚡️[Fastdeck AI](https://fastdeckai.com).**\n\n**Create and share minimal slides in seconds, on the go.**\n\n## Installation\n\nYou can install `fastdeck` using pip:\n\n```bash\npip install fastdeck==0.1.0\n```\n\n## Usage\n\nHere's a basic overview of how to use Fastdeck:\n\n1. Import the necessary classes:\n\n```python\nfrom fastdeck import Presentation, Slide, Content\n```\n\n2. Create a presentation:\n\n```python\npresentation = Presentation()\n```\n\n3. Create slides and add content:\n\n```python\nslide = Slide()\ncontent = Content()\n\ncontent.add_heading(\"Welcome to FastDeck\")\ncontent.add_text(\"This is a simple demonstration of FastDeck capabilities.\")\n\nslide.add_content([content.render()])\n```\n\n4. Add the slide to the presentation:\n\n```python\npresentation.add_slide(slide)\n```\n\n5. Generate and save the HTML:\n\n```python\npresentation.save_html(\"my_presentation.html\")\n```\n\n## Example\n\n```python\nfrom fastdeck import Presentation, Slide, Content\nimport plotly.express as px\nimport os\n\n# Create output directory\noutput_dir = 'fastdeck_demo_output'\nos.makedirs(output_dir, exist_ok=True)\n\n# Create a new presentation\npresentation = Presentation()\n\n# Define a common style for centering\ncenter_style = {'style': 'display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; text-align: center;'}\n\n# Create the title slide\ntitle_slide = Slide(center=True)\ntitle_content = Content()\ntitle_content.add_heading(\"Fastdeck\", tag=\"h1\")\ntitle_content.add_text(\"Create and manage slide decks in pure Python.\")\ntitle_slide.add_content([title_content.render()], styles=[center_style])\npresentation.add_slide(title_slide)\n# Save indiviual slides\n# title_slide.save_slide_html(os.path.join(output_dir, 'title_slide.html'))\n\n# Create a content slide\ncontent_slide = Slide()\ncontent = Content()\ncontent.add_heading(\"Features of Fastdeck\")\ncontent.add_list([\n    \"Easy to use Python API\",\n    \"Support for various content types\",\n    \"Customizable styles\",\n    \"Export to HTML\"\n])\ncontent_slide.add_content([content.render()], styles=[center_style])\npresentation.add_slide(content_slide)\n\n\n# Create a slide advertising Fastdeck AI App\nai_app_slide = Slide()\nai_app_content = Content()\nai_app_content.add_heading(\"Try Fastdeck AI App\", tag=\"h2\")\nai_app_content.add_text(\"Create and share minimal slides in seconds, on the go\")\nai_app_content.add_text(\"Powered by AI\")\nai_app_content.add_text('\u003ca href=\"https://fastdeckai.com\" target=\"_blank\"\u003eTry ⚡️ Fastdeck AI\u003c/a\u003e')\nai_app_slide.add_content([ai_app_content.render()], styles=[center_style])\npresentation.add_slide(ai_app_slide)\n\n\n# Create a slide about what more you can do with Fastdeck\nmore_features_slide = Slide()\nmore_features_content = Content()\nmore_features_content.add_heading(\"What more you can do with Fastdeck\", tag=\"h2\")\nmore_features_content.add_list([\n    \"Create interactive charts and graphs\",\n    \"Embed videos and images\",\n    \"Customize themes and layouts\",\n    \"Generate presentations programmatically\",\n    \"Integrate with data analysis workflows\",\n    \"and more ...\"\n])\nmore_features_slide.add_content([more_features_content.render()], styles=[center_style])\npresentation.add_slide(more_features_slide)\n\n\n# Create a slide with a Plotly graph\nplotly_slide = Slide()\nplotly_content = Content()\nplotly_content.add_heading(\"Plotly Graph\")\ndf = px.data.iris()\nfig = px.scatter(df, x='sepal_width', y='sepal_length', color='species', size='petal_length', hover_data=['petal_width'])\n\n# Make the plot transparent\nfig.update_layout(\n    paper_bgcolor='rgba(0,0,0,0)',  # Transparent background\n    plot_bgcolor='rgba(0,0,0,0)',   # Transparent plot area\n    autosize=True\n)\n\njson_fig = fig.to_json()\nplotly_slide.add_content([json_fig], columns=[12], styles=[{'class': 'stretch'}])\npresentation.add_slide(plotly_slide)\nplotly_slide.save_slide_html('plotly_slide.html')  # Save individual slide\n\n\n# Create a slide with an embedded video\nvideo_slide = Slide()\nvideo_content = Content()\nvideo_content.add_heading(\"Embedded Video Support\", tag=\"h2\")\nvideo_embed = '\u003ciframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/d2JPEDpMiw8\" frameborder=\"0\" allow=\"autoplay; encrypted-media\" allowfullscreen style=\"max-width: 80%; max-height: 60vh;\"\u003e\u003c/iframe\u003e'\nvideo_content.add_div(video_embed)\nvideo_slide.add_content([video_content.render()], styles=[center_style])\npresentation.add_slide(video_slide)\n\n\n# Create a slide with a cat image\nimage_slide = Slide()\nimage_content = Content()\nimage_content.add_heading(\"Image Integration\", tag=\"h2\")\nimage_url = \"https://images.unsplash.com/photo-1608848461950-0fe51dfc41cb?fm=jpg\u0026q=60\u0026w=3000\u0026ixlib=rb-4.0.3\u0026ixid=M3wxMjA3fDB8MHxleHBsb3JlLWZlZWR8MXx8fGVufDB8fHx8fA%3D%3D\"\nimage_content.add_image(image_url, alt=\"Cute cat\", **{'style': 'max-width: 80%; max-height: 60vh; object-fit: contain;'})\nimage_slide.add_content([image_content.render()], styles=[center_style])\npresentation.add_slide(image_slide)\n\n\n# Save the entire presentation\npresentation.save_html(\n    os.path.join(output_dir, \"fastdeck_demo.html\"),\n    theme=\"night\",  # 'black', 'white', 'league', 'beige', 'sky', 'night', 'serif', 'simple', 'solarized', 'blood', 'moon'\n    width=1920,     # 16:9 width \n    height=1080,    # 16:9 height \n    margin=0.07,    # 7% margin\n    minscale=0.3,   # Can shrink to 30% of original size\n    maxscale=2.0    # Can grow to 200% of original size\n)\n\nprint(f\"Presentation and individual slides have been saved in the directory: {output_dir}\")\n\n# Returns the presentation as an HTML string\nhtml_string = presentation.to_html(\n    theme=\"blood\",\n    width=1920,\n    height=1080,\n    margin=0.07,\n    minscale=0.3,\n    maxscale=2.0\n)\n\nprint(\"HTML string generated. You can paste it directly into any HTML viewer to render.\")\n```\nAfter running this script, you'll have an HTML file named `fastdeck_demo.html` that you can open in a web browser to view your presentation.\n\n## Documentation\n\nFor more detailed information about Fastdeck's classes and methods, please refer to the [documentation](https://avrabyt.github.io/fastdeck/).\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n## Acknowledgements\n- [Reveal.js](https://revealjs.com)\n- This python package is inspired by the [respysive-slide wrapper](https://github.com/fbxyz/respysive-slide/tree/master).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrabyt%2Ffastdeck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favrabyt%2Ffastdeck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrabyt%2Ffastdeck/lists"}