{"id":49405919,"url":"https://github.com/avrae/draconic","last_synced_at":"2026-04-28T21:09:27.397Z","repository":{"id":40462439,"uuid":"246106805","full_name":"avrae/draconic","owner":"avrae","description":"The Draconic language: a scripting language based off Python to run user scripts on the server safely.","archived":false,"fork":false,"pushed_at":"2023-04-26T17:56:06.000Z","size":190,"stargazers_count":18,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-02T06:12:22.343Z","etag":null,"topics":["interpreter","language","python","user-script"],"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/avrae.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":"2020-03-09T18:02:37.000Z","updated_at":"2024-02-11T17:32:41.000Z","dependencies_parsed_at":"2023-02-14T10:31:31.271Z","dependency_job_id":null,"html_url":"https://github.com/avrae/draconic","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/avrae/draconic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrae%2Fdraconic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrae%2Fdraconic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrae%2Fdraconic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrae%2Fdraconic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/avrae","download_url":"https://codeload.github.com/avrae/draconic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/avrae%2Fdraconic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32399228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T19:38:08.556Z","status":"ssl_error","status_checked_at":"2026-04-28T19:37:55.688Z","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":["interpreter","language","python","user-script"],"created_at":"2026-04-28T21:09:25.034Z","updated_at":"2026-04-28T21:09:27.384Z","avatar_url":"https://github.com/avrae.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# draconic\n\nThe Draconic scripting language, designed to allow a safe in-memory runtime for user scripting with bindings to\nnative APIs hosted in the parent application.\n\nRequires Python 3.8+.\n\n## Notable Differences from Python\n\nThe Draconic language is based on, and implemented in, the CPython implementation of the Python language. However, there\nare a number of notable differences between Draconic and Python:\n\n### In-Place Operator Unfurling\n\nIn Python, in-place operators (e.g. `a += 1`) are handled differently from binary operators and assignments (\ne.g. `a = a + 1`). In Draconic, all in-place operators are unfurled to their binary-operator equivalent. In most cases\nthis does not create a semantic difference, except in the following cases:\n\n#### Dict/Set Union Operations\n\n**Python**\n\n```pycon\n\u003e\u003e\u003e a = {\"a\": 1, \"b\": 2}\n\u003e\u003e\u003e b = {\"b\": 3, \"c\": 4}\n\u003e\u003e\u003e a_reference = a\n\n\u003e\u003e\u003e a |= b\n\u003e\u003e\u003e a\n{\"a\": 1, \"b\": 3, \"c\": 4}\n\u003e\u003e\u003e a_reference\n{\"a\": 1, \"b\": 3, \"c\": 4}\n\u003e\u003e\u003e a is a_reference\nTrue\n```\n\n**Draconic**\n\n```pycon\n\u003e\u003e\u003e a = {\"a\": 1, \"b\": 2}\n\u003e\u003e\u003e b = {\"b\": 3, \"c\": 4}\n\u003e\u003e\u003e a_reference = a\n\n\u003e\u003e\u003e a |= b\n\u003e\u003e\u003e a\n{\"a\": 1, \"b\": 3, \"c\": 4}\n\u003e\u003e\u003e a_reference\n{\"a\": 1, \"b\": 2}\n\u003e\u003e\u003e a is a_reference\nFalse\n```\n\nUse `dict.update()` or `set.update()` instead for an in-place operation.\n\n#### Function Nonlocal References\n\n**Python**\n\n```pycon\n\u003e\u003e\u003e a = 1\n\u003e\u003e\u003e def incr_locally():\n...     a += 1\n...     return a\n\u003e\u003e\u003e incr_locally()\nUnboundLocalError: local variable 'a' referenced before assignment\n```\n\n**Draconic**\n\n```pycon\n\u003e\u003e\u003e a = 1\n\u003e\u003e\u003e def incr_locally():\n...     a += 1\n...     return a\n\u003e\u003e\u003e incr_locally()\n2\n```\n\n### Unequal Patma Bindings\n\nWhile Python checks that all bindings in a pattern matching case with multiple options are the same across all branches,\nDraconic does not do any such check.\n\n**Python**\n\n```pycon\n\u003e\u003e\u003e a = 1\n\u003e\u003e\u003e match a:\n...     case (1 as one) | (2 as two):\n...         print(one)\nSyntaxError: alternative patterns bind different names\n```\n\n**Draconic**\n\n```pycon\n\u003e\u003e\u003e a = 1\n\u003e\u003e\u003e match a:\n...     case (1 as one) | (2 as two):\n...         print(one)\n1\n```\n\n### Function Dunder Attributes\n\nAs access to `__dunder__` attributes is not allowed in Draconic, the `function.__name__` and `function.__doc__` \nattributes are exposed as `function.name` and `function.doc` instead.\n\n**Python**\n\n```pycon\n\u003e\u003e\u003e def foo():\n...     \"\"\"I am foo\"\"\"\n...     pass\n\u003e\u003e\u003e print(foo.__name__)\nfoo\n\u003e\u003e\u003e print(foo.__doc__)\nI am foo\n```\n\n**Draconic**\n\n```pycon\n\u003e\u003e\u003e def foo():\n...     \"\"\"I am foo\"\"\"\n...     pass\n\u003e\u003e\u003e print(foo.name)\nfoo\n\u003e\u003e\u003e print(foo.doc)\nI am foo\n```\n\n### Try/Except\n\nAs Draconic currently has no user-defined class implementation, it is impossible to provide a type by name to an \n`except` clause. Instead, Draconic requires `except` clause types to be a string literal or tuple of string literals.\nThese are matched against the name of the exception, with no subclass checking.\n\n**Python**\n\n```pycon\n\u003e\u003e\u003e try:\n...     1/0\n... except Exception:\n...     print(\"I catch all exceptions!\")\n... except ZeroDivisionError:\n...     print(\"You divided by zero!\")\nI catch all exceptions!\n```\n\n**Draconic**\n\n```pycon\n\u003e\u003e\u003e try:\n...     1/0\n... except \"Exception\":\n...     print(\"I catch all exceptions!\")\n... except \"ZeroDivisionError\":\n...     print(\"You divided by zero!\")\nYou divided by zero!\n```\n\n### Starred Unpacking\n\nAssigning to a starred variable outside of a tuple or list in Python throws a `SyntaxError`, but is valid in Draconic\n\n**Python**\n\n```pycon\n\u003e\u003e\u003e *a = [1, 2, 3]\nSyntaxError: starred assignment target must be in a list or tuple\n```\n\n**Draconic**\n\n```pycon\n\u003e\u003e\u003e *a = [1, 2, 3]\n\u003e\u003e\u003e a\n[1, 2, 3]\n```\n\nThis has syntactical equivalents in Python:\n\n```pycon\n\u003e\u003e\u003e *a, = [1, 2, 3]\n\u003e\u003e\u003e [*b] = [1, 2, 3]\n\u003e\u003e\u003e (*c,) = [1, 2, 3]\n\u003e\u003e\u003e assert a == b == c == [1, 2, 3]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrae%2Fdraconic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favrae%2Fdraconic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favrae%2Fdraconic/lists"}