{"id":16039742,"url":"https://github.com/mnot/thor","last_synced_at":"2025-12-24T03:56:20.246Z","repository":{"id":652732,"uuid":"1893140","full_name":"mnot/thor","owner":"mnot","description":"Easy Evented Intermediation","archived":false,"fork":false,"pushed_at":"2024-07-22T15:19:13.000Z","size":651,"stargazers_count":115,"open_issues_count":32,"forks_count":8,"subscribers_count":10,"default_branch":"main","last_synced_at":"2024-10-09T23:07:09.495Z","etag":null,"topics":["python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mnot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2011-06-14T07:36:55.000Z","updated_at":"2024-07-22T15:19:16.000Z","dependencies_parsed_at":"2024-01-23T00:24:04.299Z","dependency_job_id":"825ad444-e829-4199-b1bd-8448bc10b4c2","html_url":"https://github.com/mnot/thor","commit_stats":{"total_commits":538,"total_committers":2,"mean_commits":269.0,"dds":"0.0037174721189591198","last_synced_commit":"b5770b2e6757aa6615420b716eb3dfc83158eaac"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnot%2Fthor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnot%2Fthor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnot%2Fthor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mnot%2Fthor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mnot","download_url":"https://codeload.github.com/mnot/thor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248045231,"owners_count":21038553,"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","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":["python"],"created_at":"2024-10-08T23:07:21.108Z","updated_at":"2025-12-24T03:56:20.239Z","avatar_url":"https://github.com/mnot.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Thor\n\n[![CI](https://github.com/mnot/thor/actions/workflows/ci.yml/badge.svg)](https://github.com/mnot/thor/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/mnot/thor/badge.svg)](https://coveralls.io/r/mnot/thor)\n\n## About Thor\n\nThor is yet another [Python 3](https://python.org/) library for evented IO.\n\nThere are many such libraries for Python already available. Thor focuses on making it easy to build\nhigh-performance HTTP intermediaries like proxies, load balancers, content transformation engines\nand service aggregators. Of course, you can use it just as a client or server too.\n\nIt aims to be as fast as possible, to implement the protocols correctly, and to be simple. You can\nhelp meet these goals by contributing issues, patches and tests.\n\nThor’s EventEmitter API is influenced by^H^H^H copied from NodeJS; if you’re familiar with Node, it\nshouldn’t be too hard to use Thor. However, Thor is nothing like Twisted; this is considered a\nfeature.\n\nCurrently, Thor has an event loop as well as TCP, UDP and HTTP APIs (client and server). New APIs\n(e.g., DNS) and capabilities should be arriving soon, along with a framework for intermediation.\n\n## Requirements\n\nThor just requires a current version of Python.\n\nCurrently, it will run on most Posix platforms; specifically, those that offer one of `poll`,\n`epoll` or `kqueue`.\n\n## Installation\n\nUsing pip:\n\n\u003e pip install thor\n\nOn some operating systems, that might be `pip3`. Otherwise, download a tarball and install using:\n\n\u003e python setup.py install\n\n## Using Thor\n\nThe [documentation](https://github.com/mnot/thor/tree/master/doc) is a good starting point; see\nalso the docstrings for the various modules, as well as the tests, to give an idea of how to use\nThor.\n\nFor example, a very simple HTTP server looks like this:\n\n```python\nimport thor, thor.http\ndef test_handler(exch):\n    @thor.events.on(exch)\n    def request_start(*args):\n        exch.response_start(200, \"OK\", [('Content-Type', 'text/plain')])\n        exch.response_body('Hello, world!')\n        exch.response_done([])\n\nif __name__ == \"__main__\":\n    demo_server = thor.http.HttpServer('127.0.0.1', 8000)\n    demo_server.on('exchange', test_handler)\n    thor.run()\n```\n\n## Support and Contributions\n\nSee [Thor's GitHub](http://github.com/mnot/thor/) to give feedback, view and [report\nissues](https://github.com/mnot/thor/issues), and contribute code.\n\nAll helpful input is welcome, particularly code contributions via a pull request (with test cases).\n\n## Why Thor?\n\nThor is not only “a hammer-wielding god associated with thunder, lightning, storms, oak trees,\nstrength, destruction, fertility, healing, and the protection of mankind”, he’s also my Norwegian\nForest Cat.\n\nThor (the software program) grew out of nbhttp, which itself came from earlier work on evented\nPython in [redbot](http://redbot.org/).\n\nThor (the cat) now rules our house with a firm but benevolent paw. He gets sick if we give him any\nmilk, though.\n\n![Thor, the cat](https://www.mnot.net/lib/thor.jpg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnot%2Fthor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmnot%2Fthor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmnot%2Fthor/lists"}