{"id":43209315,"url":"https://github.com/strahe/sanic-redis","last_synced_at":"2026-02-01T07:14:26.218Z","repository":{"id":57463861,"uuid":"95067372","full_name":"strahe/sanic-redis","owner":"strahe","description":"Adds redis support to sanic","archived":false,"fork":false,"pushed_at":"2025-06-20T06:57:23.000Z","size":41,"stargazers_count":51,"open_issues_count":0,"forks_count":13,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-01T03:43:33.597Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/strahe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-06-22T02:43:42.000Z","updated_at":"2025-06-20T06:53:48.000Z","dependencies_parsed_at":"2024-06-19T15:44:27.332Z","dependency_job_id":"410471c5-29a3-4ffa-990d-674dd03b8d6a","html_url":"https://github.com/strahe/sanic-redis","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/strahe/sanic-redis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strahe%2Fsanic-redis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strahe%2Fsanic-redis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strahe%2Fsanic-redis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strahe%2Fsanic-redis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/strahe","download_url":"https://codeload.github.com/strahe/sanic-redis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/strahe%2Fsanic-redis/sbom","scorecard":{"id":854609,"data":{"date":"2025-08-11","repo":{"name":"github.com/strahe/sanic-redis","commit":"07eada427542ad7e06d8439a99963f231813c18b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"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":1,"reason":"Found 3/17 approved changesets -- score normalized to 1","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":0,"reason":"1 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":"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: topLevel 'contents' permission set to 'read': .github/workflows/python-publish.yml:16","Warn: no topLevel permission defined: .github/workflows/test.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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/python-publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-publish.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:51: update your workflow using https://app.stepsecurity.io/secureworkflow/strahe/sanic-redis/test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:22","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:57","Warn: pipCommand not pinned by hash: .github/workflows/test.yml:58","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   5 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":"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: 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":"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":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/python-publish.yml:41"],"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":"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"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-8cw9-5hmv-77w6","Warn: Project is vulnerable to: PYSEC-2017-40 / GHSA-mpmf-hr8p-p49g"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 10 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-23T23:32:08.053Z","repository_id":57463861,"created_at":"2025-08-23T23:32:08.053Z","updated_at":"2025-08-23T23:32:08.053Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28971777,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-01T06:46:42.625Z","status":"ssl_error","status_checked_at":"2026-02-01T06:44:56.173Z","response_time":56,"last_error":"SSL_read: 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-02-01T07:14:25.623Z","updated_at":"2026-02-01T07:14:26.208Z","avatar_url":"https://github.com/strahe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"sanic-redis\n==============\n\n[![Tests](https://github.com/strahe/sanic-redis/workflows/Tests/badge.svg)](https://github.com/strahe/sanic-redis/actions)\n\nAsync Redis support for sanic.\n\nBuilt on top of Async version of [Redis library](https://redis-py.readthedocs.io/en/stable/examples/asyncio_examples.html).\n\n[HiRedis](https://github.com/redis/hiredis-py) is used by default for parsing the read results for a higher performance.\n\nInstallation\n------------\n\nYou can install this package as usual with pip:\n\n    pip install sanic-redis\n\nConfig\n-----------\nFor example:\n```\nredis://[[username]:[password]]@localhost:6379/0\nrediss://[[username]:[password]]@localhost:6379/0\nunix://[username@]/path/to/socket.sock?db=0[\u0026password=password]\n```\n\nThree URL schemes are supported:\n  - `redis://` creates a TCP socket connection. See more at:\n    \u003chttps://www.iana.org/assignments/uri-schemes/prov/redis\u003e\n  - `rediss://` creates a SSL wrapped TCP socket connection. See more at:\n    \u003chttps://www.iana.org/assignments/uri-schemes/prov/rediss\u003e\n  - ``unix://``: creates a Unix Domain Socket connection.\n\nDetails:\nhttps://github.com/redis/redis-py/blob/0d0cfe66eaa541dfc078398f37277e5de8d11dc8/redis/client.py#L132-L168\n\nAll allow querystring options:\n```\n{\n    \"db\": int,\n    \"socket_timeout\": float,\n    \"socket_connect_timeout\": float,\n    \"socket_keepalive\": to_bool,\n    \"retry_on_timeout\": to_bool,\n    \"retry_on_error\": list,\n    \"max_connections\": int,\n    \"health_check_interval\": int,\n    \"ssl_check_hostname\": to_bool,\n    \"timeout\": float,\n}\n```\nDetails:\nhttps://github.com/redis/redis-py/blob/0d0cfe66eaa541dfc078398f37277e5de8d11dc8/redis/connection.py#L1235-L1246\n\nExample\n------------\n\n```python\nfrom sanic import Sanic\nfrom sanic.response import text\nfrom sanic_redis import SanicRedis\n\napp = Sanic(__name__)\n\napp.config.update(\n    {\n        'REDIS': \"redis://localhost:6379/0\",\n        'REDIS1': \"redis://localhost:6379/1\",\n        'REDIS2': \"redis://localhost:6379/2\",\n    }\n)\n\nredis = SanicRedis() # default config_name is \"REDIS\"\nredis.init_app(app)\n\nredis1 = SanicRedis(config_name=\"REDIS1\")\nredis1.init_app(app)\n\nredis2 = SanicRedis(config_name=\"REDIS2\")\nredis2.init_app(app)\n\n\n@app.route('/test1')\nasync def test1(request):\n    async with redis1.conn as r:\n        await r.set(\"key1\", \"value1\")\n        result = await r.get(\"key1\")\n    return text(str(result))\n\n\n@app.route('/test2')\nasync def test2(request):\n    r = request.app.ctx.redis\n    await r.set('key2', 'value2')\n    result = await r.get('key2')\n    return text(str(result))\n\n\n@app.route('/test3')\nasync def test3(request):\n    # request.app.ctx.{redis_name}, the {redis_name} == config_name.lower()\n    async with request.app.ctx.redis1 as r:\n        await r.set('key3', 'value3')\n        result = await r.get('key3')\n    return text(str(result))\n\n\nif __name__ == '__main__':\n    app.run(debug=True)\n\n```\n\nTesting\n-------\n\n```bash\npip install -e .[test]\ndocker-compose -f docker-compose.test.yml up -d\npytest tests/\ndocker-compose -f docker-compose.test.yml down\n```\n\nResources\n---------\n\n- [PyPI](https://pypi.python.org/pypi/sanic-redis)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrahe%2Fsanic-redis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstrahe%2Fsanic-redis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstrahe%2Fsanic-redis/lists"}