# garbevents
>本项目由 [JetBranins](https://www.jetbrains.com/?from=garbevents) 赞助相关开发工具
##
[![Build Status](https://travis-ci.com/Pactortester/garbevents.svg?branch=master)](https://travis-ci.com/Pactortester/garbevents) ![PyPI](https://img.shields.io/pypi/v/garbevents) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/garbevents) ![GitHub top language](https://img.shields.io/github/languages/top/Pactortester/garbevents) [![Downloads](https://static.pepy.tech/personalized-badge/garbevents?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=downloads/total)](https://pepy.tech/project/garbevents) ![GitHub stars](https://img.shields.io/github/stars/Pactortester/garbevents?style=social) ![https://blog.csdn.net/flower_drop](https://img.shields.io/badge/csdn-%40flower__drop-orange)
## 埋点适配计划
- [x] 诸葛 IO
- [x] 神策数据
- [x] GrowingIO 埋点数据
- [x] Argo 易观方舟
- [ ] 友盟
- [ ] C4J
- [ ] Mixpanel
- [ ] GA
- [ ] Ptmind Ptengine
- [ ] 国双 WebDissector
- [ ] 谷歌分析 Google Analytics
## Logo
![](https://files.mdnice.com/user/17535/ed606252-d4db-42b0-9081-a81c438d1eab.png)
## 安装
pip install garbevents
## 仓库地址:
- github:https://github.com/Pactortester/garbevents.git
- pypi:https://pypi.org/project/garbevents/#history
## 社区地址
- testerhome:https://testerhome.com/opensource_projects/garbevents
## 适用场景
1. 使用 以上厂商 作为埋点收集工具的 。
2. 需要回归验证大批量埋点是否丢失的。
3. 使用本工具 自动抓取解析埋点信息数据校验埋点是否 丢失。
## 功能
1. 自动解析 移动端\桌面端\h5页面 触发的埋点信息,解密后生成 [now_data.txt]()
2. 去重后和已知埋点信息diff,保存文件 [lost_data.txt]()
## 使用
- 启动服务
1. 在cmd启动代理服务
```shell
gb -p 8889 -s test_script.py
__ __
____ _____ ______/ /_ ___ _ _____ ____ / /______
/ __ `/ __ `/ ___/ __ \/ _ \ | / / _ \/ __ \/ __/ ___/
/ /_/ / /_/ / / / /_/ / __/ |/ / __/ / / / /_(__ )
\__, /\__,_/_/ /_.___/\___/|___/\___/_/ /_/\__/____/ v2.0.5
/____/
Proxy server listening at http://*:8889
```
- 连接代理
1. cmd中运行ipconfig 找到自己的ip地址
2. 手机wifi高级选项,代理选择手动,添加代理服务器
```shell
ip:你的电脑ip, 端口:8889
```
- 下载证书
1. 在手机浏览器中打开网址 [mitm.it]()
2. 选择对应的证书下载安装
```shell
mitm.it
```
- 开始使用
1. 此时便可以在手机端操作触发埋点,控制台实时打印当前触发的埋点
2. 如果想查看丢失的埋点需要先在 ST.all_events 全局变量中传入全部埋点信息
3. 例如:ST.all_events = ['event_name_1', 'event_name_2']
## 命令
```shell
# 只打印所需日志
gb -p 8889 -q -s test_script.py
```
## 诸葛IO Demo
```python
from garbevents.events import GetData
from garbevents.settings import Settings as ST
# 埋点上传url
ST.url = 'https://datain.zhuge.com'
# 报告生成路径
ST.report_path = 'report'
# 所有事件名称
ST.all_events = ['event_name_1', 'event_name_2']
# 接口地址
ST.interface_url = ['apipool', 'APIPOOL']
addons = [
GetData()
]
```
## 神策数据 Demo 1
```python
from garbevents.sensors_events import GetData
from garbevents.settings import Settings as ST
# 埋点上传url
ST.url = 'http://sensor.wodidashi.com'
# 报告生成路径
ST.report_path = 'report'
# 所有事件名称
ST.all_events = ['event_name_1', 'event_name_2']
addons = [
GetData()
]
```
## 神策数据 Demo 2
```python
from garbevents.custom_sensors_events import GetData
from garbevents.settings import Settings as ST
# 埋点上传url
ST.url = 'http://sensor.wodidashi.com'
# 报告生成路径
ST.report_path = 'report'
# 所有事件名称
ST.all_events = ['event_name_1', 'event_name_2']
addons = [
GetData()
]
```
## GrowingIO Demo
```python
from garbevents.growingio_events import GetData
from garbevents.settings import Settings as ST
# 埋点上传url
ST.url = 'https://wxapi.growingio.com'
# 报告生成路径
ST.report_path = 'report'
# 所有事件名称
ST.all_events = ['event_name_1', 'event_name_2']
addons = [
GetData()
]
```
## Argo 易观方舟 Demo
```python
from garbevents.argo_events import GetData
from garbevents.settings import Settings as ST
# 埋点上传url
ST.url = 'https://uat.analysys.cn:4089/'
# 报告生成路径
ST.report_path = 'report'
# 所有事件名称
ST.all_events = ['event_name_1', 'event_name_2']
addons = [
GetData()
]
```
## 运行截图
![](https://files.mdnice.com/user/17535/c730acf2-ec15-4924-9cf5-b0b77c092211.png)
## 用法拓展
1. 结合UI自动化,嵌入到你的平台或者框架中,运行自动化脚本的同时,也测试了埋点。
2. 部署到公司服务器,给测试部门的同学用,助人为乐!!!
##
以上便是 garbevents 的基本用法介绍。
如果您有发现错误,或者您对 garbevents 有任何建议,欢迎到 [garbevents Issues](https://github.com/Pactortester/garbevents/issues)
发表,非常感谢您的支持。您的反馈和建议非常宝贵,希望您的参与能帮助 garbevents 做得更好。
## 后台运行
- 运行
```shell
nohup ./garbevents.sh > run.log 2>&1 &
```
- 查看
```shell
jobs
```
- 结束
```shell
kill -9 pid
```
Raw data
{
"_id": null,
"home_page": "https://github.com/Pactortester/garbevents",
"name": "garbevents",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "pip, garbevents, zhugeio, buried points, sensors, argo, growingio",
"author": "lijiawei",
"author_email": "jiawei.li2@qq.com",
"download_url": "https://files.pythonhosted.org/packages/18/08/8e993c07dba3a68371f1759ff13e4af87ad8863d196ca0c0e3d68d425c15/garbevents-2.1.7.tar.gz",
"platform": "any",
"description": "# garbevents\n\n>\u672c\u9879\u76ee\u7531 [JetBranins](https://www.jetbrains.com/?from=garbevents) \u8d5e\u52a9\u76f8\u5173\u5f00\u53d1\u5de5\u5177 \n\n## \n\n[![Build Status](https://travis-ci.com/Pactortester/garbevents.svg?branch=master)](https://travis-ci.com/Pactortester/garbevents) ![PyPI](https://img.shields.io/pypi/v/garbevents) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/garbevents) ![GitHub top language](https://img.shields.io/github/languages/top/Pactortester/garbevents) [![Downloads](https://static.pepy.tech/personalized-badge/garbevents?period=total&units=international_system&left_color=grey&right_color=brightgreen&left_text=downloads/total)](https://pepy.tech/project/garbevents) ![GitHub stars](https://img.shields.io/github/stars/Pactortester/garbevents?style=social) ![https://blog.csdn.net/flower_drop](https://img.shields.io/badge/csdn-%40flower__drop-orange)\n\n\n## \u57cb\u70b9\u9002\u914d\u8ba1\u5212\n\n- [x] \u8bf8\u845b IO\n- [x] \u795e\u7b56\u6570\u636e\n- [x] GrowingIO \u57cb\u70b9\u6570\u636e\n- [x] Argo \u6613\u89c2\u65b9\u821f\n- [ ] \u53cb\u76df\n- [ ] C4J\n- [ ] Mixpanel \n- [ ] GA \n- [ ] Ptmind Ptengine\n- [ ] \u56fd\u53cc WebDissector\n- [ ] \u8c37\u6b4c\u5206\u6790 Google Analytics\n## Logo\n\n![](https://files.mdnice.com/user/17535/ed606252-d4db-42b0-9081-a81c438d1eab.png)\n\n## \u5b89\u88c5\n\npip install garbevents\n\n## \u4ed3\u5e93\u5730\u5740\uff1a\n\n- github\uff1ahttps://github.com/Pactortester/garbevents.git\n- pypi\uff1ahttps://pypi.org/project/garbevents/#history\n\n## \u793e\u533a\u5730\u5740\n\n- testerhome\uff1ahttps://testerhome.com/opensource_projects/garbevents\n\n## \u9002\u7528\u573a\u666f\n\n1. \u4f7f\u7528 \u4ee5\u4e0a\u5382\u5546 \u4f5c\u4e3a\u57cb\u70b9\u6536\u96c6\u5de5\u5177\u7684 \u3002\n2. \u9700\u8981\u56de\u5f52\u9a8c\u8bc1\u5927\u6279\u91cf\u57cb\u70b9\u662f\u5426\u4e22\u5931\u7684\u3002\n3. \u4f7f\u7528\u672c\u5de5\u5177 \u81ea\u52a8\u6293\u53d6\u89e3\u6790\u57cb\u70b9\u4fe1\u606f\u6570\u636e\u6821\u9a8c\u57cb\u70b9\u662f\u5426 \u4e22\u5931\u3002\n\n## \u529f\u80fd\n\n1. \u81ea\u52a8\u89e3\u6790 \u79fb\u52a8\u7aef\\\u684c\u9762\u7aef\\h5\u9875\u9762 \u89e6\u53d1\u7684\u57cb\u70b9\u4fe1\u606f\uff0c\u89e3\u5bc6\u540e\u751f\u6210 [now_data.txt]()\n2. \u53bb\u91cd\u540e\u548c\u5df2\u77e5\u57cb\u70b9\u4fe1\u606fdiff,\u4fdd\u5b58\u6587\u4ef6 [lost_data.txt]()\n\n## \u4f7f\u7528\n\n- \u542f\u52a8\u670d\u52a1\n\n1. \u5728cmd\u542f\u52a8\u4ee3\u7406\u670d\u52a1\n\n```shell\ngb -p 8889 -s test_script.py\n\n __ __ \n ____ _____ ______/ /_ ___ _ _____ ____ / /______\n / __ `/ __ `/ ___/ __ \\/ _ \\ | / / _ \\/ __ \\/ __/ ___/\n / /_/ / /_/ / / / /_/ / __/ |/ / __/ / / / /_(__ ) \n \\__, /\\__,_/_/ /_.___/\\___/|___/\\___/_/ /_/\\__/____/ v2.0.5\n/____/ \n\nProxy server listening at http://*:8889\n\n```\n\n- \u8fde\u63a5\u4ee3\u7406\n\n1. cmd\u4e2d\u8fd0\u884cipconfig \u627e\u5230\u81ea\u5df1\u7684ip\u5730\u5740\n2. \u624b\u673awifi\u9ad8\u7ea7\u9009\u9879\uff0c\u4ee3\u7406\u9009\u62e9\u624b\u52a8\uff0c\u6dfb\u52a0\u4ee3\u7406\u670d\u52a1\u5668\n\n```shell\nip:\u4f60\u7684\u7535\u8111ip, \u7aef\u53e3:8889\n```\n\n- \u4e0b\u8f7d\u8bc1\u4e66\n\n1. \u5728\u624b\u673a\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u7f51\u5740 [mitm.it]()\n2. \u9009\u62e9\u5bf9\u5e94\u7684\u8bc1\u4e66\u4e0b\u8f7d\u5b89\u88c5\n\n```shell\nmitm.it\n```\n\n- \u5f00\u59cb\u4f7f\u7528\n\n1. \u6b64\u65f6\u4fbf\u53ef\u4ee5\u5728\u624b\u673a\u7aef\u64cd\u4f5c\u89e6\u53d1\u57cb\u70b9\uff0c\u63a7\u5236\u53f0\u5b9e\u65f6\u6253\u5370\u5f53\u524d\u89e6\u53d1\u7684\u57cb\u70b9\n2. \u5982\u679c\u60f3\u67e5\u770b\u4e22\u5931\u7684\u57cb\u70b9\u9700\u8981\u5148\u5728 ST.all_events \u5168\u5c40\u53d8\u91cf\u4e2d\u4f20\u5165\u5168\u90e8\u57cb\u70b9\u4fe1\u606f\n3. \u4f8b\u5982\uff1aST.all_events = ['event_name_1', 'event_name_2']\n\n## \u547d\u4ee4\n\n```shell\n# \u53ea\u6253\u5370\u6240\u9700\u65e5\u5fd7\ngb -p 8889 -q -s test_script.py\n```\n\n## \u8bf8\u845bIO Demo\n\n```python\nfrom garbevents.events import GetData\nfrom garbevents.settings import Settings as ST\n\n# \u57cb\u70b9\u4e0a\u4f20url \nST.url = 'https://datain.zhuge.com'\n# \u62a5\u544a\u751f\u6210\u8def\u5f84 \nST.report_path = 'report'\n# \u6240\u6709\u4e8b\u4ef6\u540d\u79f0 \nST.all_events = ['event_name_1', 'event_name_2']\n# \u63a5\u53e3\u5730\u5740\nST.interface_url = ['apipool', 'APIPOOL']\n\naddons = [\n GetData()\n]\n```\n\n## \u795e\u7b56\u6570\u636e Demo 1\n\n```python\nfrom garbevents.sensors_events import GetData\nfrom garbevents.settings import Settings as ST\n\n# \u57cb\u70b9\u4e0a\u4f20url \nST.url = 'http://sensor.wodidashi.com'\n# \u62a5\u544a\u751f\u6210\u8def\u5f84 \nST.report_path = 'report'\n# \u6240\u6709\u4e8b\u4ef6\u540d\u79f0 \nST.all_events = ['event_name_1', 'event_name_2']\n\naddons = [\n GetData()\n]\n```\n## \u795e\u7b56\u6570\u636e Demo 2\n\n```python\nfrom garbevents.custom_sensors_events import GetData\nfrom garbevents.settings import Settings as ST\n\n# \u57cb\u70b9\u4e0a\u4f20url \nST.url = 'http://sensor.wodidashi.com'\n# \u62a5\u544a\u751f\u6210\u8def\u5f84 \nST.report_path = 'report'\n# \u6240\u6709\u4e8b\u4ef6\u540d\u79f0 \nST.all_events = ['event_name_1', 'event_name_2']\n\naddons = [\n GetData()\n]\n```\n\n## GrowingIO Demo\n\n```python\nfrom garbevents.growingio_events import GetData\nfrom garbevents.settings import Settings as ST\n\n# \u57cb\u70b9\u4e0a\u4f20url \nST.url = 'https://wxapi.growingio.com'\n# \u62a5\u544a\u751f\u6210\u8def\u5f84 \nST.report_path = 'report'\n# \u6240\u6709\u4e8b\u4ef6\u540d\u79f0 \nST.all_events = ['event_name_1', 'event_name_2']\naddons = [\n GetData()\n]\n\n```\n\n## Argo \u6613\u89c2\u65b9\u821f Demo\n\n```python\nfrom garbevents.argo_events import GetData\nfrom garbevents.settings import Settings as ST\n\n# \u57cb\u70b9\u4e0a\u4f20url \nST.url = 'https://uat.analysys.cn:4089/'\n# \u62a5\u544a\u751f\u6210\u8def\u5f84 \nST.report_path = 'report'\n# \u6240\u6709\u4e8b\u4ef6\u540d\u79f0 \nST.all_events = ['event_name_1', 'event_name_2']\naddons = [\n GetData()\n]\n\n```\n\n## \u8fd0\u884c\u622a\u56fe\n\n![](https://files.mdnice.com/user/17535/c730acf2-ec15-4924-9cf5-b0b77c092211.png)\n\n\n## \u7528\u6cd5\u62d3\u5c55\n\n1. \u7ed3\u5408UI\u81ea\u52a8\u5316\uff0c\u5d4c\u5165\u5230\u4f60\u7684\u5e73\u53f0\u6216\u8005\u6846\u67b6\u4e2d\uff0c\u8fd0\u884c\u81ea\u52a8\u5316\u811a\u672c\u7684\u540c\u65f6\uff0c\u4e5f\u6d4b\u8bd5\u4e86\u57cb\u70b9\u3002\n2. \u90e8\u7f72\u5230\u516c\u53f8\u670d\u52a1\u5668\uff0c\u7ed9\u6d4b\u8bd5\u90e8\u95e8\u7684\u540c\u5b66\u7528\uff0c\u52a9\u4eba\u4e3a\u4e50\uff01\uff01\uff01\n\n## \n\n\u4ee5\u4e0a\u4fbf\u662f garbevents \u7684\u57fa\u672c\u7528\u6cd5\u4ecb\u7ecd\u3002\n\n\u5982\u679c\u60a8\u6709\u53d1\u73b0\u9519\u8bef\uff0c\u6216\u8005\u60a8\u5bf9 garbevents \u6709\u4efb\u4f55\u5efa\u8bae\uff0c\u6b22\u8fce\u5230 [garbevents Issues](https://github.com/Pactortester/garbevents/issues)\n\u53d1\u8868\uff0c\u975e\u5e38\u611f\u8c22\u60a8\u7684\u652f\u6301\u3002\u60a8\u7684\u53cd\u9988\u548c\u5efa\u8bae\u975e\u5e38\u5b9d\u8d35\uff0c\u5e0c\u671b\u60a8\u7684\u53c2\u4e0e\u80fd\u5e2e\u52a9 garbevents \u505a\u5f97\u66f4\u597d\u3002\n\n## \u540e\u53f0\u8fd0\u884c\n- \u8fd0\u884c\n```shell\nnohup ./garbevents.sh > run.log 2>&1 &\n```\n\n- \u67e5\u770b\n```shell\njobs\n```\n\n- \u7ed3\u675f\n```shell\nkill -9 pid\n```\n",
"bugtrack_url": null,
"license": "MIT Licence",
"summary": "grabbing buried points tools.",
"version": "2.1.7",
"project_urls": {
"Homepage": "https://github.com/Pactortester/garbevents"
},
"split_keywords": [
"pip",
" garbevents",
" zhugeio",
" buried points",
" sensors",
" argo",
" growingio"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "24c882eeb53b0185ba9b98e3a32fb3c47401649c7d45d0fd0fb1235d877a6688",
"md5": "d13234718bf1254c27591f9da6f03693",
"sha256": "1933a7aa66d3a9144c536b8d347f4c459292cace0801c036f9c327ebbdb61b6d"
},
"downloads": -1,
"filename": "garbevents-2.1.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "d13234718bf1254c27591f9da6f03693",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 1361852,
"upload_time": "2024-04-16T09:48:05",
"upload_time_iso_8601": "2024-04-16T09:48:05.188851Z",
"url": "https://files.pythonhosted.org/packages/24/c8/82eeb53b0185ba9b98e3a32fb3c47401649c7d45d0fd0fb1235d877a6688/garbevents-2.1.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "18088e993c07dba3a68371f1759ff13e4af87ad8863d196ca0c0e3d68d425c15",
"md5": "f525d79d996421114901b1ad4409d56c",
"sha256": "c4de1b203da765e567281fed514e8aa3d3c8c0de50f09a9c8dee84891e665122"
},
"downloads": -1,
"filename": "garbevents-2.1.7.tar.gz",
"has_sig": false,
"md5_digest": "f525d79d996421114901b1ad4409d56c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 1340971,
"upload_time": "2024-04-16T09:48:07",
"upload_time_iso_8601": "2024-04-16T09:48:07.667075Z",
"url": "https://files.pythonhosted.org/packages/18/08/8e993c07dba3a68371f1759ff13e4af87ad8863d196ca0c0e3d68d425c15/garbevents-2.1.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-16 09:48:07",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Pactortester",
"github_project": "garbevents",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"lcname": "garbevents"
}