{"id":15890311,"url":"https://github.com/cpcloud/numbsql","last_synced_at":"2025-09-09T01:31:09.137Z","repository":{"id":37009165,"uuid":"45794243","full_name":"cpcloud/numbsql","owner":"cpcloud","description":"Run Numba compiled functions in SQLite","archived":false,"fork":false,"pushed_at":"2025-09-06T23:39:55.000Z","size":2388,"stargazers_count":41,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-09-07T01:19:59.902Z","etag":null,"topics":["database","numba","performance","python","sqlite"],"latest_commit_sha":null,"homepage":"","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/cpcloud.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2015-11-08T18:58:49.000Z","updated_at":"2025-09-06T23:39:59.000Z","dependencies_parsed_at":"2024-05-04T03:20:08.695Z","dependency_job_id":"99afc563-dff8-4e5c-9d11-24bc602a7785","html_url":"https://github.com/cpcloud/numbsql","commit_stats":{"total_commits":1372,"total_committers":11,"mean_commits":"124.72727272727273","dds":0.6465014577259476,"last_synced_commit":"5b8fa1acd46b7298f835df4b906488bc459f8d09"},"previous_names":["cpcloud/slumba"],"tags_count":58,"template":false,"template_full_name":null,"purl":"pkg:github/cpcloud/numbsql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpcloud%2Fnumbsql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpcloud%2Fnumbsql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpcloud%2Fnumbsql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpcloud%2Fnumbsql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cpcloud","download_url":"https://codeload.github.com/cpcloud/numbsql/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cpcloud%2Fnumbsql/sbom","scorecard":{"id":306550,"data":{"date":"2025-08-11","repo":{"name":"github.com/cpcloud/numbsql","commit":"e759845aeb0ff0adcc0cdb9d86c76b85c3e5835b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","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":"Code-Review","score":0,"reason":"Found 0/25 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":"Maintained","score":10,"reason":"16 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql-analysis.yml:21","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql-analysis.yml:22","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Info: no jobLevel write permissions found"],"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":"Pinned-Dependencies","score":2,"reason":"dependency not pinned by hash detected -- score normalized to 2","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:81: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:111: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:117: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:127: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:33: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/codeql-analysis.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/cpcloud/numbsql/codeql-analysis.yml/main?enable=pin","Info:   0 out of  10 GitHub-owned GitHubAction dependencies pinned","Info:   2 out of   7 third-party GitHubAction 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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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: Apache License 2.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":"Branch-Protection","score":3,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Warn: could not determine whether codeowners review is allowed","Info: 'up-to-date branches' is required to merge on branch 'main'","Info: status check found to merge onto on branch 'main'","Warn: PRs are not required to make changes on branch 'main'; or we don't have data to detect it.If you think it might be the latter, make sure to run Scorecard with a PAT or use Repo Rules (that are always public) instead of Branch Protection settings"],"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 8.1.0 not signed: https://api.github.com/repos/cpcloud/numbsql/releases/234342001","Warn: release artifact 8.0.0 not signed: https://api.github.com/repos/cpcloud/numbsql/releases/196771504","Warn: release artifact 7.1.0 not signed: https://api.github.com/repos/cpcloud/numbsql/releases/158496092","Warn: release artifact 7.0.0 not signed: https://api.github.com/repos/cpcloud/numbsql/releases/133021715","Warn: release artifact 6.0.1 not signed: https://api.github.com/repos/cpcloud/numbsql/releases/112656068","Warn: release artifact 8.1.0 does not have provenance: https://api.github.com/repos/cpcloud/numbsql/releases/234342001","Warn: release artifact 8.0.0 does not have provenance: https://api.github.com/repos/cpcloud/numbsql/releases/196771504","Warn: release artifact 7.1.0 does not have provenance: https://api.github.com/repos/cpcloud/numbsql/releases/158496092","Warn: release artifact 7.0.0 does not have provenance: https://api.github.com/repos/cpcloud/numbsql/releases/133021715","Warn: release artifact 6.0.1 does not have provenance: https://api.github.com/repos/cpcloud/numbsql/releases/112656068"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (29) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T22:11:22.232Z","repository_id":37009165,"created_at":"2025-08-17T22:11:22.232Z","updated_at":"2025-08-17T22:11:22.232Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274053269,"owners_count":25214292,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["database","numba","performance","python","sqlite"],"created_at":"2024-10-06T07:05:09.466Z","updated_at":"2025-09-09T01:31:09.121Z","avatar_url":"https://github.com/cpcloud.png","language":"Python","readme":"# Put some Numba in your SQLite\n\n## Fair Warning\n\nThis library does unsafe things like pass around function pointer addresses\nas integers.  **Use at your own risk**.\n\nIf you're unfamiliar with why passing function pointers' addresses around as\nintegers might be unsafe, then you shouldn't use this library.\n\n## Requirements\n\n* Python `\u003e=3.10`\n* `numba`\n* `llvmlite`\n\nUse `nix develop` from the repository root to avoid dependency hell.\n\n## Installation\n\n* `pip install numbsql`\n\n## Examples\n\n### Scalar Functions\n\nThese are almost the same as decorating a Python function with `numba.jit`.\n\n```python\nfrom typing import Optional\n\nfrom numbsql import sqlite_udf\n\n\n@sqlite_udf\ndef add_one(x: Optional[int]) -\u003e Optional[int]:\n    \"\"\"Add one to `x` if `x` is not NULL.\"\"\"\n\n    if x is not None:\n        return x + 1\n    return None\n```\n\n#### Calling your scalar function\n\nSimilar to scalar functions, we register the function with a `sqlite3.Connection` object:\n\n```python\n\u003e\u003e\u003e import sqlite3\n\u003e\u003e\u003e from numbsql import create_function\n\u003e\u003e\u003e con = sqlite3.connect(\":memory:\")\n\u003e\u003e\u003e create_function(con, \"add_one\", 1, add_one)\n\u003e\u003e\u003e con.execute(\"SELECT add_one(1)\").fetchall()\n[(2,)]\n```\n\n\n### Aggregate Functions\n\nThese follow the API of the Python standard library's\n`sqlite3.Connection.create_aggregate` method. The difference with numbsql\naggregates is that they require two decorators: `numba.experimental.jit_class` and\n`numbsql.sqlite_udaf`. Let's define the `avg` (arithmetic mean) function for\n64-bit floating point numbers.\n\n```python\nfrom typing import Optional\n\nfrom numba.experimental import jitclass\n\nfrom numbsql import sqlite_udaf\n\n\n@sqlite_udaf\n@jitclass\nclass Avg:\n    total: float\n    count: int\n\n    def __init__(self):\n        self.total = 0.0\n        self.count = 0\n\n    def step(self, value: Optional[float]) -\u003e None:\n        if value is not None:\n            self.total += value\n            self.count += 1\n\n    def finalize(self) -\u003e Optional[float]:\n        if not self.count:\n            return None\n        return self.total / self.count\n```\n\n### Window Functions\n\nYou can also define window functions for use with SQLite's `OVER` construct:\n\n```python\nfrom typing import Optional\n\nfrom numba.experimental import jitclass\n\nfrom numbsql import sqlite_udaf\n\n\n@sqlite_udaf\n@jitclass\nclass WinAvg:  # pragma: no cover\n    total: float\n    count: int\n\n    def __init__(self) -\u003e None:\n        self.total = 0.0\n        self.count = 0\n\n    def step(self, value: Optional[float]) -\u003e None:\n        if value is not None:\n            self.total += value\n            self.count += 1\n\n    def finalize(self) -\u003e Optional[float]:\n        count = self.count\n        if count:\n            return self.total / count\n        return None\n\n    def value(self) -\u003e Optional[float]:\n        return self.finalize()\n\n    def inverse(self, value: Optional[float]) -\u003e None:\n        if value is not None:\n            self.total -= value\n            self.count -= 1\n```\n\n#### Calling your aggregate function\n\nSimilar to scalar functions, we register the function with a `sqlite3.Connection` object:\n\n```python\n\u003e\u003e\u003e import sqlite3\n\u003e\u003e\u003e from numbsql import create_aggregate\n\u003e\u003e\u003e con = sqlite3.connect(\":memory:\")\n\u003e\u003e\u003e create_aggregate(con, \"winavg\", 1, WinAvg)\n\u003e\u003e\u003e con.execute(\"CREATE TABLE t (x INTEGER, y TEXT)\")\n\u003e\u003e\u003e con.execute(\"INSERT INTO t VALUES (1, 'a'), (2, 'a'), (3, 'b')\")\n\u003e\u003e\u003e con.execute(\"SELECT winavg(x) FROM t\").fetchall()\n[(2.0,)]\n\u003e\u003e\u003e con.execute(\"SELECT winavg(x) OVER (PARTITION BY y) FROM t\").fetchall()\n[(1.5,), (3.0,)]\n```\n\n\n#### Goodies\n\n**Some** string operations are available:\n\n```python\nfrom typing import Optional\n\nfrom numbsql import sqlite_udf\n\n\n@sqlite_udf\ndef numbsql_len(s: Optional[str]) -\u003e Optional[int]:\n    return len(s) if s is not None else None\n```\n\n```python\n\u003e\u003e\u003e import sqlite3\n\u003e\u003e\u003e from numbsql import create_function\n\u003e\u003e\u003e con = sqlite3.connect(\":memory:\")\n\u003e\u003e\u003e create_function(con, \"numbsql_len\", 1, numbsql_len)\n\u003e\u003e\u003e con.execute(\"CREATE TABLE t (name TEXT)\")\n\u003e\u003e\u003e con.execute(\"INSERT INTO t VALUES ('Alice', 'Bob', 'Susan', 'Joe')\")\n\u003e\u003e\u003e con.execute(\"SELECT numbsql_len(x) FROM t\").fetchall()\n[(5,), (3,), (5,), (3,)]\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpcloud%2Fnumbsql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcpcloud%2Fnumbsql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcpcloud%2Fnumbsql/lists"}