Skip to content

UNDP-Data/py-shiny-components

Repository files navigation

Shiny for Python Components from the UNDP Design System

Caution

Work in progress. The components are not ready for production use yet.

This repository contains a Python package offering custom components for Shiny that are based on the UNDP Design System.

Note

Disclaimer: Posit, RStudio, and Shiny are trademarks of Posit Software, PBC, all rights reserved, and may be registered in the United States Patent and Trademark Office and in other countries. This project is not affiliated with, endorsed by, or directly supported by Posit Software, PBC.

Structure

The code structure is as follow:

package.json        # Contains the dependencies needed to build the components javascript
srcts/              # Source Typescript files
  index.ts          # Where we define the components
undp_design_system/
  undp_design_system.py   # Python functions for the components
  __init__.py       # Used to define exports for python package.
  distjs/           # Where the bundled js files are put
example-app/
  app.py            # Example app for the custom-input component
...                 # ...Various other config files needed for python and js projects

Using/ Developing package

Setting up python package in "editable" mode

This should be run from the root of the repo

pip install -e .

Setting up JS for development

Install the dependencies for javascript:

npm install

Build assets into the undp_design_system/distjs folder:

npm run build

Or if you want to watch the files for changes and rebuild on the fly you can run:

npm run watch

Running the example app

With both the python package and the javascript built, you can run the example apps (typically using the Shiny vscode extension).

If you want to run the example app from the command line you can run:

shiny run example-app/app.py

License

This project is licensed under the BSD 3-Clause License. However, entities or individuals not affiliated with UNDP are strictly prohibited from using this package or any of its components to create, share, publish, or distribute works that resemble, claim affiliation with, or imply endorsement by UNDP.

UNDP’s name, emblem and its abbreviation are the exclusive property of UNDP and are protected under international law. Their unauthorized use is prohibited, and they may not be reproduced or used in any manner without UNDP’s prior written permission.

Contact

If you are facing any issues or would like to make some suggestions, feel free to open an issue.

About

Components for Shiny for Python based on the UNDP Design System.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages