Introducing Tapyr: Create and Deploy Enterprise-Ready Shiny for Python Dashboards with Ease

By:
Gift Kenneth
April 30, 2024

Are you an R/Shiny user looking to leverage the incredible capabilities of Shiny for Python without sacrificing the familiarity and comfort of your existing tools? 

Introducing Tapyr—our Shiny for Python framework. It brings Rhino-like capabilities from the R world and more to the Shiny for Python ecosystem, helping you build enterprise-ready applications with ease.

Curious about Shiny for Python from an R Shiny dev's perspective? Check out this blog post to learn more.

Tapyr is designed as a lightweight template repository for Shiny for Python projects that offers tools similar to Rhino for R/Shiny. For instance, Tapyr introduces poetry, which handles project dependencies much like renv in R. This ensures that R users can smoothly adapt to Python without tackling a steep learning curve while adhering to best practices from day 0.

Key Features of Tapyr

  • Leverage Python Tools: Tapyr takes advantage of Python’s ecosystem tools, including ruff, pytest, and others. 
  • Enterprise-Ready Applications, Made Easy: The framework is tailored for building robust, scalable, and production-ready applications.
  • Comprehensive Testing with Playwright: Say goodbye to the hassle of juggling multiple languages for end-to-end testing. Tapyr leverages Playwright, integrated with pytest, allowing you to write all tests in Python – a streamlined approach that keeps your coding practices consistent and efficient.
  • Static Type Checking with PyRight: Improve code quality and reduce bugs with PyRight, a static type checking feature not available in R. This proactive error detection ensures your applications are reliable, before you even start them.

Complementing Existing Resources

While Posit's Shiny for Python templates cater to exploratory data analysis, Tapyr serves a distinct, complementary role by providing a structured repository designed to kickstart your projects. This approach focuses on developing comprehensive, scalable and future-proof applications. 

This not only expands the tools available to data scientists and developers but also helps you to tackle larger, more complex projects effectively.

Tapyr is ideal for data scientists (transitioning from R to Python), developers familiar with Shiny and Rhino building projects in Shiny for Python, and academic researchers and enterprise professionals requiring enterprise-level dashboard frameworks.

Getting Started with Tapyr

Using Devcontainer

We recommend using the Dev Container configuration with Visual Studio Code (VS Code) or DevPod to ensure a consistent development experience across different computers and environments. It may sound complicated, but it is as easy as a breeze! 

The Dev Container is like a virtual environment with everything you need to work on the project, including all the required software and dependencies.

  1. Install Dev Containers extension if you don’t have it already.
VS Code Dev Containers

  1. Clone the repository and start the dev container: You can clone the Tapyr repository from GitHub or download the source code. some text
    1. Navigate to the project directory and open the project in VS Code.
    2. Select "Reopen in Container" when prompted.
    3. If you're prompted to "Reopen in Container," select that option. If not, you can open the Command Palette (Ctrl+Shift+P on Windows/Linux, or Cmd+Shift+P on Mac) and choose "Remote-Containers: Reopen in Container."
    4. If you're using DevPod, follow their instructions to start the Devcontainer.

Reopen in Container

  1. Activate the virtual environment: Once the Dev Container is running, you'll need to activate the virtual environment (creating a special workspace where all the project's dependencies are installed).  Run the following command:
poetry shell

Activate in virtual environment
  1. Run the application: Now you're ready to run the application!  Use this command:
shiny run app.py --reload
Run the application

This will start the application and automatically reload it whenever you make changes to the code.

Tapyr | Shiny for Python Template
  1. Execute tests: To run tests and ensure everything is working correctly, use this command:
poetry run pytest

If you prefer to run this locally, you can do so using Poetry.

Struggling with Quality Assurance for your Shiny for Python Dashboards? Check out this blog post to learn more about leveraging Playwright.

Get Started Today

Dive into Tapyr and start building your enterprise-level applications today! 

Download Tapyr, check out the documentation, explore its functionalities, and join the community of innovators expanding their Shiny for Python skillsets.

We value your feedback, so please share your experiences and suggestions to help us improve Tapyr in our Shiny community

Want to stay up to date with Tapyr and other packages? Join 4.2k explorers and get the Shiny Weekly Newsletter into your mailbox.

FAQs

Q: Is there a community or support available for Tapyr users?

A: You can create a pull request, open an issue, follow our documentation, and engage with other users in our community to get support, share insights, and contribute to the project's development.

Q: How is Tapyr different from Posit's Shiny for Python templates?

A: While Posit's Shiny for Python templates focus on exploratory data analysis, Tapyr is a framework focused on building comprehensive, scalable Shiny for Python applications. 

Q: How does Tapyr compare to other tools like reticulate?

A: While reticulate allows you to call Python from R, Tapyr takes a different approach by providing a streamlined framework for building enterprise-ready applications using Shiny for Python. Since all the code is written in Python, it offers features like static type checking, comprehensive testing with Playwright, and seamless integration with Python ecosystems.

Have questions or insights?

Engage with experts, share ideas and take your data journey to the next level!

Sign up for ShinyWeekly

Join 4,2k explorers and get the Shiny Weekly Newsletter into your mailbox
for the latest in R/Shiny and Data Science.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Explore Possibilities

Share Your Data Goals with Us

From advanced analytics to platform development and pharma consulting, we craft solutions tailored to your needs.

Talk to our Experts
open source
shiny for python
python