{"id":28946239,"url":"https://github.com/pymc-devs/pymc_workflow_analyzer","last_synced_at":"2025-06-23T08:05:18.456Z","repository":{"id":198908931,"uuid":"701777818","full_name":"pymc-devs/pymc_workflow_analyzer","owner":"pymc-devs","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-11T15:14:40.000Z","size":59,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-06-04T10:57:11.739Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pymc-devs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"numfocus","custom":["https://numfocus.org/donate-to-pymc"]}},"created_at":"2023-10-07T14:26:31.000Z","updated_at":"2023-12-06T20:20:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"d23bd3e6-e7b1-4283-83ad-3f25e9f67efb","html_url":"https://github.com/pymc-devs/pymc_workflow_analyzer","commit_stats":null,"previous_names":["pymc-devs/pymc_workflow_analyzer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pymc-devs/pymc_workflow_analyzer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-devs%2Fpymc_workflow_analyzer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-devs%2Fpymc_workflow_analyzer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-devs%2Fpymc_workflow_analyzer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-devs%2Fpymc_workflow_analyzer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pymc-devs","download_url":"https://codeload.github.com/pymc-devs/pymc_workflow_analyzer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pymc-devs%2Fpymc_workflow_analyzer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259561195,"owners_count":22876761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-23T08:05:17.667Z","updated_at":"2025-06-23T08:05:18.439Z","avatar_url":"https://github.com/pymc-devs.png","language":"Python","funding_links":["https://github.com/sponsors/numfocus","https://numfocus.org/donate-to-pymc"],"categories":[],"sub_categories":[],"readme":"# PyMC Workflow Analyzer\n\nAnalyze what how people are using PyMC by parsing folks code.\nSee https://discourse.pymc.io/t/extended-event-gathering-pymc-usage-information/13064 for the higher level discussion\n\n--------------------------------------------\n\nThe PyMC Workflow Analyzer is a tool designed to statically analyze Python scripts or Jupyter notebooks to identify PyMC workflows. It can process Python files, Python code as a string, or Jupyter notebooks from a local system or a URL.\n\n## Features\n\n- Analyze Python scripts or Jupyter notebooks containing PyMC workflows.\n- Support for local files, Python code as strings, or files from URLs.\n- Detailed reporting of the analysis.\n\n## Requirements\n\n- Python 3.6 or higher\n- Requests library (`pip install requests`)\n- Nbformat library (`pip install nbformat`)\n\n## Usage\n\nThis script can analyze Python scripts or Jupyter notebooks to extract information about PyMC usage. It supports input directly from a file, a string of Python code, or a URL pointing to a Jupyter notebook or a raw Python script.\n\n### Command-Line Usage\n\n1. Clone the repository to your local machine.\n2. Navigate to the directory containing the script.\n3. Run the script using Python and provide the necessary arguments.\n\n### Command Line Options\n\n- `--file`: Path to the local Python script or Jupyter notebook to analyze (**Optional**).\n- `--url`: URL pointing to a Python script or Jupyter notebook. Ensure this is the URL of the raw file.\n- `--code`: A string of Python code to analyze.\n- `--output`: Specify the path where the output report should be saved. If not provided, the report will be stored to `report.txt`\n\n### Examples\nAnalyze a local Python file:\n```sh\npython main.py sample_script.py\n```\n\nAnalyze a local Jupyter Notebook file:\n```sh\npython main.py sample_script.py\n```\n\nAnalyze a local file and save the report to a specified path:\n```sh\npython main.py sample_script.ipynb --output /path/to/save/report.txt\n```\n\nOptional `--file` argument:\n```sh\npython main.py --file sample_script.ipynb\n```\n\nAnalyze code from a direct URL Jupyter Notebook:\n```sh\npython main.py --url https://github.com/bwengals/hsgp/blob/main/cherry_blossoms_hsgp.ipynb\n```\n\nAnalyze code from a direct URL containing Python code:\n```sh\npython main.py --url https://github.com/pymc-devs/pymc/blob/main/pymc/sampling/mcmc.py\n```\n\nAnalyze a string of code and print the report to the console:\n```sh\npython main.py --code \"import pymc as pm; model = pm.Model()\"\n```\n\n### Output\nThe script generates a report that includes details about the PyMC functions used, their arguments, and other relevant information extracted from the static analysis of the code.\n\nIf the `--output` option is provided, the report will be saved to the specified path. Otherwise, it will be printed to the console and saved to `report.txt`.\n\n\n### Python Script Usage\n\nYou can also import the `static_analyzer` function in your Python scripts:\n\n```python\nfrom pymc_workflow_analyzer import static_analyzer\n\n# For local file analysis\nreport = static_analyzer(\"sample_script.py\") #defaults source_type=\"file\"\n\n# For URL analysis\nreport = static_analyzer(\"https://raw.githubusercontent.com/user/repository/branch/file.ipynb\", source_type=\"url\")\n\n# For analyzing code as a string\ncode = \"\"\"\nimport pymc as pm\nmodel = pm.Model()\n\"\"\"\nreport = static_analyzer(code, source_type=\"code\")\n\n# Process the `report` as needed\n```\n\n## Contributing\n\nContributions, issues, and feature requests are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymc-devs%2Fpymc_workflow_analyzer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpymc-devs%2Fpymc_workflow_analyzer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpymc-devs%2Fpymc_workflow_analyzer/lists"}