{"id":18356679,"url":"https://github.com/aaravmalani/plugapi","last_synced_at":"2025-08-13T20:11:44.221Z","repository":{"id":75037622,"uuid":"605210715","full_name":"AaravMalani/PlugAPI","owner":"AaravMalani","description":"A lightweight, speedy HTTP(S) framework","archived":false,"fork":false,"pushed_at":"2023-04-08T09:53:55.000Z","size":29,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-07T11:11:10.492Z","etag":null,"topics":["api","api-rest","collaborate","framework","github-pages","http","https","json","middleware","python","python3","server","web"],"latest_commit_sha":null,"homepage":"https://aaravmalani.github.io/PlugAPI/","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/AaravMalani.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":"CONTRIBUTING.md","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}},"created_at":"2023-02-22T17:21:33.000Z","updated_at":"2023-03-01T13:48:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"9b5fbda5-3a8e-4a53-8d38-42591638a8d7","html_url":"https://github.com/AaravMalani/PlugAPI","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"2e0dfe7c7f9463f4d2122194cbea003c1c937687"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AaravMalani/PlugAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2FPlugAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2FPlugAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2FPlugAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2FPlugAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AaravMalani","download_url":"https://codeload.github.com/AaravMalani/PlugAPI/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AaravMalani%2FPlugAPI/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270305630,"owners_count":24562087,"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-08-13T02:00:09.904Z","response_time":66,"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":["api","api-rest","collaborate","framework","github-pages","http","https","json","middleware","python","python3","server","web"],"created_at":"2024-11-05T22:11:10.042Z","updated_at":"2025-08-13T20:11:44.172Z","avatar_url":"https://github.com/AaravMalani.png","language":"Python","readme":"PlugAPI : A lightweight, speedy HTTP(S) server\n==============================================\n\nRequirements\n------------\n\n-  Python 3.6 \u003e=\n\nUsage\n-----\n\n.. code:: py\n\n   from plugapi import Server, JSONResponse, json_middleware\n\n   server = Server(443, https=True, certfile='./localhost.pem', keyfile='./localhost-key.pem') \n   @server.handler(path='/')\n   def root(req):\n       return JSONResponse({'a': 'b'})\n\n   \n   server.add_middlewares(json_middleware)\n   server.run()\n\nFeatures\n--------\n\n-  Middleware Middleware are functions accepting the socket, HTTP type,\n   headers and body and returning a changed headers and body before the\n   handlers are called They can be added using\n   ``server.add_middlewares(middleware, middleware2, ....)`` For\n   example, the default JSON middleware is given below\n\n   .. code-block:: py\n\n     def json_middleware(socket: socket.socket, type: str, headers: dict[str, str], body: str | list | dict) -\u003e tuple[dict[str, str], str | list | dict]:\n          if headers.get(\"Content-Type\", None) == \"application/json\":             \n          body = json.loads(body)         \n          return headers, body``\n   There are numerous built-in middlewares including\n   ``multipart_middleware``, ``url_encoded_middleware``,\n   ``cookie_middleware`` and more!\n-  Different utility responses Responses like ``FileResponse``,\n   ``JSONResponse`` and ``HTMLResponse`` are pre-provided to allow you\n   to return data without having to set the content type\n\nTo-Do\n-----\n\n-  ☐ Websocket support\n-  ☑ Parameters in paths\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaravmalani%2Fplugapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaravmalani%2Fplugapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaravmalani%2Fplugapi/lists"}