提交 dd74ed1f 编写于 作者: F feilong

发布云原生技能树

上级 b4fca069
...@@ -28,8 +28,9 @@ ...@@ -28,8 +28,9 @@
|[OpenCV技能树编辑仓库](https://gitcode.net/csdn/skill_tree_opencv)|[OpenCV技能树社区](https://bbs.csdn.net/skill/opencv)|✓| |[OpenCV技能树编辑仓库](https://gitcode.net/csdn/skill_tree_opencv)|[OpenCV技能树社区](https://bbs.csdn.net/skill/opencv)|✓|
|[每日一题技能树编辑仓库](https://gitcode.net/csdn/skill_tree_dailycode)|[每日一练](https://dailycode.csdn.net)|✓| |[每日一题技能树编辑仓库](https://gitcode.net/csdn/skill_tree_dailycode)|[每日一练](https://dailycode.csdn.net)|✓|
|[Neo4j技能树编辑仓库](https://gitcode.net/csdn/skill_tree_neo4j)|[Neo4j技能树社区](https://bbs.csdn.net/skill/neo4j)|✓| |[Neo4j技能树编辑仓库](https://gitcode.net/csdn/skill_tree_neo4j)|[Neo4j技能树社区](https://bbs.csdn.net/skill/neo4j)|✓|
|[云原生技能树](https://gitcode.net/csdn/skill_tree_cloud_native)| | .. | |[云原生技能树](https://gitcode.net/csdn/skill_tree_cloud_native)|[云原生入门技能树](https://bbs.csdn.net/skill/cloud_native)|✓|
|[网络技能树](https://gitcode.net/csdn/skill_tree_network)|[网络技能树社区](https://bbs.csdn.net/skill/network) | ✓初阶已上线 | |[网络技能树](https://gitcode.net/csdn/skill_tree_network)|[网络技能树社区](https://bbs.csdn.net/skill/network) | ✓初阶已上线 |
|[Vue技能树](https://gitcode.net/csdn/skill_tree_vue)| |.|
|[.NET技能树](https://gitcode.net/csdn/skill_tree_dotnet)| | . | |[.NET技能树](https://gitcode.net/csdn/skill_tree_dotnet)| | . |
|[Rust技能树](https://gitcode.net/csdn/skill_tree_rust)| | . | |[Rust技能树](https://gitcode.net/csdn/skill_tree_rust)| | . |
|[Web技能树](https://gitcode.net/csdn/skill_tree_web)| | | |[Web技能树](https://gitcode.net/csdn/skill_tree_web)| | |
...@@ -39,7 +40,7 @@ ...@@ -39,7 +40,7 @@
|[DevOps运维技能树](https://gitcode.net/csdn/skill_tree_devops)| | | |[DevOps运维技能树](https://gitcode.net/csdn/skill_tree_devops)| | |
|[面向对象程序设计技能树](https://gitcode.net/csdn/skill_tree_oo)| | | |[面向对象程序设计技能树](https://gitcode.net/csdn/skill_tree_oo)| | |
|[游戏开发入门技能树](https://gitcode.net/csdn/skill_tree_game)| | | |[游戏开发入门技能树](https://gitcode.net/csdn/skill_tree_game)| | |
|[Vue技能树](https://gitcode.net/csdn/skill_tree_vue)| | |
## 技能树服务构建项目 ## 技能树服务构建项目
......
{
"type": "career",
"name": "Java后端工程师",
"skill_trees": {
"level_0": [
"gml",
"algorithm",
"java",
"springboot",
"mysql"
],
"level_1": [
"algorithm02",
"pg",
"cloud_native",
"se"
]
},
"package_id": "4ee897f9c6ef49f78d906cd46b813208"
}
\ No newline at end of file
{
"type": "career",
"name": "Python爬虫工程师",
"skill_trees": {
"level_0": [
"gml",
"python",
"algorithm",
"mysql"
],
"level_1": [
"python02",
"algorithm02",
"web",
"pg"
]
},
"package_id": "968cf8e80217499fa68d119140033e5a"
}
\ No newline at end of file
{
"type": "career",
"name": "Python数据分析工程师",
"skill_trees": {
"level_0": [
"gml",
"python",
"algorithm",
"mysql"
],
"level_1": [
"python02",
"algorithm02",
"pg"
]
},
"package_id": "900fef3acfbd450a8b342a6bbfb5145d"
}
\ No newline at end of file
{
"type": "career",
"name": "Python运维工程师",
"skill_trees": {
"level_0": [
"gml",
"python",
"algorithm",
"mysql"
],
"level_1": [
"devops",
"cloud_native",
"pg"
]
},
"package_id": "2afef99901814988afc7624c4c59a122"
}
\ No newline at end of file
from src.main.package import Package
if __name__ == '__main__':
p = Package('data/')
p.walk()
import os
import uuid
from src.main.utils import load_json, dump_json
class Package:
def __init__(self, root) -> None:
self.root = root
def walk(self):
for base, dirs, files in os.walk(self.root):
for file_name in files:
file_full_name = os.path.join(base, file_name)
_, ext = os.path.splitext(file_name)
if ext == '.json':
pkg = load_json(file_full_name)
if pkg.get('type') == 'career':
self.visit_package(file_full_name, pkg)
def visit_package(self, file_full_name, pkg):
pkg['package_id'] = uuid.uuid4().hex
dump_json(file_full_name, pkg, exist_ok=True, override=True)
import json
import os
import logging
import sys
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
handler = logging.StreamHandler(sys.stdout)
formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(message)s')
handler.setFormatter(formatter)
logger.addHandler(handler)
def load_json(p):
with open(p, 'r', encoding="utf-8") as f:
try:
return json.loads(f.read())
except UnicodeDecodeError:
logger.info(
"json 文件 [{p}] 编码错误,请确保其内容保存为 utf-8 或 base64 后的 ascii 格式。")
def dump_json(p, j, exist_ok=False, override=False):
if os.path.exists(p):
if exist_ok:
if not override:
return
else:
logger.error(f"{p} already exist")
sys.exit(0)
with open(p, 'w+', encoding="utf8") as f:
f.write(json.dumps(j, indent=2, ensure_ascii=False))
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册