{"id":15603700,"url":"https://github.com/vochicong/py-api-log-test","last_synced_at":"2026-05-18T02:32:05.573Z","repository":{"id":150086177,"uuid":"292845383","full_name":"vochicong/py-api-log-test","owner":"vochicong","description":"A template to build API with easy and enough logs and tests, using Python :)","archived":false,"fork":false,"pushed_at":"2020-09-11T11:54:39.000Z","size":19,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-08-20T00:50:02.112Z","etag":null,"topics":["api","fastapi","loguru","pytest","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vochicong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-09-04T12:42:26.000Z","updated_at":"2020-09-11T11:54:42.000Z","dependencies_parsed_at":"2023-04-14T23:32:19.123Z","dependency_job_id":null,"html_url":"https://github.com/vochicong/py-api-log-test","commit_stats":{"total_commits":7,"total_committers":1,"mean_commits":7.0,"dds":0.0,"last_synced_commit":"f95650f7fe0c0608a2e78e530d7002abe6370339"},"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/vochicong/py-api-log-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vochicong%2Fpy-api-log-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vochicong%2Fpy-api-log-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vochicong%2Fpy-api-log-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vochicong%2Fpy-api-log-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vochicong","download_url":"https://codeload.github.com/vochicong/py-api-log-test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vochicong%2Fpy-api-log-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33162607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"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","fastapi","loguru","pytest","python"],"created_at":"2024-10-03T03:20:39.977Z","updated_at":"2026-05-18T02:32:05.557Z","avatar_url":"https://github.com/vochicong.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PythonでAPI作成、ログとテスト\n\nPythonでAPIを作成する際の、雛形プロジェクトです。\n\nパッケージ管理は `poetry` を使います。\n\n主な道具\n\n* `fastapi`\n* `loguru`\n* `pytest`\n\n## ログ\n\n`from loguru import logger` ですぐに使いやすい `logger` が出来上がります。\n`lib.util.set_logger` で少し手を加えています。\n\n* `DEBUG_LOG_FILE` (\"/var/log/app_debug.log\") に `DEBUG` レベルのログを記録\n* 標準エラー出力 `stderr` には、 `LOG_LEVEL` 環境変数で定義するレベル( `INFO` など)のログを出力\n\n## テスト\n\n`lib.util.ApiClient` は、\nAPIの `get` , `post` をテストするために、\n`BASE_URL` 環境変数が `http://localhost` などとして定義されているかによって、\n `requests`\nと\n `fastapi.testclient.TestClient`\nを使い分けます。\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvochicong%2Fpy-api-log-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvochicong%2Fpy-api-log-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvochicong%2Fpy-api-log-test/lists"}