Add EasyEDA Pro EPRO2 source ingestion (3/5 batch test)

打通 oshwhub origin=pro 现代 Pro 3.x 工程的 EPRO2 源抓取链路。3/5
modern Pro 项目完整解出(共 8423 docs / 542 MB plain):

- X86 主板        7374 docs / 481 MB plain (chain=85, editor=3.2.15)
- 220V 桌面电源     771 docs /  26 MB plain (chain=28, editor=3.2.69)
- ESP-VoCat       278 docs / 7.5 MB plain (chain=12, editor=3.2.91)

剩余 2/5 是 legacy Pro 2.x(立创泰山派 RK3566、梁山派),项目 meta
返回 branch_uuid=null + editorVersion="2.1.40",没有 git-style chain
模型,文档直接挂在 boards[].sch/pcb 字段上,访问端点暂未挖通;元
数据落库 metadata.json,source/ 留空。

实现要点:
- fetch_pro_source(): 4 步流程(project → branch HEAD → structures
  → /branches/<B>/histories/<HEAD> 即返完整 chain,无需 ?limit 批量
  端点)+ 逐 history 走 AES-128-GCM 解密(16 字节 IV,pycryptodome
  原生支持)+ gunzip + 按 DOCHEAD 切 per-doc EPRO2 流
- EPRO2 解析坑:行末单 `|` 是行终止符不是字段分隔符,必须先
  rstrip("|") 再 split("||"),否则 payload JSON 解析失败 silently
  swallow 导致 cur_doc 不设 → 第一轮 X86 板 7374 docs 抽出来只剩 2 个
- docType 实测远不止 BOARD/PCB/SCH/SCH_PAGE,还含 SYMBOL /
  FOOTPRINT / DEVICE / BLOB / FONT / CONFIG —— Pro 把组件库快照也
  随项目存到 history,下游做 EPRO2→KiCad 转换时必须先把这些 lib
  doc 加载进 symbol cache
- Pro 2.x vs 3.x 是不同存储模型 —— 3.x 走 branch 模型(已打通),
  2.x 走 boards[] 直链(未打通);判别条件:project meta 的
  branch_uuid 是否为 null

CLI 新增 --with-pro-source / --backfill-pro-source / --pro-cookie /
--origin(按 origin 字段服务端过滤 listing API),crawl_one() 按
origin=pro 自动 dispatch 到 Pro fetcher。

schema:docType 类型从 integer 放宽到 [integer, string, null]
(兼容 Std 的 1/3 + Pro 的 BOARD/SCH 等),新增 message_count 字段。

License 注意:本批 5 个项目全是 NC-SA / GPL,未达 Pro source doc
§4.2 Forge 白名单(MIT/BSD/Apache/CC0/CC-BY/CERN-OHL-P/Unlicense)。
按 CLAUDE.md "研究用、不再分发" 原则 raw 入库无碍;Forge 投影时
另过白名单。

详细技术细节见 docs/sources/easyeda_pro_source.md rev 3 + log.md。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-28 21:45:52 +08:00
parent d874278bc5
commit 3282a028c4
8455 changed files with 2275248 additions and 36 deletions

View File

