A PyPI module for talent insight, org structure, salary analysis and company alias management.
Project description
talent-birdview
人才数据分析工具,基于人才数据,提供人才洞察、组织架构分析、薪酬统计和公司别名标准化等功能。
功能特性
- 人才洞察分析:生成多维度技术人才 Markdown 报告,含地区分布、公司画像、技术方向、高管/核心人才洞察
- 组织架构分析:基于职位信息自动推断技术层级与汇报关系,生成 Mermaid 组织架构图
- 薪酬统计分析:解析多种薪酬格式,生成 8 类可视化图表(直方图、箱线图、热力图、散点图等)
- 公司别名生成:基于自动规则引擎从原始数据中生成公司名称标准化映射
- 公司名称标准化:内置 270+ 品牌映射与自动匹配规则,支持运行时扩展
- 配置管理系统:分层配置架构(默认配置 < 自定义配置 < 命令行参数),支持 YAML/JSON
安装
pip install talent-birdview
或从源码安装:
git clone <repo-url>
cd talent-birdview
pip install -e .
快速开始
1. 初始化配置文件
talent-birdview config init -o ./my_config.yaml
编辑 my_config.yaml,设置你的数据源文件路径:
files:
具身智能: "./talent01.xlsx"
自动驾驶: "./autodrive_talent.xlsx"
2. 执行分析
# 人才洞察报告
talent-birdview talent --config ./my_config.yaml --output ./talent_report.md
# 组织架构深度分析(含 Mermaid 图)
talent-birdview org --config ./my_config.yaml --output ./org_report.md
# 薪酬统计分析(自动生成图表)
talent-birdview salary --config ./my_config.yaml --output ./salary_report.md --chart-dir ./charts
3. 生成公司别名映射
talent-birdview aliases --excel ./autodrive_talent.xlsx --excel ./talent01.xlsx --output ./new_aliases.json --stats
命令行接口
分析命令
| 命令 | 说明 | 示例 |
|---|---|---|
talent |
人才洞察分析 | talent-birdview talent -c config.yaml -o report.md |
org |
组织架构分析 | talent-birdview org -c config.yaml -o org.md |
salary |
薪酬统计分析 | talent-birdview salary -c config.yaml --chart-dir ./charts |
aliases |
别名自动生成 | talent-birdview aliases -e data.xlsx -o aliases.json |
配置管理
# 导出默认配置模板
talent-birdview config init -o ./talent_birdview_config.yaml
# 查看完整生效配置
talent-birdview config show -c ./my_config.yaml
# 查看单个配置项
talent-birdview config show -c ./my_config.yaml -k files
公司名称标准化
# 单条标准化
talent-birdview company normalize "魔门塔(苏州)科技有限公司"
# 输出: Momenta
# 批量标准化 Excel 中的公司名
talent-birdview company batch ./data.xlsx -o ./normalized.xlsx
# 加载额外的别名映射文件
talent-birdview company normalize "某某科技" -a ./extra_aliases.json
配置说明
配置采用分层架构,优先级从高到低:
- 命令行参数(如
--chart-dir) - 用户自定义配置文件(通过
--config指定) - 模块内置默认配置
配置项说明
# 数据源文件映射
files:
具身智能: "./talent01.xlsx"
自动驾驶: "./autodrive_talent.xlsx"
# 输出路径
output:
talent_report: "./talent_insight_report.md"
org_report: "./org_structure_report.md"
salary_report: "./salary_analysis_report.md"
salary_charts: "./salary_charts"
aliases_debug: "./new_aliases_debug.txt"
# 分析参数
analysis:
talent_top_companies: 40 # 人才报告公司分布显示数量
org_min_people: 15 # 组织架构分析最少技术人才数
org_max_directions: 8 # Mermaid 图最大技术方向数
salary_min_company_sample: 10 # 薪酬公司对比最小样本数
# 技术关键词
tech_keywords: [...] # 判定技术岗位的白名单关键词
non_tech_keywords: [...] # 判定非技术岗位的黑名单关键词
# 技术方向映射
tech_direction_map:
感知: ["感知", "视觉", "激光雷达", ...]
规划决策: ["规划", "决策", "预测", ...]
...
模块架构
talent_birdview/
├── __init__.py # 包入口
├── __main__.py # python -m talent_birdview 入口
├── cli.py # Typer 命令行接口
├── config.py # 配置管理器 (ConfigManager)
├── company.py # 公司名称标准化 (CompanyNormalizer)
├── data.py # 公共数据层 (TalentDataLoader + 工具函数)
├── aliases_data.py # 内置完整公司别名映射数据
├── templates/
│ └── default_config.yaml # 默认配置模板
└── analysis/
├── __init__.py
├── talent.py # 人才洞察分析 (TalentAnalyzer)
├── org.py # 组织架构分析 (OrgStructureAnalyzer)
├── salary.py # 薪酬统计分析 (SalaryAnalyzer)
└── aliases.py # 别名生成 (AliasGenerator)
作为 Python 库使用
from talent_birdview.config import ConfigManager
from talent_birdview.company import CompanyNormalizer
from talent_birdview.analysis import TalentAnalyzer, SalaryAnalyzer
# 加载配置
cfg = ConfigManager("./my_config.yaml").get_all()
# 标准化公司名
normalizer = CompanyNormalizer()
print(normalizer.normalize("魔门塔(苏州)科技有限公司")) # Momenta
# 执行人才洞察分析
analyzer = TalentAnalyzer(config=cfg)
report = analyzer.analyze()
with open("./report.md", "w", encoding="utf-8") as f:
f.write(report)
# 执行薪酬分析
salary_analyzer = SalaryAnalyzer(config=cfg)
report = salary_analyzer.analyze()
扩展公司名称映射
运行时添加
from talent_birdview.company import CompanyNormalizer
n = CompanyNormalizer()
n.add_alias("某某科技有限公司", "某某")
print(n.normalize("某某科技有限公司")) # 某某
从文件加载扩展映射
n.load_aliases("./my_aliases.json")
n.save_aliases("./updated_aliases.json")
自定义自动规则
from talent_birdview.analysis import AliasGenerator
rules = [
("新品牌", ["新品牌", "新品牌科技"], ["排除词"]),
]
generator = AliasGenerator(auto_rules=rules)
new_aliases = generator.generate(["./data.xlsx"])
数据源格式要求
Excel 文件需包含以下列(列名不区分大小写):
| 列名 | 说明 | 必需 |
|---|---|---|
company |
公司名称 | 是 |
position |
职位名称 | 是 |
name |
姓名 | 否 |
city |
城市 | 否 |
province |
省份 | 否 |
salary |
薪酬(如 35k-45k/月) | 否 |
work_time |
工作年限 | 否 |
sdegree |
学历 | 否 |
school |
毕业院校 | 否 |
exp |
工作经历(JSON 格式) | 否 |
依赖
- Python >= 3.9
- pandas
- numpy
- matplotlib
- seaborn
- openpyxl
- typer
- pyyaml
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
talent_birdview-0.1.0.tar.gz
(52.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file talent_birdview-0.1.0.tar.gz.
File metadata
- Download URL: talent_birdview-0.1.0.tar.gz
- Upload date:
- Size: 52.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75e6645acd80d15cffa3cb56f0314308b663220b9c046af90ca7c41515a1e6dc
|
|
| MD5 |
3d7f79fdd91c270ac8e1e8ab49e5da4c
|
|
| BLAKE2b-256 |
27df488fd66da051f916c5dcb3d1c95acbcf23b34ed8b1c368b6281025ad0937
|
File details
Details for the file talent_birdview-0.1.0-py3-none-any.whl.
File metadata
- Download URL: talent_birdview-0.1.0-py3-none-any.whl
- Upload date:
- Size: 55.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
617052176e897327aa722123106f54aae768c3a36061b6720f953f6cb49a9248
|
|
| MD5 |
2897ac099c224f60cfd4956dc3c40c38
|
|
| BLAKE2b-256 |
85d92f8af43c34849f0d0a87905a09e06eb121773dec5af93d93ac5d0612975e
|