|
| 1 | +# Tapyr - Shiny for Python Application Template<a href="https://appsilon.github.io/tapyr-template/"><img src="www/images/tapyr.png" align="right" alt="Tapyr logo" style="height: 140px;"></a> |
| 2 | + |
| 3 | +> Create and deploy enterprise-ready PyShiny dashboards with ease. |
| 4 | +
|
| 5 | +## Introduction |
| 6 | + |
| 7 | +Tapyr is designed for data scientists and developers seeking a seamless transition from development to deployment, this template uses `poetry` for dependency management and `pytest`/`playwright` for comprehensive app validation/testing/quality assurance. |
| 8 | +Ideal for projects aiming for high-quality code and efficient deployment on Posit Connect. |
| 9 | + |
| 10 | +## Events |
| 11 | +### Upcoming |
| 12 | +Would you like to learn about Tapyr? Join our events! |
| 13 | +* [**Open Source Spotlight: Tapyr - Shiny for Python Framework**](https://go.appsilon.com/tapyr-webinar-may2024?utm_source=community&utm_medium=github&utm_campaign=shinygathering)<br> |
| 14 | +2024-05-28 at 18:00 (UTC+1)<br> |
| 15 | +Shiny Gathering led by [Piotr Storożenko](https://www.linkedin.com/in/piotr-pasza-storo%C5%BCenko/) |
| 16 | + |
| 17 | +## Docs |
| 18 | + |
| 19 | +For comprehensive documentation, please visit our [documentation](https://connect.appsilon.com/tapyr-docs/). |
| 20 | + |
| 21 | +## Getting Started |
| 22 | + |
| 23 | +Check out our get started with `tapyr` [blog post](www.appsilon.com/post/introducing-tapyr). |
| 24 | + |
| 25 | +### Using Devcontainer |
| 26 | + |
| 27 | +To ensure a consistent development experience across all environments, we recommend using the [devcontainer](https://code.visualstudio.com/docs/remote/containers) configuration with Visual Studio Code or DevPod for container-based development. |
| 28 | + |
| 29 | +1. **Start the Devcontainer**: Open the project in VS Code and select "Reopen in Container" when prompted, or use the Command Palette (`Ctrl+Shift+P`) and choose "Remote-Containers: Reopen in Container". Alternatively, use [DevPod](https://devpod.sh/) following their instructions. |
| 30 | +2. **Activate the virtual environment**: |
| 31 | + ```sh |
| 32 | + poetry shell |
| 33 | + ``` |
| 34 | +3. **Run the application**: |
| 35 | + ```sh |
| 36 | + shiny run app.py --reload |
| 37 | + ``` |
| 38 | +4. **Execute tests**: |
| 39 | + ```sh |
| 40 | + poetry run pytest |
| 41 | + ``` |
| 42 | + |
| 43 | +*Note*: The Devcontainer might limit some `playwright` features, such as `codegen`. For full functionality, consider a local setup. |
| 44 | + |
| 45 | +### Setting Up Locally with Poetry |
| 46 | + |
| 47 | +For developers preferring a local setup without Devcontainer: |
| 48 | + |
| 49 | +1. **Install pipx**: Ensure pipx is installed for managing isolated CLI apps. |
| 50 | +2. **Install Poetry**: |
| 51 | + ```sh |
| 52 | + pipx install poetry |
| 53 | + ``` |
| 54 | +3. **Clone the repository** and navigate to it. |
| 55 | +4. **Install dependencies**: |
| 56 | + ```sh |
| 57 | + poetry install |
| 58 | + playwright install |
| 59 | + ``` |
| 60 | + |
| 61 | +*Attention*: Follow any additional steps prompted by `playwright install`. |
| 62 | + |
| 63 | +### Deployment on Posit Connect |
| 64 | + |
| 65 | +Deploy your application to Posit Connect by: |
| 66 | + |
| 67 | +1. **Exporting your API Key**: |
| 68 | + ```sh |
| 69 | + export CONNECT_API_KEY="your_api_key_here" |
| 70 | + ``` |
| 71 | +2. **Configuring Posit Connect**: |
| 72 | + ```sh |
| 73 | + rsconnect add \ |
| 74 | + --api-key $CONNECT_API_KEY \ |
| 75 | + --server <MY_CONNECT_URL> \ |
| 76 | + --name <SERVER_NAME> |
| 77 | + ``` |
| 78 | +3. **Deploying**: |
| 79 | + ```sh |
| 80 | + rsconnect deploy shiny -t "Tapyr App" . |
| 81 | + ``` |
| 82 | + |
| 83 | +Replace placeholders with your server URL, server name, and API key. Verify the deployment on Posit Connect for successful upload. |
| 84 | + |
| 85 | +## :star2: Stay Updated |
| 86 | +Don't miss out on important updates and exclusive content about Tapyr and PyShiny → [Subscribe to our newsletter](https://go.appsilon.com/shiny-weekly?utm_source=community&utm_medium=github&utm_content=tapyr). |
| 87 | + |
| 88 | +Have questions or want to contribute? Engage with Appsilon's developers and the data science community on our [Shiny 4 All](https://go.appsilon.com/shiny4allcommunity). |
| 89 | + |
| 90 | + |
| 91 | +--- |
| 92 | + |
| 93 | +Developed with :heart: at [Appsilon](https://appsilon.com). |
| 94 | +Get in touch: <opensource@appsilon.com>. |
| 95 | + |
| 96 | +Want to stay up to date with Tapyr and other packages? Join 4,2k explorers and get the [📧 Shiny Weekly Newsletter](https://go.appsilon.com/shiny-weekly?utm_source=community&utm_medium=github&utm_content=tapyr) into your mailbox and check our [Slack community](https://go.appsilon.com/shiny4allcommunity). |
| 97 | + |
| 98 | +Explore the [Rhinoverse](https://rhinoverse.dev) - a family of R packages built around [Rhino](https://appsilon.github.io/rhino/)! |
| 99 | + |
| 100 | +Appsilon is a |
| 101 | +[**Posit (formerly RStudio) Full Service Certified Partner**](https://www.rstudio.com/certified-partners/). |
| 102 | + |
| 103 | +<a href="https://appsilon.com/careers/"> |
| 104 | + <img src="https://raw.githubusercontent.com/Appsilon/website-cdn/gh-pages/WeAreHiring1.png" alt="We are hiring!"> |
| 105 | +</a> |
0 commit comments