@@ -0,0 +1,49 @@
{"type":"DOCHEAD","ticket":2256}||{"docType":"FOOTPRINT","client":"33e0f1759cdde412","uuid":"0802b3633654cf9f","updateTime":1768981062997,"version":"1681267130"}|
{"type":"META","ticket":2257,"id":"META"}||{"title":"CAP-TH_BD6.3-P2.60-D0.6-FD-1","description":";插件,D6.3xL12mm;插件,D6.3xL10.5mm;插件,D6.3xL8mm;插件,D6.3xL9mm;插件,D6.3xL10mm;插件,D6.3xL11mm;插件,6.3x13mm;插件,6.3x9mm;插件,6.3x5mm;插件,6.3x11mm;插件,6.3x12mm;插件,D6.3xL11.5mm;插件,6.3x8mm;插件,6.3x14mm;插件,D6.3xL5mm;插件,D6.3xL7mm","tags":[],"source":"ecf03b9d59864b6eb8d4f37b6fc41baa|0819f05c4eef4c71ace90d822a990e87"}|
{"type":"DOCHEAD","ticket":172}||{"docType":"FOOTPRINT","client":"aec475f2fd75445c","uuid":"0802b3633654cf9f","updateTime":1749871695000,"version":"1681267130","user":{"uuid":"f6d958b048194965970a097419f0f68a","nickname":"cqlcp","username":"cqlcp","avatar":"//image.lceda.cn/pullimage/NsxOE12DqgbATdorYElg2uwyuwtHykRrwO7hVKeC.jpeg"}}|
{"type":"LAYER","ticket":1,"id":"[\"LAYER\",1]"}||{"layerType":"TOP","layerName":"Top Layer","use":true,"show":true,"locked":false,"activeColor":"#FF0000","activateTransparency":1,"inactiveColor":"#7F0000","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":2,"id":"[\"LAYER\",2]"}||{"layerType":"BOTTOM","layerName":"Bottom Layer","use":true,"show":true,"locked":false,"activeColor":"#0000FF","activateTransparency":1,"inactiveColor":"#00007F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":3,"id":"[\"LAYER\",3]"}||{"layerType":"TOP_SILK","layerName":"Top Silkscreen Layer","use":true,"show":true,"locked":false,"activeColor":"#FFCC00","activateTransparency":1,"inactiveColor":"#7F6600","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":4,"id":"[\"LAYER\",4]"}||{"layerType":"BOT_SILK","layerName":"Bottom Silkscreen Layer","use":true,"show":true,"locked":false,"activeColor":"#66CC33","activateTransparency":1,"inactiveColor":"#336619","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":5,"id":"[\"LAYER\",7]"}||{"layerType":"TOP_PASTE_MASK","layerName":"Top Paste Mask Layer","use":true,"show":true,"locked":false,"activeColor":"#808080","activateTransparency":1,"inactiveColor":"#404040","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":6,"id":"[\"LAYER\",8]"}||{"layerType":"BOT_PASTE_MASK","layerName":"Bottom Paste Mask Layer","use":true,"show":true,"locked":false,"activeColor":"#800000","activateTransparency":1,"inactiveColor":"#400000","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":7,"id":"[\"LAYER\",5]"}||{"layerType":"TOP_SOLDER_MASK","layerName":"Top Solder Mask Layer","use":true,"show":true,"locked":false,"activeColor":"#800080","activateTransparency":1,"inactiveColor":"#400040","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":8,"id":"[\"LAYER\",6]"}||{"layerType":"BOT_SOLDER_MASK","layerName":"Bottom Solder Mask Layer","use":true,"show":true,"locked":false,"activeColor":"#AA00FF","activateTransparency":1,"inactiveColor":"#55007F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":9,"id":"[\"LAYER\",13]"}||{"layerType":"DOCUMENT","layerName":"Document Layer","use":true,"show":true,"locked":false,"activeColor":"#FFFFFF","activateTransparency":1,"inactiveColor":"#7F7F7F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":10,"id":"[\"LAYER\",11]"}||{"layerType":"OUTLINE","layerName":"Board Outline Layer","use":true,"show":true,"locked":false,"activeColor":"#FF00FF","activateTransparency":1,"inactiveColor":"#7F007F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":11,"id":"[\"LAYER\",12]"}||{"layerType":"MULTI","layerName":"Multi-Layer","use":true,"show":true,"locked":false,"activeColor":"#C0C0C0","activateTransparency":1,"inactiveColor":"#606060","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":12,"id":"[\"LAYER\",9]"}||{"layerType":"TOP_ASSEMBLY","layerName":"Top Assembly Layer","use":true,"show":true,"locked":false,"activeColor":"#33CC99","activateTransparency":1,"inactiveColor":"#19664C","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":13,"id":"[\"LAYER\",10]"}||{"layerType":"BOT_ASSEMBLY","layerName":"Bottom Assembly Layer","use":true,"show":true,"locked":false,"activeColor":"#5555FF","activateTransparency":1,"inactiveColor":"#2A2A7F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":14,"id":"[\"LAYER\",14]"}||{"layerType":"MECHANICAL","layerName":"Mechanical Layer","use":true,"show":true,"locked":false,"activeColor":"#F022F0","activateTransparency":1,"inactiveColor":"#781178","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":15,"id":"[\"LAYER\",52]"}||{"layerType":"COMPONENT_MODEL","layerName":"Component Model Layer","use":true,"show":true,"locked":false,"activeColor":"#FFFFFF","activateTransparency":1,"inactiveColor":"#7F7F7F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":16,"id":"[\"LAYER\",48]"}||{"layerType":"COMPONENT_SHAPE","layerName":"Component Shape Layer","use":true,"show":true,"locked":false,"activeColor":"#00CCCC","activateTransparency":1,"inactiveColor":"#006666","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":17,"id":"[\"LAYER\",51]"}||{"layerType":"PIN_FLOATING","layerName":"Pin Floating Layer","use":true,"show":true,"locked":false,"activeColor":"#FF99FF","activateTransparency":1,"inactiveColor":"#7F4C7F","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":18,"id":"[\"LAYER\",49]"}||{"layerType":"COMPONENT_MARKING","layerName":"Component Marking Layer","use":true,"show":true,"locked":false,"activeColor":"#66FFCC","activateTransparency":1,"inactiveColor":"#337F66","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":19,"id":"[\"LAYER\",47]"}||{"layerType":"HOLE","layerName":"Hole Layer","use":true,"show":true,"locked":false,"activeColor":"#222222","activateTransparency":1,"inactiveColor":"#111111","inactiveTransparency":0.5}|
{"type":"LAYER","ticket":20,"id":"[\"LAYER\",50]"}||{"layerType":"PIN_SOLDERING","layerName":"Pin Soldering Layer","use":true,"show":true,"locked":false,"activeColor":"#CC9999","activateTransparency":1,"inactiveColor":"#664C4C","inactiveTransparency":0.5}|
{"type":"ACTIVE_LAYER","ticket":22,"id":"ACTIVE_LAYER","firstTicket":21}||{"layerId":1}|
{"type":"CANVAS","ticket":23,"id":"CANVAS"}||{"originX":0,"originY":0,"unit":"mm","gridXSize":10,"gridYSize":10,"snapXSize":0.5,"snapYSize":0.5,"gridType":"NONE","multiGridType":"NONE","highlightValue":0.5}|
{"type":"ELE_PLACEHOLDER","ticket":24,"id":"placeholder1"}||{"dataType":"FILL","max":1}|
{"type":"FILL","ticket":25,"id":"e1"}||{"groupId":0,"netName":"","layerId":49,"width":0.2,"fillStyle":"SOLID","path":[["CIRCLE",-124.09,-124.06,2.361]],"locked":false,"zIndex":1,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"FILL","ticket":26,"id":"e2"}||{"groupId":0,"netName":"","layerId":13,"width":0.2,"fillStyle":"SOLID","path":[-120,40,"L",-65,40,-65,30,-120,30,-120,40],"locked":false,"zIndex":2,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"FILL","ticket":27,"id":"e3"}||{"groupId":0,"netName":"","layerId":13,"width":0.2,"fillStyle":"SOLID","path":[-97.5,7.5,"L",-97.5,62.5,-87.5,62.5,-87.5,7.5,-97.5,7.5],"locked":false,"zIndex":3,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"FILL","ticket":28,"id":"e4"}||{"groupId":0,"netName":"","layerId":13,"width":0.2,"fillStyle":"SOLID","path":[32.5,50,"L",87.5,50,87.5,40,32.5,40,32.5,50],"locked":false,"zIndex":4,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"FILL","ticket":29,"id":"e5"}||{"groupId":0,"netName":"","layerId":50,"width":0.2,"fillStyle":"SOLID","path":[["CIRCLE",-51.18,0,11.8155]],"locked":false,"zIndex":5,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"FILL","ticket":30,"id":"e6"}||{"groupId":0,"netName":"","layerId":50,"width":0.2,"fillStyle":"SOLID","path":[["CIRCLE",51.18,0,11.8155]],"locked":false,"zIndex":6,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"ELE_PLACEHOLDER","ticket":31,"id":"placeholder2"}||{"dataType":"FILL","max":2}|
{"type":"FILL","ticket":32,"id":"e9"}||{"groupId":0,"netName":"","layerId":3,"width":0.2,"fillStyle":"SOLID","path":[90,-90,"L",89.965,85.427,90,85.391,"ARC",-45.00026594013651,126.325,-2.3048,"L",126.325,-2.305,"ARC",-44.99989635000812,90,-90],"locked":false,"zIndex":9,"isBridgingCopper":false,"networkList":[],"refs":[]}|
{"type":"ELE_PLACEHOLDER","ticket":33,"id":"placeholder3"}||{"dataType":"POLY","max":7}|
{"type":"POLY","ticket":34,"id":"e7"}||{"groupId":0,"netName":"","layerId":48,"width":2,"path":[123.911,-0.184,"ARC",-90.0000000000018,0.033,-124.062,"L",-0.06,-124.062,"ARC",-89.99999999999902,-124.086,-0.036,"L",-124.086,0.115,"ARC",-89.9999999999994,-0.125,124.076,"L",0.005,124.092,"ARC",-90.00000000000165,123.911,0.186,"L",123.911,-0.184],"locked":false,"zIndex":7,"polyType":"NORMAL"}|
{"type":"POLY","ticket":35,"id":"e8"}||{"groupId":0,"netName":"","layerId":3,"width":10,"path":["CIRCLE",0,0,124.02],"locked":false,"zIndex":8,"polyType":"NORMAL"}|
{"type":"ELE_PLACEHOLDER","ticket":36,"id":"placeholder4"}||{"dataType":"POLY","max":1}|
{"type":"POLY","ticket":37,"id":"e10"}||{"groupId":0,"netName":"","layerId":3,"width":10,"path":[-124.02,0,"ARC",-180,124.02,0],"locked":false,"zIndex":10,"polyType":"NORMAL"}|
{"type":"POLY","ticket":38,"id":"e11"}||{"groupId":0,"netName":"","layerId":3,"width":10,"path":[124.02,0,"ARC",-180,-124.02,0],"locked":false,"zIndex":11,"polyType":"NORMAL"}|
{"type":"ELE_PLACEHOLDER","ticket":39,"id":"placeholder5"}||{"dataType":"STRING","max":12}|
{"type":"STRING","ticket":40,"id":"e12"}||{"groupId":0,"layerId":3,"x":-80,"y":40,"text":"+","fontFamily":"default","fontSize":39.37,"strokeWidth":8,"bold":false,"italic":false,"origin":"LEFT_BOTTOM","angle":0,"reverse":false,"expansion":0,"mirror":false,"locked":false,"zIndex":12}|
{"type":"STRING","ticket":41,"id":"e13"}||{"groupId":0,"layerId":3,"x":40,"y":35,"text":"-","fontFamily":"default","fontSize":39.37,"strokeWidth":8,"bold":false,"italic":false,"origin":"LEFT_BOTTOM","angle":0,"reverse":false,"expansion":0,"mirror":false,"locked":false,"zIndex":13}|
{"type":"ELE_PLACEHOLDER","ticket":42,"id":"placeholder6"}||{"dataType":"PAD","max":14}|
{"type":"PAD","ticket":43,"id":"e14"}||{"groupId":0,"netName":"","layerId":12,"num":"1","centerX":-51.18,"centerY":0,"padAngle":0,"hole":{"holeType":"ROUND","width":43.308,"height":43.308},"defaultPad":{"padType":"ELLIPSE","width":68.898,"height":68.898},"specialPad":[],"padOffsetX":-0.002,"padOffsetY":0,"relativeAngle":0,"plated":true,"padType":"NORMAL","topSolderExpansion":1.9689999999999999,"bottomSolderExpansion":1.9689999999999999,"topPasteExpansion":0,"bottomPasteExpansion":0,"locked":false,"zIndex":14,"connectMode":null,"spokeSpace":null,"spokeWidth":null,"spokeAngle":null,"padLen":0}|
{"type":"PAD","ticket":44,"id":"e15"}||{"groupId":0,"netName":"","layerId":12,"num":"2","centerX":51.18,"centerY":0,"padAngle":0,"hole":{"holeType":"ROUND","width":43.308,"height":43.308},"defaultPad":{"padType":"ELLIPSE","width":68.898,"height":68.898},"specialPad":[],"padOffsetX":0.002,"padOffsetY":0,"relativeAngle":0,"plated":true,"padType":"NORMAL","topSolderExpansion":1.9689999999999999,"bottomSolderExpansion":1.9689999999999999,"topPasteExpansion":0,"bottomPasteExpansion":0,"locked":false,"zIndex":15,"connectMode":null,"spokeSpace":null,"spokeWidth":null,"spokeAngle":null,"padLen":0}|
{"type":"ELE_PLACEHOLDER","ticket":45,"id":"placeholder7"}||{"dataType":"ATTR","max":16}|
{"type":"ATTR","ticket":46,"id":"e16"}||{"groupId":0,"parentId":"","layerId":3,"x":null,"y":null,"key":"Footprint","value":"CAP-TH_BD6.3-P2.60-D0.6-FD-1","keyVisible":false,"valueVisible":false,"fontFamily":"default","fontSize":67.5,"strokeWidth":6,"bold":false,"italic":false,"origin":"LEFT_BOTTOM","angle":0,"reverse":false,"expansion":0,"mirror":false,"locked":false,"zIndex":16}|
{"type":"ATTR","ticket":47,"id":"e17"}||{"groupId":0,"parentId":"","layerId":3,"x":null,"y":null,"key":"Designator","value":"U?","keyVisible":false,"valueVisible":false,"fontFamily":"default","fontSize":67.5,"strokeWidth":6,"bold":false,"italic":false,"origin":"LEFT_BOTTOM","angle":0,"reverse":false,"expansion":0,"mirror":false,"locked":false,"zIndex":17}|