{"id":46487387,"url":"https://github.com/fire2a/fire2a-lib","last_synced_at":"2026-03-06T09:38:28.277Z","repository":{"id":190554799,"uuid":"682835045","full_name":"fire2a/fire2a-lib","owner":"fire2a","description":"Algorithms and tools python package","archived":false,"fork":false,"pushed_at":"2026-01-23T00:55:00.000Z","size":10985,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-23T17:50:12.230Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://fire2a.github.io/fire2a-lib/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"fdobad/template-python-package","license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fire2a.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-25T01:49:38.000Z","updated_at":"2026-01-23T00:53:19.000Z","dependencies_parsed_at":"2023-08-25T07:26:56.353Z","dependency_job_id":"ee8e11f2-9c7e-4b4d-adaa-5cc3ddb34ace","html_url":"https://github.com/fire2a/fire2a-lib","commit_stats":null,"previous_names":["fire2a/fire2a-lib"],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/fire2a/fire2a-lib","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire2a%2Ffire2a-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire2a%2Ffire2a-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire2a%2Ffire2a-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire2a%2Ffire2a-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fire2a","download_url":"https://codeload.github.com/fire2a/fire2a-lib/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fire2a%2Ffire2a-lib/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30169278,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T07:56:45.623Z","status":"ssl_error","status_checked_at":"2026-03-06T07:55:55.621Z","response_time":250,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-03-06T09:38:27.584Z","updated_at":"2026-03-06T09:38:28.269Z","avatar_url":"https://github.com/fire2a.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cspan style=\"color: orange;\"\u003e\u003cstrong\u003e\u003cem\u003e\u003ca href=\"https://fire2a.github.io/docs/docs/qgis-toolbox/README.html\" style=\"color: orange;\"\u003e\nFriendly graphical user interface click here\n\u003c/a\u003e\u003c/em\u003e\u003c/strong\u003e\u003c/span\u003e\n\n![PyPI workflow](https://github.com/fire2a/fire2a-lib/actions/workflows/publish-pypi.yml/badge.svg)\n![auto pdoc workflow](https://github.com/fire2a/fire2a-lib/actions/workflows/auto-docs.yml/badge.svg)\n![PyPI Version](https://img.shields.io/pypi/v/fire2a-lib.svg)\n![Python Versions](https://img.shields.io/pypi/pyversions/fire2a-lib.svg)\n![License](https://img.shields.io/github/license/fire2a/fire2a-lib.svg)\n![Downloads](https://img.shields.io/pypi/dm/fire2a-lib.svg)\n![Code Style](https://img.shields.io/badge/code%20style-black-000000.svg)\n\n# fire2a-lib python package\nFire Advanced Analyitics research group scriptable knowledge base\n- Novel Algorithms related to landscape risk metrics, spatial decision optimization models, etc.\n- (Cell2) Fire (W) Simulator integration algorithms to facilitating placing firebreaks, measuring forest fire impacts, etc.\n- (Q)GIS algorithms to common tasks related to rasters, polygons, spatial clustering, etc.\n\n## Quickstart\n### Simplest: Use within QGIS\n1. Install QGIS\n2. Open QGIS Python Console\n3. To install, type :\n```python\n!pip install fire2a-lib\n```\n4. Visit [fire2a-lib documentation](https://fire2a.github.io/fire2a-lib), example:\n```python\nfrom fire2a.downstream_protection_value import digraph_from_messages\ndigraph = digraph_from_messages('messages01.csv')\n```\n### Command line usage\n1. Install QGIS\n\n- 1.A. [Simple](https://qgis.org/download/)\n- 1.B. Docker users check [qgis container](https://hub.docker.com/r/qgis/qgis)\n- __Optional but worth it for Windows:__ Make QGIS's bundled python folder writable by your user\n   - Three alternatives:\n   - A. Open File Explorer, go to `C:\\Program Files\\QGIS 3.38.3\\apps`, right-click `Python312` folder [Show more options]\\Properties\\Security\\Edit\\Allow Full control\\OK\n   - B. Open cmd administrator terminal, type:\n     ```\n     icacls \"C:\\Program Files\\QGIS 3.38.3\\apps\\Python312\" /grant %username%:F /T\n     ```\n\n     \n2. Locate python, prepare environment\n\n- 2.A. Windows\n   - Open `OsGeo4W Shell` application, \n   - Run `bin\\python-qgis.bat` once to configure all environment variables in the current session.\n   - Also you could: `bin\\python-qgis.bat your_script.py`\n   - Recommended persistent [integration](https://github.com/fire2a/fire2a-lib/blob/main/qgis-launchers/README.md)\n- 2.B. macOS \n   - Open terminal application, \n   - Use this python: `/Applications/QGIS.app/Contents/MacOS/bin/python` (see creating an alias below)\n   - TODO: are all environment variables right?\n- 2.C. Linux\n   ```\n   python3 -m venv --system-site-packages qgis_venv\n   source qgis_venv/bin/activate\n   ```\n3. Install\n```bash\npython -m pip install fire2a-lib\n# also recommended for development: ipython qtconsole jupyterlab\n```\n4. Visit [fire2a-lib documentation](https://fire2a.github.io/fire2a-lib), example for getting the burn probability from a simulator results directory:\n```bash\npython -m fire2a.cell2fire -vvv --base-raster ../fuels.asc --authid EPSG:25831 --scar-sample Grids/Grids2/ForestGrid03.csv --scar-poly propagation_scars.shp --burn-prob burn_probability.tif\n```\n## Scripting/Developing tips\n- Check [standalone scripting](https://github.com/fire2a/fire-analytics-qgis-processing-toolbox-plugin/blob/main/script_samples/standalone.py) for more info on initializing a headless QGIS environment\n- Usage [examples](https://github.com/fire2a/fire2a-lib/tree/main/usage_samples)\n- macOS users add a permanent alias, on the terminal app\n   ```zsh\n   echo \"alias pythonq='/Applications/QGIS.app/Contents/MacOS/bin/python'\" \u003e\u003e ~/.zshrc\n   ```\n### Interactive \n1. Interactive sessions in IPython, qtconsole, jupyter-lab, or IPyConsole (QGIS plugin) compatible\n```bash\n# Press tab to auto-complete of available modules from IPython\nIn [1]: from fire2a.\u003cpress-tab\u003e\n```\n2. Stop here interactive (colored terminal able):\n```python\nfrom IPython.terminal.embed import InteractiveShellEmbed\nInteractiveShellEmbed()()\n```\n3. Stop here interactive (no colors):\n```python\nfrom IPython import embed\nembed()\n```\nc. QGIS debugging:\n```python\nfrom qgis.PyQt.QtCore import pyqtRemoveInputHook\npyqtRemoveInputHook()\nimport pdb\npdb.set_trace()\nfrom IPython.terminal.embed import InteractiveShellEmbed\nInteractiveShellEmbed()()\n```\n3. Copy and paste the code interactive:\n```bash\n# Select and Copy a whole module from line 1 up -but not included- to 'def main def main(argv=None):' line \nIn [2]: %paste\n\n# Choose your args \nIn [3]: args = arg_parser.parse_args(['-vvv', '--base-raster', ...\n\n# Skip (reading args from sys.argv o main)\n    if argv is sys.argv:\n        argv = sys.argv[1:]\n    args = arg_parser(argv)\n\n# Ready to run the main interactively (args object ready)\n```\n\n# [Contributing](./CODING.md)\n# [Building](./BUILDING.md)\n\n\n# Code of Conduct\n\nEveryone interacting in the project's codebases, issue trackers,\nchat rooms, and fora is expected to follow the\n[PSF Code of Conduct](https://www.python.org/psf/conduct).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffire2a%2Ffire2a-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffire2a%2Ffire2a-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffire2a%2Ffire2a-lib/lists"}