{"id":48072819,"url":"https://github.com/bymoye/nazo_api","last_synced_at":"2026-04-04T14:46:14.497Z","repository":{"id":39761354,"uuid":"372008771","full_name":"bymoye/nazo_api","owner":"bymoye","description":"基于BlackSheep搭建的API","archived":false,"fork":false,"pushed_at":"2025-11-02T06:02:36.000Z","size":36689,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-02T08:17:19.520Z","etag":null,"topics":["api","python310","randimg","yiyan"],"latest_commit_sha":null,"homepage":"https://api.nmxc.ltd","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/bymoye.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-29T15:34:00.000Z","updated_at":"2025-11-02T06:02:39.000Z","dependencies_parsed_at":"2024-05-03T22:28:40.461Z","dependency_job_id":null,"html_url":"https://github.com/bymoye/nazo_api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bymoye/nazo_api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymoye%2Fnazo_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymoye%2Fnazo_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymoye%2Fnazo_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymoye%2Fnazo_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bymoye","download_url":"https://codeload.github.com/bymoye/nazo_api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bymoye%2Fnazo_api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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","python310","randimg","yiyan"],"created_at":"2026-04-04T14:46:13.941Z","updated_at":"2026-04-04T14:46:14.487Z","avatar_url":"https://github.com/bymoye.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 食用说明\r\n\r\n使用本 API 请具有一定基础\r\n\r\n本程序基于 [BlackSheep](https://github.com/Neoteroi/BlackSheep) 搭建\r\n\r\n开发环境为 `Python 3.11`\r\n\r\n请先将应用目录`(nazo_api)`的 `.env.example` 重命名为 `.env` 并修改其中的配置\r\n\r\n本程序需要 GeoIP 库(本库不提供下载)\r\n\r\n请自行到 [Maxmind](https://www.maxmind.com/en/accounts/) 下载 `GeoLite2-City.mmdb` 并放到 `nazo_api/src` 目录中\r\n\r\n本程序需要 ip2asn 库(本库不提供下载)\r\n\r\n请自行到 [iptoasn](https://iptoasn.com/) 下载 `ip2asn-v4.tsv`和`ip2asn-v6.tsv` 并放到 `src` 目录中\r\n\r\n使用 `Dockerfile` 进行安装使用\r\n\r\n`./build.sh` 中为构建指令\r\n\r\n`./start.sh` 中为运行指令\r\n\r\n图片请使用 [nazo_image_utils](https://github.com/bymoye/nazo_image_utils) 生成\r\n\r\n一言库使用 [sentences-bundle](https://github.com/hitokoto-osc/sentences-bundle)\r\n\r\n## 废案~~建议~~\r\n\r\n虽然可以直接使用 `uvicorn`，但是还是建议使用 [nginx-unit](https://unit.nginx.org/installation/)\r\n\r\n因为`nginx-unit`的性能高 如使用`nginx-unit`的话可以使用 `unit.config` 作为配置文件\r\n\r\n需要修改`path`和`working_directory`\r\n\r\n个人使用 unit 编译:\r\n\r\n```\r\ngit clone https://github.com/nginx/unit\r\ncd unit\r\n./configure --prefix=/usr/local/unit --group=unit --user=unit --openssl --no-ipv6 --control=unix:/var/run/control.unit.sock\r\nmake \u0026\u0026 make install\r\n```\r\n\r\n编译 unit-python3.10:\r\n\r\n```\r\n./configure python --module=py310 --config=python3.10-config\r\nmake \u0026\u0026 make install\r\n```\r\n\r\n# 已实现功能\r\n\r\n- QQ 昵称/头像获取\r\n- 一言\r\n- IP 定位\r\n- UA\r\n- 随机图\r\n\r\n# 待做\r\n\r\n- [x] 为 client 做限制防止并发时带来的崩溃\r\n\r\n* bilibili_API\r\n* 重写 ip2asn\r\n\r\n# 更新日志\r\n\r\n- 2023-05-14 迁移 model 中的大量代码到单独的模块\r\n\r\n  1. [nazo_image_utils](https://github.com/bymoye/nazo_image_utils) 主图片处理 / 随机图 url 生成\r\n  2. [nazo_rand](https://github.com/bymoye/nazo_rand) 随机数生成\r\n  3. [nazo_ip2asn](https://github.com/bymoye/nazo_ip2asn) ip2asn 的文件处理/查找实现\r\n  4. [webp_support](https://github.com/bymoye/webp_support) webp 支持检查\r\n\r\n- 2023-04-24 重构大量代码\r\n  1. 使用 ua 检查是否支持 webp 拆分为一个单独的模块: [webp_support](https://github.com/bymoye/webp_support)\r\n  2. 使随机数拆分为一个单独的模块: [nazo_rand](https://github.com/bymoye/nazo_rand)\r\n  3. 使随机图在使用 c 特性实现.\r\n  4. 使 ip2asn 使用 c++17 特性.\r\n- 2022-12-18 废案: C++实现 yiyan 随机 (提升不大)\r\n- 2022-03-22 重写随机图模块\r\n- 2021-10-28 完善 Config\r\n- 2021-10-24 修正 QQAPI 接口编码问题\r\n\r\n  \u003e 做了一个有趣的实验, 将`sqlite3`替换为 `aiosqlite`.\r\n  \u003e 可是替换完成之后发现一个问题.\r\n  \u003e 那就是`aiosqlite`的性能反而没有`sqlite3`的性能高.\r\n  \u003e 原因不明 所以做了回滚. 目前还是使用`sqlite3`\r\n\r\n- 2021-11-03 完善 docs\r\n- 2021-10-22 避免多余的开销\r\n- 2021-10-21 完善 docs\r\n- 2021-10-20 完成程序的重构 放弃 FastApi ,拥抱 BlackSheep\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbymoye%2Fnazo_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbymoye%2Fnazo_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbymoye%2Fnazo_api/lists"}