Git Product home page Git Product logo

py-shiny-templates's Introduction

Shiny for Python Templates

This repository hosts source files behind Shiny for Python templates.

Installation

To install dependencies for every template, run:

make install

To install dependencies for a specific template, use the requirements.txt file in the template's directory. For example:

pip install -r basic-app-plot/requirements.txt

Running a template

From the terminal, you can then run a template like so:

shiny run basic-app-plot/app-core.py

Alternatively, open the app file of interest in VSCode and run it from there.

Deployment

Apps are automatically deployed to shinyapps.io. This should just work for applications that have been previously deployed, but you need to follow a few steps to deploy a new application. Each deployment retries three times to avoid spurious failures, and caches the result so as not to redeploy applications which have not changed since the last successful deployment.

Contributing

  1. Create a new folder for the application, the folder should contain at least an app-core.py file and a requirements.txt file. Optionally add an app-express.py file if you want to give people the option to use Shiny Express.
  • Make sure also to add this requirements.txt file to the root ./requirements.txt file.
  1. Deploy the app to shinyapps.io in the gallery account, if you don't have access to this account mention it in the PR and a member of the Shiny team will do this and the following step for you.

  2. Add your application to deployments.json, you will need to login to shinyapps.io to get the guid.

  • Note that this guid is the same as the app_id left in the rsconnect-python/ manifest created by rsconnect deploy shiny.
  1. Raise a PR with your changes

py-shiny-templates's People

Contributors

gshotwell avatar cpsievert avatar gadenbuie avatar gregswinehart avatar

Stargazers

Yuta Nishida avatar poppy avatar  avatar Yoong Hor Meng avatar Gaurav avatar hatayou avatar Luis Merino Ulizarna avatar Niraj avatar Botan Ağın avatar

Watchers

Andrew Holz avatar Winston Chang avatar Neal Richardson avatar  avatar  avatar

py-shiny-templates's Issues

Deployment cache should include requirements.txt containing package versions

I believe there needs to be a step where we install the app packages.

Then we should also include the installed packages in the cache path.

          path: |
            ${{ matrix.folder }}
            INSTALL_PATH_HERE

IDK what the Install location is for the python packages


Motivation: We cache both the shiny code and the app content

Originally posted by @schloerke in #8 (comment)


Oh that's a good point, what about including the shiny version in the requirements.txt file instead? I'll add an issue.

Syntax for installing from GitHub

The syntax for installing from GitHub is a little too low-level

shiny create -m core -g https://github.com/posit-dev/py-shiny-templates/tree/main/basic-navigation

It'd be nice if we could break this into smaller pieces

shiny create -m core --github posit-dev/py-shiny-templates basic-navigation

or abstractly

shiny create -m core [--github <repo> --ref <ref>] path/to/template

We could also consider replacing --github with --repo and assuming --repo is GitHub, but it could in the future be any git-backed repo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.