{"id":32806556,"url":"https://github.com/leozz37/kangaroo","last_synced_at":"2025-11-06T14:01:54.257Z","repository":{"id":62573711,"uuid":"311001061","full_name":"leozz37/kangaroo","owner":"leozz37","description":"🦘 User-friendly socket lib for Python","archived":false,"fork":false,"pushed_at":"2020-12-07T03:49:07.000Z","size":55,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-15T03:52:17.757Z","etag":null,"topics":["kangaroo","messaging","python","socket","socket-io"],"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/leozz37.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":"SECURITY.md","support":null}},"created_at":"2020-11-08T06:34:33.000Z","updated_at":"2020-12-07T03:49:09.000Z","dependencies_parsed_at":"2022-11-03T17:30:31.595Z","dependency_job_id":null,"html_url":"https://github.com/leozz37/kangaroo","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/leozz37/kangaroo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leozz37%2Fkangaroo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leozz37%2Fkangaroo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leozz37%2Fkangaroo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leozz37%2Fkangaroo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leozz37","download_url":"https://codeload.github.com/leozz37/kangaroo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leozz37%2Fkangaroo/sbom","scorecard":{"id":585395,"data":{"date":"2025-08-18","repo":{"name":"github.com/leozz37/kangaroo","commit":"e3e21a872630d94c2b1211085e2d664fca548195"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":4.7,"checks":[{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/codeql-analysis.yml:1","Warn: no topLevel permission defined: .github/workflows/python-app.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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"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/codeql-analysis.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:53: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/codeql-analysis.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/codeql-analysis.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/python-app.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/python-app.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/python-app.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/python-app.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-app.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/leozz37/kangaroo/python-app.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:21","Warn: pipCommand not pinned by hash: .github/workflows/python-app.yml:22","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned","Info:   0 out of   2 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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":10,"reason":"SAST tool detected: CodeQL","details":["Info: SAST configuration detected: CodeQL","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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}},{"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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/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/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-20T20:21:45.419Z","repository_id":62573711,"created_at":"2025-08-20T20:21:45.419Z","updated_at":"2025-08-20T20:21:45.419Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283019357,"owners_count":26765637,"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-11-06T02:00:06.180Z","response_time":55,"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":["kangaroo","messaging","python","socket","socket-io"],"created_at":"2025-11-06T14:01:15.600Z","updated_at":"2025-11-06T14:01:54.252Z","avatar_url":"https://github.com/leozz37.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kangaroo Sockets 🦘\n\n![Unit Tests](https://github.com/leozz37/kangaroo/workflows/Unit%20Tests/badge.svg)\n[![codecov](https://codecov.io/gh/leozz37/kangaroo/branch/main/graph/badge.svg?token=9MbL9uMi8u)](https://codecov.io/gh/leozz37/kangaroo)\n[![Maintainability](https://api.codeclimate.com/v1/badges/5b4ee1430037ca66735e/maintainability)](https://codeclimate.com/github/leozz37/kangaroo/maintainability)\n[![Release](https://img.shields.io/github/v/release/leozz37/kangaroo)](https://github.com/leozz37/kangaroo/releases)\n[![PyPI version](https://badge.fury.io/py/kangaroo-sockets.svg)](https://badge.fury.io/py/kangaroo-sockets)\n[![License](https://img.shields.io/github/license/pytransitions/transitions.svg)](LICENSE)\n\u003c!-- [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit\u0026logoColor=white\u0026style=flat-square)](https://github.com/pre-commit/pre-commit)\n[![code style: black](https://img.shields.io/static/v1?label=code%20style\u0026message=black\u0026color=black\u0026style=flat-square)](https://github.com/psf/black)--\u003e\n\nKangaroo is a user-friendly lib for sockets in Python. You can send and listen to TCP sockets with a few lines of code.\n\n## Contents\n\n- [Installation](#installation)\n- [Quick start](#quick-start)\n- [Documentation](#documentation)\n- [Examples](#examples)\n- [Development](#development)\n- [Testing](#testing)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\n\nFirst you need [Python](https://www.python.org/) installed (version 3.6+ is required), then you can install Kangaroo:\n\n```shell\n$ pip install kangaroo-sockets\n```\n\nImport it ib your code:\n\n```Python\nimport Kangaroo\n```\n\n(Optional) install [Jaguar](https://github.com/leozz37/jaguar) for testing the sockets:\n\n```shell\n$ brew tap leozz37/jaguar\n\n$ brew install jaguar\n```\n\n## Quick start\n\nSample code for sending and listening to a port:\n\n```python\nfrom src.kangaroo import Kangaroo\nimport threading\nimport time\n\n\ndef listen_port(port: int):\n    r = Kangaroo().listen(port)\n\n    while True:\n        if r.has_new_message():\n            print(r.get_message())\n\n\nif __name__ == '__main__':\n    x = threading.Thread(target=listen_port, args=(3000,))\n    y = threading.Thread(target=listen_port, args=(3001,))\n\n    x.start()\n    y.start()\n\n    while True:\n        Kangaroo().send(3000, \"Hello\")\n        Kangaroo().send(3001, \"World\")\n        time.sleep(1)\n```\n\n## Documentation\n\nThe library consists on two features: listen and send to a given port. You can check the full documentation on pypi.\n\n---\n\n### Listen\n\nReceives a **port** as `int` and returns a Kangaroo instance.\n\n```python\ndef listen(self, port: int):\n```\n\nUsage example:\n\n```python\nkangaroo = Kangaroo()\n\nr = kangaroo.listen(3000)\nl = kangaroo.listen(3001)\n```\n\n---\n\n### Send\n\nReceives a **port** and a **message**, both as `string`.\n\n```python\ndef send(self, port: int, message: str) -\u003e None:\n```\n\nUsage example:\n\n```python\nkangaroo = Kangaroo()\n\nr = kangaroo.listen(3000)\nkangaroo.send(3000, \"Hello, World!\")\n```\n\n### Messages\n\n`has_new_messages()` returns a `bool` if there's a new message:\n\n```python\ndef has_new_message(self) -\u003e bool:\n```\n\n`get_message()` returns the last message as `str`:\n\n````python\ndef get_message(self) -\u003e str:\n````\n\nUsage example:\n\n````python\nimport Kangaroo\n\n\nif __name__ == '__main__':\n    kangaroo = Kangaroo()\n\n    r = kangaroo.listen(3000)\n    kangaroo.send(3000, \"Hello world\")\n\n    if r.has_new_message():\n        print(r.get_message())\n````\n\n## Development\n\nThis project uses **pipenv** and **pre-commit** in order to run some static\nchecks and formatting on the code. After clone the repository you need to create\na new **virtual environment** and install the dependencies:\n\n```shell\n$ pipenv shell\n\n$ pipenv install --dev --skip-lock\n\n$ pre-commit install\n```\n\nEvery time you run the ```git commit``` command the code will be checked. To\nrun the checking manually, run:\n\n```shell\n$ pre-commit run --all-files\n```\n\n## Testing\n\nThe tests uses the pytest framework. To run the test suit with coverage you can do the following:\n\n```shell\n$ pytest --cov=. -v\n\n============================================================================================================================ test session starts ============================================================================================================================\nplatform darwin -- Python 3.8.2, pytest-6.1.2, py-1.9.0, pluggy-0.13.1 -- /Library/Developer/CommandLineTools/usr/bin/python3\ncachedir: .pytest_cache\nrootdir: /Users/leo/Documents/codes/kangaroo\nplugins: cov-2.10.1\ncollected 4 items\n\ntests/kangaroo_test.py::test_send_with_success PASSED                                                                                                                                                                                                                 [ 25%]\ntests/kangaroo_test.py::test_listen_with_success PASSED                                                                                                                                                                                                               [ 50%]\ntests/kangaroo_test.py::test_get_message_fails PASSED                                                                                                                                                                                                                 [ 75%]\ntests/kangaroo_test.py::test_has_new_message_fails PASSED                                                                                                                                                                                                             [100%]\n\n---------- coverage: platform darwin, python 3.8.2-final-0 -----------\nName                     Stmts   Miss  Cover\n--------------------------------------------\n__init__.py                  3      0   100%\nsetup.py                     4      4     0%\nsrc/__init__.py              0      0   100%\nsrc/kangaroo.py             31      0   100%\ntests/__init__.py            0      0   100%\ntests/kangaroo_test.py      23      0   100%\n--------------------------------------------\nTOTAL                       61      4    93%\n```\n\n## Contributing\n\nA full guideline about contributing to Kangaroo can be found in the [CONTRIBUTING.md](./CONTRIBUTING.md) file.\n\n## License\n\nHare is released under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleozz37%2Fkangaroo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleozz37%2Fkangaroo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleozz37%2Fkangaroo/lists"}