Download app.py from thohan88/tools: direct link, hf CLI and curl.
- Browser
- Download file 721 Bytes
-
https://huggingface.co/spaces/thohan88/tools/resolve/main/app.py
- Command line
-
hf download hf://spaces/thohan88/tools/app.py
-
curl -L -o app.py https://huggingface.co/spaces/thohan88/tools/resolve/main/app.py
721 Bytes
| from pathlib import Path | |
| from tools.pdf2svg import mod_pdf2svg_ui, mod_pdf2svg_server | |
| from tools.scraper import mod_scraper_ui, mod_scraper_server | |
| from shiny import ui, App | |
| import tempfile | |
| import shutil | |
| import atexit | |
| app_dir = Path(__file__).parent | |
| www_dir = app_dir / "www" | |
| www_dir.mkdir(exist_ok=True) | |
| scrapes_dir = app_dir / "scrapes" | |
| scrapes_dir.mkdir(exist_ok=True) | |
| app_ui = ui.page_navbar( | |
| ui.nav_panel("Scraper", mod_scraper_ui("scraper")), | |
| ui.nav_panel("PDF2SVG", mod_pdf2svg_ui("pdf2svg")), | |
| title="Tools App" | |
| ) | |
| def server(input, output, session): | |
| mod_scraper_server("scraper", www_dir, scrapes_dir) | |
| mod_pdf2svg_server("pdf2svg", www_dir) | |
| app = App(app_ui, server, static_assets=www_dir) | |