{"library":"pygaljs","title":"Pygaljs","description":"Pygaljs is a Python package designed to provide static assets (JavaScript, CSS, fonts, etc.) for the pygal.js JavaScript charting library. It acts as a wrapper, making these web assets easily discoverable and servable within Python-based web applications. The current version is 1.0.2, and its release cadence is infrequent, with the last release in April 2020, indicating a stable but not actively developed state.","language":"python","status":"maintenance","last_verified":"Sun May 17","install":{"commands":["pip install pygaljs"],"cli":null},"imports":["import pygaljs"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import os\nimport pygaljs\n\n# The pygaljs package primarily provides static assets.\n# Its main utility in Python code is often to determine the path\n# to these assets for serving them in a web framework.\n\n# Get the base directory of the installed pygaljs package\npackage_root = os.path.dirname(pygaljs.__file__)\nprint(f\"Pygaljs package root: {package_root}\")\n\n# Example of how you might construct a path to a specific asset (e.g., JavaScript file)\n# Note: The exact subdirectory structure depends on the pygal.js assets it bundles.\n# A common pattern for such packages is to have a 'static' or 'dist' directory.\n\n# This path might vary; typically, you'd look for a 'static' or 'dist' folder.\n# For pygaljs, the assets are often directly under 'pygaljs/pygaljs/'.\n# Checking the GitHub repository (https://github.com/ionelmc/python-pygaljs)\n# shows assets like 'pygal-2.0.x.min.js' directly under 'pygaljs/pygaljs'.\n\npygaljs_assets_dir = os.path.join(package_root, 'pygaljs')\nprint(f\"Pygaljs assets directory (potential): {pygaljs_assets_dir}\")\n\n# Verify if the directory exists and list some contents (for demonstration)\nif os.path.exists(pygaljs_assets_dir):\n    print(\"Contents of pygaljs assets directory (first 5 files):\")\n    for i, item in enumerate(os.listdir(pygaljs_assets_dir)):\n        if i >= 5: break\n        print(f\"  - {item}\")\nelse:\n    print(f\"Warning: {pygaljs_assets_dir} does not exist. Asset location might differ.\")\n\n# In a web framework (e.g., Flask, Django), you would configure\n# a static file handler to serve files from `pygaljs_assets_dir`.\n# For example, in Flask:\n# app.static_folder = os.path.join(os.path.dirname(pygaljs.__file__), 'pygaljs')","lang":"python","description":"The `pygaljs` library is primarily an asset provider for the `pygal.js` JavaScript charting library. The most common 'use case' in Python code is to programmatically locate the installation path of these static assets so that a web framework can serve them. This example demonstrates how to find the root directory of the installed package and a likely location for its JavaScript and CSS files.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":{"tag":null,"tag_description":null,"last_tested":"2026-05-17","installed_version":"1.0.2","pypi_latest":"1.0.2","is_stale":false,"summary":{"python_range":"3.10–3.9","success_rate":100,"avg_install_s":1.6,"avg_import_s":0,"wheel_type":"wheel"},"results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"18.1M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0,"mem_mb":0,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"19.9M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.6,"import_time_s":0,"mem_mb":0,"disk_size":"20M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"11.8M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.4,"import_time_s":0,"mem_mb":0,"disk_size":"12M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"11.6M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.5,"import_time_s":0,"mem_mb":0,"disk_size":"12M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":null,"import_time_s":0,"mem_mb":0,"disk_size":"17.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"pygaljs","exit_code":0,"wheel_type":"wheel","failure_reason":null,"import_side_effects":"clean","install_time_s":1.7,"import_time_s":0,"mem_mb":0,"disk_size":"18M"}]}}