Giter VIP home page Giter VIP logo

cintel-02-app's Introduction

Continuous Intelligence and Interactive Analytics - Initial App

Purpose: Create an interactive analytics dashboard using Shiny for Python.

Before

  1. Join GitHub
  2. Install Git
  3. Configure Git with user.name and user.email
  4. Install current Python. Important: Add Python to PATH during installation
  5. Install VS Code Editor
  6. Install VS Code Extension: Python
  7. Install VS Code Extension: Shiny

Add the following extension now - or just add the json file later and VS Code will prompt you to install.

  1. Install VS Code Extension: Pyright

Shiny Hosting

  1. Sign up for a free account on shinyapps.io. You can sign in via GitHub for convenience.

Browser: Start a new GitHub Project with Default Files

  1. Open browser and log in to GitHub
  2. Create a new repo (e.g. cintel-02-app) with Default README.md and .gitignore (for Python).

Local Machine: Clone repo to your Documents folder

  1. Open VS Code.
  2. Clone GitHub repo into Documents folder.

Local Machine: Set Up Project Virtual Environment

Open your project folder in VS Code. Open a VS Code terminal (PowerShell or Bash or zsh) using Terminal / New Terminal.

  1. Add file: pyrightconfig.json (see example in this repo).
  2. Upgrade pip and install wheel.
  3. Create local project virtual environment (just once at the beginning)
  4. Activate the local project virtual environment (whenever you open a new terminal).
  5. Install packages into active environment (once at the start and whenever you add new packages).
  6. Freeze to requirements.txt (after adding or upgrading packages - see example in this repo).
  7. Document your workflow and commands in your README.md.

Example Terminal Commands for Windows - record your process in your README.md:

py -m pip install --upgrade pip wheel
py -m venv .venv
.\.venv\Scripts\Activate.ps1
py -m pip install --upgrade -r requirements.txt

Example Terminal Commands for Mac/Linux - record your process in your README.nd:

python3 -m pip install --upgrade pip wheel
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade -r requirements.txt

Create A Basic Shiny Express App

  1. In VS Code with your project folder open, create a new file app.py in the root project folder.
  2. See the example in this repo.

Run the Shiny App

In the terminal window, run the app with the following command. Note that the terminal will be busy running the app. If you need to run any additional terminal commands, you'll have to open a new terminal window.

Choose one of the following commands. The first command will not open a browser window. The second command will open a browser window and continuously refresh based on changes to the app.py file.

shiny run app.py
shiny run --reload --launch-browser ./app.py

You should see the following output:

INFO:     Started server process [8112]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

Open the Shiny App in Your Browser

Open your browser and go to http://127.0.0.1:8000

References

cintel-02-app's People

Contributors

denisecase avatar

Watchers

 avatar  avatar

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.