{"id":38054038,"url":"https://github.com/dimchat/core-py","last_synced_at":"2026-01-16T20:21:35.152Z","repository":{"id":49765639,"uuid":"166584034","full_name":"dimchat/core-py","owner":"dimchat","description":"Decentralized Instant Messaging Protocol (Python)","archived":false,"fork":false,"pushed_at":"2025-11-29T12:00:58.000Z","size":970,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-01T13:44:13.611Z","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/dimchat.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-01-19T19:18:18.000Z","updated_at":"2025-11-29T12:01:01.000Z","dependencies_parsed_at":"2024-08-29T19:16:49.418Z","dependency_job_id":"ac01a2f0-dd8a-4dee-875f-c5058dcd3d18","html_url":"https://github.com/dimchat/core-py","commit_stats":{"total_commits":137,"total_committers":1,"mean_commits":137.0,"dds":0.0,"last_synced_commit":"9b591843afb3e7d4a2e5364af76a0683eec6301d"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/dimchat/core-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fcore-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fcore-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fcore-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fcore-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dimchat","download_url":"https://codeload.github.com/dimchat/core-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dimchat%2Fcore-py/sbom","scorecard":{"id":343254,"data":{"date":"2025-08-11","repo":{"name":"github.com/dimchat/core-py","commit":"16055551e7ac8fd876c8f2f12c3ad4ab3a7098fa"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":6,"reason":"8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"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":"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":-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 '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-18T06:28:25.766Z","repository_id":49765639,"created_at":"2025-08-18T06:28:25.766Z","updated_at":"2025-08-18T06:28:25.766Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28482267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"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-01-16T20:21:30.551Z","updated_at":"2026-01-16T20:21:35.144Z","avatar_url":"https://github.com/dimchat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Decentralized Instant Messaging Protocol (Python)\n\n[![License](https://img.shields.io/github/license/dimchat/core-py)](https://github.com/dimchat/core-py/blob/master/LICENSE)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/dimchat/core-py/pulls)\n[![Platform](https://img.shields.io/badge/Platform-Python%203-brightgreen.svg)](https://github.com/dimchat/core-py/wiki)\n[![Issues](https://img.shields.io/github/issues/dimchat/core-py)](https://github.com/dimchat/core-py/issues)\n[![Repo Size](https://img.shields.io/github/repo-size/dimchat/core-py)](https://github.com/dimchat/core-py/archive/refs/heads/master.zip)\n[![Tags](https://img.shields.io/github/tag/dimchat/core-py)](https://github.com/dimchat/core-py/tags)\n[![Version](https://img.shields.io/pypi/v/dimp)](https://pypi.org/project/dimp)\n\n[![Watchers](https://img.shields.io/github/watchers/dimchat/core-py)](https://github.com/dimchat/core-py/watchers)\n[![Forks](https://img.shields.io/github/forks/dimchat/core-py)](https://github.com/dimchat/core-py/forks)\n[![Stars](https://img.shields.io/github/stars/dimchat/core-py)](https://github.com/dimchat/core-py/stargazers)\n[![Followers](https://img.shields.io/github/followers/dimchat)](https://github.com/orgs/dimchat/followers)\n\n## Dependencies\n\n| Name | Version | Description |\n|------|---------|-------------|\n| [Ming Ke Ming (名可名)](https://github.com/dimchat/mkm-py) | [![Version](https://img.shields.io/pypi/v/mkm)](https://pypi.org/project/mkm) | Decentralized User Identity Authentication |\n| [Dao Ke Dao (道可道)](https://github.com/dimchat/dkd-py) | [![Version](https://img.shields.io/pypi/v/dkd)](https://pypi.org/project/dkd) | Universal Message Module |\n\n## Examples\n\n### Extends Command\n\n* _Handshake Command Protocol_\n  0. (C-S) handshake start\n  1. (S-C) handshake again with new session\n  2. (C-S) handshake restart with new session\n  3. (S-C) handshake success\n\n```python\nfrom abc import ABC, abstractmethod\nfrom enum import IntEnum\nfrom typing import Optional, Dict\n\nfrom dimp import Command, BaseCommand\n\n\nclass HandshakeState(IntEnum):\n    Start = 0    # C -\u003e S, without session key(or session expired)\n    Again = 1    # S -\u003e C, with new session key\n    Restart = 2  # C -\u003e S, with new session key\n    Success = 3  # S -\u003e C, handshake accepted\n\n\ndef handshake_state(title: str, session: str = None) -\u003e HandshakeState:\n    # Server -\u003e Client\n    if title == 'DIM!':  # or title == 'OK!':\n        return HandshakeState.Success\n    if title == 'DIM?':\n        return HandshakeState.Again\n    # Client -\u003e Server: \"Hello world!\"\n    if session is None or len(session) == 0:\n        return HandshakeState.Start\n    else:\n        return HandshakeState.Restart\n\n\nclass HandshakeCommand(Command, ABC):\n    \"\"\"\n        Handshake Command\n        ~~~~~~~~~~~~~~~~~\n\n        data format: {\n            type : 0x88,\n            sn   : 123,\n\n            command : \"handshake\",    // command name\n            title   : \"Hello world!\", // \"DIM?\", \"DIM!\"\n            session : \"{SESSION_ID}\", // session key\n        }\n    \"\"\"\n    HANDSHAKE = 'handshake'\n\n    @property\n    @abstractmethod\n    def title(self) -\u003e str:\n        raise NotImplemented\n\n    @property\n    @abstractmethod\n    def session(self) -\u003e Optional[str]:\n        raise NotImplemented\n\n    @property\n    @abstractmethod\n    def state(self) -\u003e HandshakeState:\n        raise NotImplemented\n\n    #\n    #   Factories\n    #\n\n    @classmethod\n    def offer(cls, session: str = None) -\u003e Command:\n        \"\"\"\n        Create client-station handshake offer\n\n        :param session: Old session key\n        :return: HandshakeCommand object\n        \"\"\"\n        return BaseHandshakeCommand(title='Hello world!', session=session)\n\n    @classmethod\n    def ask(cls, session: str) -\u003e Command:\n        \"\"\"\n        Create station-client handshake again with new session\n\n        :param session: New session key\n        :return: HandshakeCommand object\n        \"\"\"\n        return BaseHandshakeCommand(title='DIM?', session=session)\n\n    @classmethod\n    def accepted(cls, session: str = None) -\u003e Command:\n        \"\"\"\n        Create station-client handshake success notice\n\n        :return: HandshakeCommand object\n        \"\"\"\n        return BaseHandshakeCommand(title='DIM!', session=session)\n\n    start = offer       # (1. C-\u003eS) first handshake, without session\n    again = ask         # (2. S-\u003eC) ask client to handshake with new session key\n    restart = offer     # (3. C-\u003eS) handshake with new session key\n    success = accepted  # (4. S-\u003eC) notice the client that handshake accepted\n\n\nclass BaseHandshakeCommand(BaseCommand, HandshakeCommand):\n\n    def __init__(self, content: Dict = None, title: str = None, session: str = None):\n        if content is None:\n            # 1. new command with title \u0026 session key\n            assert title is not None, 'handshake command error: %s' % session\n            cmd = self.HANDSHAKE\n            super().__init__(cmd=cmd)\n            self['title'] = title\n            self['message'] = title  # TODO: remove after all clients upgraded\n            if session is not None:\n                self['session'] = session\n        else:\n            # 2. command info from network\n            assert title is None and session is None, 'params error: %s, %s, %s' % (content, title, session)\n            super().__init__(content)\n\n    @property\n    def title(self) -\u003e str:\n        return self.get_str(key='title', default='')\n\n    @property\n    def session(self) -\u003e Optional[str]:\n        return self.get_str(key='session')\n\n    @property\n    def state(self) -\u003e HandshakeState:\n        return handshake_state(title=self.title, session=self.session)\n```\n\n### Extends Content\n\n```python\nfrom typing import Any, Dict\n\nfrom dimp import *\n\n\nclass ApplicationContent(BaseContent, AppContent):\n    \"\"\"\n        Application Customized message\n        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n        data format: {\n            type : i2s(0xA0),\n            sn   : 123,\n\n            app   : \"{APP_ID}\",  // application (e.g.: \"chat.dim.sechat\")\n            extra : info         // action parameters\n        }\n    \"\"\"\n\n    def __init__(self, content: Dict[str, Any] = None,\n                 msg_type: str = None, app: str = None):\n        if content is None:\n            # 1. new content with type, app_id\n            assert app is not None, 'customized content error: %s, %s' % (msg_type, app)\n            if msg_type is None:\n                msg_type = ContentType.APPLICATION\n            super().__init__(None, msg_type)\n            self['app'] = app\n        else:\n            # 2. content info from network\n            assert msg_type is None and app is None, 'params error: %s, %s, %s' % (content, msg_type, app)\n            super().__init__(content)\n\n    @property  # Override\n    def application(self) -\u003e str:\n        return self.get_str(key='app', default='')\n```\n\n### Extends ID Address\n\n* Examples in [dim plugins](https://pypi.org/project/dimplugins)\n\n----\n\nCopyright \u0026copy; 2018-2025 Albert Moky\n[![Followers](https://img.shields.io/github/followers/moky)](https://github.com/moky?tab=followers)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimchat%2Fcore-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdimchat%2Fcore-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdimchat%2Fcore-py/lists"}