{"id":24503680,"url":"https://github.com/dzooli/blacksheep-template","last_synced_at":"2026-04-16T00:32:26.723Z","repository":{"id":236801477,"uuid":"793177660","full_name":"dzooli/blacksheep-template","owner":"dzooli","description":"A simple API backend template using the Blacksheep framework.","archived":false,"fork":false,"pushed_at":"2024-09-30T23:04:22.000Z","size":81,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T15:00:15.892Z","etag":null,"topics":["api","backend","backend-api","blacksheep","python3","rest","rest-api","restful","restful-api"],"latest_commit_sha":null,"homepage":"","language":"CSS","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/dzooli.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}},"created_at":"2024-04-28T16:40:37.000Z","updated_at":"2025-07-28T21:46:06.000Z","dependencies_parsed_at":"2024-07-10T10:17:55.882Z","dependency_job_id":"70df9718-86c9-4671-8f50-72973f429bdc","html_url":"https://github.com/dzooli/blacksheep-template","commit_stats":null,"previous_names":["dzooli/blacksheep-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/dzooli/blacksheep-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzooli%2Fblacksheep-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzooli%2Fblacksheep-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzooli%2Fblacksheep-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzooli%2Fblacksheep-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dzooli","download_url":"https://codeload.github.com/dzooli/blacksheep-template/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dzooli%2Fblacksheep-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31866328,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"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":["api","backend","backend-api","blacksheep","python3","rest","rest-api","restful","restful-api"],"created_at":"2025-01-21T23:18:11.335Z","updated_at":"2026-04-16T00:32:26.698Z","avatar_url":"https://github.com/dzooli.png","language":"CSS","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Blacksheep API template\n\n## Description\n\nA template for Blacksheep-based API with the following features:\n\n- Flexible package manager: [hatch](https://hatch.pypa.io/latest/), poetry or pip\n- Separated requirements.txt files for the app, for development and for documentation.\n- Using environment variables for separated development and production execution\n- Unit-testing setup with working autodiscovery in VSCode\n- Swagger UI on /docs endpoint\n- Path-based API versioning\n- Class-based views and endpoints\n- Response types based on ```dataclasses.dataclass```\n- Fast JSON serializer using [orjson](https://github.com/ijl/orjson)\n- Async template rendering\n- Built-in anti-forgery (commented out in server.py)\n- MkDocs for documentation\n    - Automated source code docstring extraction\n    - API documentation from openapi.json - needs to be saved before\n    - Clear structure\n\n## Usage\n\nEven if using this template is possible with regular pip+virtualenv tool combination I kindly recommend to use ```hatch``` as a more powerful package and task management tool.\n\nOnce ```hatch``` is installed on your Linux (physical, WSL, Docker or VM) environment using this template is very simple. The main tasks are included into ```pyproject.toml``` so you only need the required command to perform these tasks:\n\n- Start dev server\n    ```shell\n    hatch run serve\n    ```\n- Run tests\n    ```shell\n    hatch run test:test\n    ```\n- Run tests with coverage measurement\n    ```shell\n    hatch run test:test-cov\n    ```\n- Generate coverage report (lcov and xml, usable with coverage-gutters VSCode extension)\n    ```shell\n    hatch run test:cov\n    ```\n- Doc development with live reload\n    ```shell\n    hatch run doc:serve\n    ```\n- Build the docs into ./build/docs\n    ```shell\n    hatch run doc:build\n    ```\n- Format check (ruff)\n    ```shell\n    hatch fmt --check\n    ```\n- Formatting\n    ```shell\n    hatch fmt\n    ```\n- Build wheels and sdist packages\n    ```shell\n    hatch build\n    ```\n\n## Debug setup\n\nWith VSCode use the following ```launch.json```:\n\n```json5\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n        {\n            \"name\": \"Python Debugger: Server\",\n            \"type\": \"debugpy\",\n            \"request\": \"launch\",\n            \"program\": \"${workspaceFolder}/src/app/server.py\",\n            \"console\": \"integratedTerminal\",\n            //\"args\": \"${command:pickArgs}\",\n            \"env\": {\n                \"APP_ENV\": \"dev\",\n                \"PYTHONPATH\": \"${workspaceFolder}/src\"\n            }\n        }\n    ]\n}\n```\n\n## Contribution\n\nCreate your fork and submit pull-requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzooli%2Fblacksheep-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdzooli%2Fblacksheep-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdzooli%2Fblacksheep-template/lists"}