{"id":15284531,"url":"https://github.com/michelemartone/pyrsb","last_synced_at":"2026-03-04T11:02:56.062Z","repository":{"id":41497732,"uuid":"94685119","full_name":"michelemartone/pyrsb","owner":"michelemartone","description":"PyRSB: a Python interface to the librsb Sparse Matrix library","archived":false,"fork":false,"pushed_at":"2022-03-18T14:05:59.000Z","size":310,"stargazers_count":19,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T19:46:59.132Z","etag":null,"topics":["cython","feedback","hpc","librsb","linear-algebra","numpy","openmp","python-interface","python3","scipy","sparse-linear-systems","sparse-matrix"],"latest_commit_sha":null,"homepage":"http://librsb.sf.net","language":"Cython","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/michelemartone.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}},"created_at":"2017-06-18T12:13:32.000Z","updated_at":"2024-05-14T19:03:03.000Z","dependencies_parsed_at":"2022-09-06T19:40:20.058Z","dependency_job_id":null,"html_url":"https://github.com/michelemartone/pyrsb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/michelemartone/pyrsb","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelemartone%2Fpyrsb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelemartone%2Fpyrsb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelemartone%2Fpyrsb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelemartone%2Fpyrsb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/michelemartone","download_url":"https://codeload.github.com/michelemartone/pyrsb/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/michelemartone%2Fpyrsb/sbom","scorecard":{"id":641992,"data":{"date":"2025-08-11","repo":{"name":"github.com/michelemartone/pyrsb","commit":"565861ca11f9aacab9b0cd55d0ea324e0559a2fe"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:3","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"14 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2018-34 / GHSA-2fc2-6r4j-p65h","Warn: Project is vulnerable to: PYSEC-2021-856 / GHSA-5545-2q6w-2gh6","Warn: Project is vulnerable to: PYSEC-2019-108 / GHSA-9fq2-x9r6-wfmf","Warn: Project is vulnerable to: PYSEC-2018-33 / GHSA-cw6w-4rcx-xphc","Warn: Project is vulnerable to: PYSEC-2021-857 / GHSA-f7c7-j99h-c22f","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: PYSEC-2017-1 / GHSA-frgw-fgh6-9g52","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114","Warn: Project is vulnerable to: PYSEC-2013-22 / GHSA-27x4-j476-jp5f","Warn: Project is vulnerable to: PYSEC-2025-49 / GHSA-5rjg-fvgr-3xxf","Warn: Project is vulnerable to: GHSA-cx63-2mw6-8hw5","Warn: Project is vulnerable to: PYSEC-2022-43012 / GHSA-r9hx-vwmv-q579","Warn: Project is vulnerable to: PYSEC-2022-43017 / GHSA-qwmp-2cf2-g9g6"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T11:00:17.457Z","repository_id":41497732,"created_at":"2025-08-21T11:00:17.457Z","updated_at":"2025-08-21T11:00:17.457Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30078415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["cython","feedback","hpc","librsb","linear-algebra","numpy","openmp","python-interface","python3","scipy","sparse-linear-systems","sparse-matrix"],"created_at":"2024-09-30T14:58:05.245Z","updated_at":"2026-03-04T11:02:56.026Z","avatar_url":"https://github.com/michelemartone.png","language":"Cython","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# PyRSB\n\n[![GPL enforced badge](https://img.shields.io/badge/GPL-enforced-blue.svg \"This project enforces the GPL.\")](https://gplenforced.org)\n\n[librsb](http://librsb.sourceforge.net/) is a **high performance sparse matrix\nlibrary** implementing the Recursive Sparse Blocks format,\nwhich is especially well suited for\nmultiplications in **iterative methods** on **very large sparse matrices**.\n\n**PyRSB is a Cython-based Python interface to librsb.**\n\nOn multicore machines, PyRSB can be several times faster than e.g. `scipy.sparse.csr_matrix()`.\nFor an example how to invoke it with minimal overhead, [see the advanced example](#ExampleAdvancedUsage).\n\nSo far, PyRSB is a prototype tested on Linux only.\nThe librsb library instead is mature and well tested.\n**Prospective PyRSB users and collaborators are welcome to** [contact me](http://librsb.sourceforge.net/#a_contacts).\n\n## Features\n\nThe following functionality is implemented:\n\n  * Initialization with `rsb.rsb_matrix()` styled as [`scipy.sparse.csr_matrix()`](https://docs.scipy.org/doc/scipy/reference/sparse.html).\n  * Conversion from `scipy.sparse.csr_matrix()`.\n  * Multiplication by vector/multivector.\n  * Rows/columns through `nr=a.shape()[0]`/`nr=a.shape()[1]`, or `nr()`/`nc()`.\n  * `find()`, `find_block()`, `tril()`, `triu()`, `shape()`, `nnz`.\n  * `print`'able.\n  * PyRSB-Specific: `autotune()`, `do_print()`.\n  * load from a Matrix Market file, e.g. `rsb_matrix(bytes(filename,encoding='utf-8'))`\n\n## Build and Use\n\n- If you want the `Makefile` to build librsb (in this directory):\n `make all-local` will attempt downloading librsb-1.3.0.0 from the\n web and building it here before building pyrsb.\n If the file is in place, it won't download it a second time.\n After that, `make local-librsb-pyrsb` (or `make lp`) will build pyrsb\n using local librsb, then run it.\n This method shall use the best compilation flags.\n- If you have librsb already installed:\n `make` shall build and test.\n- Make sure you have `cython`, `scipy`, `numpy`. installed.\n- If you don't have librsb installed you may want to try via [pip](https://pypi.org/project/pyrsb/) `pip install pyrsb`\n- If you want to install librsb on Ubuntu or Debian:\n `sudo apt-get install librsb-dev` shall suffice.\n  Other operating systems have librsb, too.\n  Please check yours.\n  Or check [librsb](http://librsb.sourceforge.net/)'s web site.\n- `make test` will test benchmark code using `test.py` (*to compare speed to SciPy*)\n- `make b` will also produce graphs (requires `gnuplot`)\n\n## Example Usage\n\n```python\n# Example: demo1.py\n\"\"\"\npyrsb demo\n\"\"\"\n\nimport numpy\nimport scipy\nfrom scipy.sparse import csr_matrix\nfrom pyrsb import *\n\nV = [11.0, 12.0, 22.0]\nI = [0, 0, 1]\nJ = [0, 1, 1]\nc = csr_matrix((V, (I, J)))\nprint(c)\n# several constructor forms, as with csr_matrix:\na = rsb_matrix((V, (I, J)))\na = rsb_matrix((V, (I, J)), [3, 3])\na = rsb_matrix((V, (I, J)), sym=\"S\")  # symmetric example\nprint(a)\na = rsb_matrix((4, 4))\na = rsb_matrix(c)\nnrhs = 1  # set to nrhs\u003e1 to multiply by multiple vectors at once\nnr = a.shape[0]\nnc = a.shape[1]\norder = \"F\"\nx = numpy.empty([nc, nrhs], dtype=rsb_dtype, order=order)\ny = numpy.empty([nr, nrhs], dtype=rsb_dtype, order=order)\nx[:, :] = 1.0\ny[:, :] = 0.0\nprint(a)\nprint(x)\nprint(y)\n# import rsb # import operators\n# a.autotune() # makes only sense for large matrices\ny = y + a * x\n# equivalent to y=y+c*x\nprint(y)\ndel a\n```\n\n## \u003ca id=\"ExampleAdvancedUsage\"\u003e\u003c/a\u003eExample Advanced Usage ##\n\n```python\n# Example: demo2.py\n\"\"\"\npyrsb demo\n\"\"\"\n\nimport numpy\nimport scipy\nfrom scipy.sparse import csr_matrix\nfrom pyrsb import *\n\nV = [11.0, 12.0, 22.0]\nI = [0, 0, 1]\nJ = [0, 1, 1]\na = rsb_matrix((V, (I, J)))\n\nnrhs = 4  # set to nrhs\u003e1 to multiply by multiple vectors at once\nnr = a.shape[0]\nnc = a.shape[1]\n\n# Choose Fortran or \"by columns\" order here.\norder = \"F\"\nx = numpy.empty([nc, nrhs], dtype=rsb_dtype, order=order)\ny = numpy.empty([nr, nrhs], dtype=rsb_dtype, order=order)\nx[:, :] = 1.0\ny[:, :] = 0.0\nprint(a)\nprint(x)\nprint(y)\n\n# Autotuning example: use it if you need many multiplication iterations on huge matrices (\u003e\u003e1e6 nonzeroes).\n# Here general (nrhs=1) case:\na.autotune()\n# Here with all the autotuning parameters specified:\na.autotune(1.0,1,2.0,'N',1.0,nrhs,'F',1.0,False)\n\n# Inefficient: reallocate y\ny = y + a * x\n# Inefficient: reallocate y\ny += a * x\n\n# Equivalent but more efficient: don't reallocate y\na._spmm(x,y)\n\nprint(y)\n\ndel a\n```\n\n## License\nGPLv3+\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelemartone%2Fpyrsb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmichelemartone%2Fpyrsb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmichelemartone%2Fpyrsb/lists"}