{"id":48611082,"url":"https://github.com/litements/litecounter","last_synced_at":"2026-04-09T00:34:29.248Z","repository":{"id":62576403,"uuid":"336793791","full_name":"litements/litecounter","owner":"litements","description":"Just count things","archived":false,"fork":false,"pushed_at":"2021-08-07T11:27:23.000Z","size":16,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-01T04:59:25.322Z","etag":null,"topics":["counter","python","sqlite"],"latest_commit_sha":null,"homepage":"https://litements.polyrand.net/counter/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/litements.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":"2021-02-07T13:29:58.000Z","updated_at":"2023-07-13T18:55:02.000Z","dependencies_parsed_at":"2022-11-03T17:36:54.710Z","dependency_job_id":null,"html_url":"https://github.com/litements/litecounter","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/litements/litecounter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litements%2Flitecounter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litements%2Flitecounter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litements%2Flitecounter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litements%2Flitecounter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/litements","download_url":"https://codeload.github.com/litements/litecounter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/litements%2Flitecounter/sbom","scorecard":{"id":592711,"data":{"date":"2025-08-11","repo":{"name":"github.com/litements/litecounter","commit":"eda9c1450ed56963bf026fc66bc7b9e8126baaa2"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"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":"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":"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":"Code-Review","score":0,"reason":"Found 0/13 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":"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: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi-publish.yaml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/litements/litecounter/pypi-publish.yaml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pypi-publish.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/litements/litecounter/pypi-publish.yaml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pypi-publish.yaml:29: update your workflow using https://app.stepsecurity.io/secureworkflow/litements/litecounter/pypi-publish.yaml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/pypi-publish.yaml:15","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/pypi-publish.yaml: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":"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: 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":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"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-20T22:22:47.741Z","repository_id":62576403,"created_at":"2025-08-20T22:22:47.741Z","updated_at":"2025-08-20T22:22:47.741Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31580182,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"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":["counter","python","sqlite"],"created_at":"2026-04-09T00:34:29.106Z","updated_at":"2026-04-09T00:34:29.232Z","avatar_url":"https://github.com/litements.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# litecounter\n\n\u003e Very simple counter implemented on top of SQLite\n\n## Why?\n\nYou can use this to implement a persistent counter. It also uses some SQLite syntax to initialize keys to `0` when the counter starts on them, just as if you had a `collections.defaultdict` where the default is `0`.\n\n## Installation\n\n```\npip install litecounter\n```\n\n**IMPORTANT**: This package uses SQLite's [UPSERT](https://sqlite.org/lang_upsert.html) statment so it needs to run at least with SQLite version 3.24.0 (released 2018-06-04).\n\nIf you need to run the latest version, you can use [pysqlite3](https://github.com/coleifer/pysqlite3).\n\nAll the litements libraries (including this one) accept either a filename or an already created sqlite connection. Apart from that, if you have pysqlite3 installed it will use that instead of the sqlite3 module from the standard library.\n\n## Examples\n\nThe examples are taken from the tests in [`tests.ipynb`](./tests.ipynb)\n\n\n```python\n\nTEST_1 = \"key_test_1\"\nTEST_2 = \"key_test_2\"\n\nfrom litecounter import SQLCounter\n\ncounter = SQLCounter(\":memory:\")\n\n# Increment from 0 to 20\n\nfor _ in range(20):\n    counter.incr(TEST_1)\n    \nassert counter.count(TEST_1) == 20\n\n# Decrement 10 (from 20 to 10)\n\nfor _ in range(10):\n    counter.decr(TEST_1)\n    \nassert counter.count(TEST_1) == 10\n\n# From 0 to -10, then -20.\n\nfor _ in range(10):\n    counter.decr(TEST_2)\n    \nassert counter.count(TEST_2) == -10\n\nfor _ in range(10):\n    counter.decr(TEST_2)\n    \nassert counter.count(TEST_2) == -20\n\n# Set fist key to 0.\n\ncounter.zero(TEST_1)\n\nassert counter.count(TEST_1) == 0\n\n# Increment the second test key by 100, from -20 to 80.\n\nfor _ in range(100):\n    counter.incr(TEST_2)\n    \nassert counter.count(TEST_2) == 80\n\n# Delete key works\n\nassert counter.count(TEST_1) == 0\n\ncounter.delete(TEST_1)\n\nassert counter.count(TEST_1) is None\n\n# When the key does not exist, delete just ignores it\n\ncounter.delete(\"foobar\")\n\n# Check `__repr__`\n\nimport random\n\nfor key in [\"foo\", \"bar\", \"baz\", \"foobar\", \"asd\", TEST_1]:\n    for _ in range(random.randint(0,10)):\n        counter.incr(key)\n\nprint(counter)\n\n# SQLCounter(dbname=':memory:', items=[('key_test_2', 80), ('foo', 8), ('baz', 5), ('foobar', 6), ('key_test_1', 10)])\n```\n\n    \n## Meta\n\n\nRicardo Ander-Egg Aguilar – [@ricardoanderegg](https://twitter.com/ricardoanderegg) –\n\n- [ricardoanderegg.com](http://ricardoanderegg.com/)\n- [github.com/polyrand](https://github.com/polyrand/)\n- [linkedin.com/in/ricardoanderegg](http://linkedin.com/in/ricardoanderegg)\n\nDistributed under the MIT license. See ``LICENSE`` for more information.\n\n## Contributing\n\nThe only hard rules for the project are:\n\n* No extra dependencies allowed\n* No extra files, everything must be inside the main module's `.py` file.\n* Tests must be inside the `tests.ipynb` notebook.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitements%2Flitecounter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flitements%2Flitecounter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flitements%2Flitecounter/lists"}