MCPcopy Create free account

hub / github.com/Jiang59991/ginger_wechat_portrait / functions

Functions48 in github.com/Jiang59991/ginger_wechat_portrait

↓ 10 callersFunction_tag
(name: str, data: Optional[str], partner: bool = False)
report.py:655
↓ 8 callersFunction_rate
words 中任意词出现在消息里的比例
personality.py:27
↓ 4 callersFunction_style
(ax, title='', xlabel='', ylabel='')
visualizer.py:65
↓ 3 callersFunction_mbti_panel
(mbti: dict, partner: bool = False, name: str = '?', av: Optional[str] = None)
report.py:743
↓ 3 callersFunction_pill
(name: str, data: Optional[str], partner: bool = False)
report.py:650
↓ 3 callersFunction_style_panel
(style: dict, partner: bool = False, name: str = '?', av: Optional[str] = None)
report.py:770
↓ 3 callersFunctionextract_features
从消息列表中提取可量化的语言特征
personality.py:33
↓ 2 callersFunction_avatar_b64
读取头像文件并转为 base64 data URI,失败返回 None
main.py:62
↓ 2 callersFunction_fix_emoji
递归替换 JSON 对象中所有字符串里的微信表情占位符
main.py:39
↓ 2 callersFunction_looks_like_db_storage
(path: Path)
export_contact.py:35
↓ 2 callersFunction_make_wordcloud
内部:生成 WordCloud 对象
visualizer.py:151
↓ 2 callersFunction_resolve_db_dir
兼容直接传 db_storage 目录,或传 decrypt_db.py 输出根目录。
export_contact.py:42
↓ 2 callersFunctionget_avatar_path
搜索头像:先查文件系统缓存,再从 head_image.db 提取,失败返回 None。 若从数据库读取,将图片写入临时文件并返回其路径。
export_contact.py:296
↓ 2 callersFunctionget_message_dbs
返回所有已解密的 message_N.db,按编号排序。
export_contact.py:85
↓ 1 callersFunction_av
(name: str, data: Optional[str], size: int = 38, cls: str = 'av-self')
report.py:642
↓ 1 callersFunction_butterfly_big5
(b5s: dict, b5p: dict, sn: str, pn: str, sa: Optional[str], pa: Optional[str])
report.py:666
↓ 1 callersFunction_heatmap_html
生成热力图 HTML + 内嵌 JS
report.py:791
↓ 1 callersFunction_load_meta
尝试读取 export 脚本写出的 meta sidecar JSON
main.py:50
↓ 1 callersFunction_replace_wechat_emoji
把微信表情占位符替换为对应的 Unicode Emoji
data_loader.py:66
↓ 1 callersFunction_single_big5
(big5: dict)
report.py:717
↓ 1 callersFunctiondecode_content
(raw)
export_contact.py:222
↓ 1 callersFunctionexport_messages
(db_dir: Path, contact_wxid: str, contact_name: str, self_wxid: str, output_path: Path)
export_contact.py:178
↓ 1 callersFunctionfind_contact
(db_dir: Path, name: str)
export_contact.py:115
↓ 1 callersFunctionget_db_dir
()
export_contact.py:65
↓ 1 callersFunctionget_self_nick
尝试从 contact.db 或微信文件目录获取自己的昵称
export_contact.py:271
↓ 1 callersFunctionget_self_wxid
推断自己的 wxid:先查 WeChat 数据目录,再从 Name2Id 找
export_contact.py:127
↓ 1 callersFunctionget_sender_rowids
通过 Name2Id 表的 rowid 获取 real_sender_id
export_contact.py:164
↓ 1 callersFunctionlist_contacts
(db_dir: Path)
export_contact.py:101
↓ 1 callersFunctionload_config
()
export_contact.py:28
↓ 1 callersFunctionmain
()
export_contact.py:348
↓ 1 callersFunctionmain
()
main.py:82
↓ 1 callersFunctionmd5
(text: str)
export_contact.py:81
Function_score
对单条消息打分(0-10),分越高越优先被采样
sampler.py:27
Functionanalyze
调用 Claude 进行完整人格分析。 返回结构化 dict,若 JSON 解析失败则返回 {'raw': ..., 'parse_error': True}。
personality.py:109
Functionbig5_radar
大五人格雷达图
visualizer.py:227
Functioncompute
返回包含以下键的 dict: total_messages, total_chars, avg_length, date_range, daily, hourly, monthly, weekday, word_freq (Counter), emoji
stats.py:23
Functionfilter_for_personality
去除低信号消息,保留有人格分析价值的内容。 规则: - 长度 12-150 字符(过短无信息量,过长通常是转发文档) - 非纯噪音(语气词、"好的"等) - 非转发聊天记录 - 非纯 emoji - 非 XML / 小程序
data_loader.py:140
Functiongenerate
(stats: dict, personality: dict, output_dir: str, partner_stats: dict = None, partne
report.py:850
Functionhourly
每小时消息分布
visualizer.py:82
Functionlength_dist
消息长度分布直方图
visualizer.py:213
Functionload
加载 CSV,标准化列名,解析时间,过滤出指定发送方的文本消息。 sender=1 为自己,sender=0 为对方。 返回已清洗的 DataFrame,包含列: content, datetime, date, hour, month, weekday
data_loader.py:102
Functionmonthly_trend
月度消息趋势
visualizer.py:108
Functionsave_all
把所有图表保存为 PNG
visualizer.py:255
Functionsetup_font
()
visualizer.py:44
Functionsmart_sample
分层时序采样: - 按自然月分组 - 每月内按内容分数降序,取 quota 条 - 全局打乱,消除顺序偏差 返回消息文本列表。
sampler.py:38
Functionweekday_bar
一周各天消息分布
visualizer.py:132
Functionword_cloud
单人中文词云(兼容旧接口)
visualizer.py:167
Functionword_cloud_pair
双人词云:左右并排,棕色(自己)vs 青绿色(对方)
visualizer.py:186