{"id":37067775,"url":"https://github.com/gilaniasher/segtree-c-python","last_synced_at":"2026-01-14T07:58:03.211Z","repository":{"id":62565628,"uuid":"428035081","full_name":"gilaniasher/segtree-c-python","owner":"gilaniasher","description":"A Segment Tree written in C as a Python module. Try it with pip install c-segment-tree!","archived":false,"fork":false,"pushed_at":"2021-11-20T05:12:17.000Z","size":14,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-07T10:01:33.508Z","etag":null,"topics":["c","python","segment-tree"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/c-segment-tree/","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gilaniasher.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-11-14T20:34:52.000Z","updated_at":"2022-09-17T23:39:22.000Z","dependencies_parsed_at":"2022-11-03T16:00:23.794Z","dependency_job_id":null,"html_url":"https://github.com/gilaniasher/segtree-c-python","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gilaniasher/segtree-c-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilaniasher%2Fsegtree-c-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilaniasher%2Fsegtree-c-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilaniasher%2Fsegtree-c-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilaniasher%2Fsegtree-c-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gilaniasher","download_url":"https://codeload.github.com/gilaniasher/segtree-c-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gilaniasher%2Fsegtree-c-python/sbom","scorecard":{"id":426692,"data":{"date":"2025-08-11","repo":{"name":"github.com/gilaniasher/segtree-c-python","commit":"938a076a4294c64e8f1d0849cfa92afa2162d769"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.3,"checks":[{"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Code-Review","score":0,"reason":"Found 0/7 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":"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":"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":"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":"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":"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":"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":"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":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"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":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v1.0.0 not signed: https://api.github.com/repos/gilaniasher/segtree-c-python/releases/53352977","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/gilaniasher/segtree-c-python/releases/53352977"],"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"}}]},"last_synced_at":"2025-08-19T02:23:05.907Z","repository_id":62565628,"created_at":"2025-08-19T02:23:05.907Z","updated_at":"2025-08-19T02:23:05.907Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413527,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"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":["c","python","segment-tree"],"created_at":"2026-01-14T07:58:02.612Z","updated_at":"2026-01-14T07:58:03.204Z","avatar_url":"https://github.com/gilaniasher.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Segment Tree written in C as a Python Module\nI wanted to learn more about [Segment Trees](https://en.wikipedia.org/wiki/Segment_tree) so I decided to write one in C and make it available as a Python module. My library supports basic min/max/sum queries.\n\n[PyPI Link](https://pypi.org/project/c-segment-tree/)\n\n## Usage\n```\n\u003e from segtree import Segtree\n\u003e obj = Segtree([1, 2, 3, 4, 5], 'sum') # Accepted types: 'sum', 'min', 'max\n\u003e obj.sum(0, 3)                         # Gets range sum of original list in log(n) time\n\u003e obj.update(0, 50)                     # Updates index 0 to value 50 in log(n) time\n```\n\nYou can also use `obj.min` or `obj.max` if you initialized with min/max intead of sum.\n\n## Pip Installation\n```\n$ pip3 install c-segment-tree\n```\n\n## Building and Installing Locally\n\nIf you want to alter the code and try this yourself, this is how you can build/install locally. You may need to run `sudo apt install python3-dev` beforehand.\n\nNavigate into the `src/` directory and we will be using `setup.py` to build and install.\n\nTo build, run:\n```\n$ python3 setup.py build\n```\n\nThis creates a build directory with the compiled C/Python code.\n\nTo install, run:\n```\n$ sudo python3 setup.py install\n```\n\nThis installs the library to your Python3 installation. You can verify that the `segtree` module appears when running `pip list`. Now you should be able to use the `segtree` module in your Python scripts as shown above.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilaniasher%2Fsegtree-c-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgilaniasher%2Fsegtree-c-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgilaniasher%2Fsegtree-c-python/lists"}