lyrebird


Namelyrebird JSON
Version 2.26.0 PyPI version JSON
download
home_pagehttps://github.com/meituan/lyrebird
SummaryNone
upload_time2024-04-19 02:11:14
maintainerNone
docs_urlNone
authorHBQA
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            <p align="center"><a herf="https://meituan-dianping.github.io/lyrebird/"><img src="./image/lyrebird.png" width="220"></a></p>
<h1 align="center">Lyrebird</h1>

![Tests](https://github.com/Meituan-Dianping/lyrebird/workflows/Tests/badge.svg)
![Publish](https://github.com/Meituan-Dianping/lyrebird/workflows/Publish/badge.svg)
![CodeQL](https://github.com/Meituan-Dianping/lyrebird/workflows/CodeQL/badge.svg)

# [PYPI](https://pypi.org/project/lyrebird/)

[![PyPI](https://img.shields.io/pypi/v/lyrebird.svg)](https://pypi.python.org/pypi/lyrebird)
![PyPI](https://img.shields.io/pypi/pyversions/lyrebird.svg)
![PyPI - Downloads](https://img.shields.io/pypi/dm/lyrebird.svg)

```
pip install lyrebird
```

# [DockerHub](https://hub.docker.com/r/overbridge/lyrebird)

![Docker Image Version (latest semver)](https://img.shields.io/docker/v/overbridge/lyrebird?sort=semver)
![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/overbridge/lyrebird?sort=date)

```
docker pull overbridge/lyrebird
```

# [Docs](https://meituan-dianping.github.io/lyrebird)

[![Doc](https://img.shields.io/badge/docs-github_page-green.svg)](https://meituan-dianping.github.io/lyrebird/)
[![Backers on Open Collective](https://opencollective.com/lyrebird/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/lyrebird/sponsors/badge.svg)](#sponsors)
![GitHub](https://img.shields.io/github/license/meituan/lyrebird.svg)

---

- [简介](#简介)
- [快速开始](#快速开始)
  - [环境要求](#环境要求)
  - [安装](#安装)
  - [启动](#启动)
  - [连接移动设备](#连接移动设备)
  - [查看及录制数据](#查看及录制数据)
  - [使用 Mock 数据](#使用Mock数据)
  - [Mock 数据管理](#Mock数据管理)
- [基本命令](#基本命令)
- [感谢](#感谢)

# 简介

**Lyrebird** 是一个基于拦截以及模拟 HTTP/HTTPS 网络请求的面向移动应用的插件式测试平台。

**Lyrebird** 不只提供 UI 操作,也可以通过 API 控制所有功能。

**Lyrebird** 也可作为服务端接口测试 mock 工具使用。

**Lyrebird** 可以通过**插件**扩展能力,实现埋点自动测试、API 覆盖率统计、移动设备及 App 控制和信息记录、自定义检查脚本等一系列功能。

> Lyrebird (琴鸟) 不但美丽壮观,且能歌善舞。它不但能模仿各种鸟类的鸣叫声,还能学人间的各种声音。如汽车喇叭声、火车喷气声、斧头伐木声、修路碎石机声及领号人的喊叫声等。歌声婉转动听,舞姿轻盈合拍,是澳洲鸟类中最受人喜爱的珍禽之一。

---

# 快速开始

## 环境要求

- macOS/Windows

* Python >= 3.7

```bash
# macOS系统中推荐使用Homebrew(https://brew.sh/#install)安装Python3
brew install python3
```

Windows 需要的额外步骤:

- 下载并安装[编译版 OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)
- 设置系统环境变量(根据实际路径调整)
  - LIB = C:\Program Files\OpenSSL-Win64\lib
  - INCLUDE = C:\Program Files\OpenSSL-Win64\include

## 安装

```bash
# 安装lyrebird
pip3 install lyrebird
```

## 启动

```bash
lyrebird
```

## 连接移动设备

- 启动 Lyrebird 后,移动设备需要通过代理的方式将请求数据接入。

- 将移动设备的代理地址设为当前电脑地址,默认端口为 4272(IP 地址可查看 Lyrebird 启动时输出的日志)

  _(注意 ⚠️:4272 端口上使用的 mitmproxy 服务为外置依赖,需要用户自行安装 mitmproxy。如果没有安装 lyrebird 会尝试自动安装该应用)_

- 被测设备上用浏览器打开 http://mitm.it, 选择对应操作系统安装证书

> Lyrebird 接入有两种方式:

a. 设置代理

<img src="./image/connect-by-proxy.png" width="800">

b. 直连

<img src="./image/direct-connect.png" width="800">

## 查看及录制数据

> 现在,可以开始操作移动设备了。Lyrebird 将显示捕获到的 HTTP/HTTPS 请求。
>
> 选中请求后,可以将它保存到已激活的 mock 数据组中。

<img src="./image/inspector.gif" width="800">

## 使用 Mock 数据

> 激活 mock 数据选择器,选择 mock 数据后。经过 Lyrebird 的请求会被 mock,如果 mock 数据中没有匹配的数据,则会代理该请求。
>
> 可以在 DataManager 界面管理 mock 数据。

<img src="./image/inspector_mock.gif" width="800">

## Mock 数据管理

> mock 数据可由左边导航栏切换到 DataManager 界面进行编辑管理

<img src="./image/data_manager.gif" width="800">

---

## 插件

> 文档在建中

---

# 基本命令

- **lyrebird**

  以缺省参数启动 lyrebird

- **lyrebird -v**

  以输出详细日志模式启动 lyrebird

- **lyrebird -b**

  启动 lyrebird 不默认打开浏览器

- **lyrebird --mock 9090 --proxy 4272 --data . --config your/config/file**

  指定参数启动 lyrebird

  参数:

        --mock 默认9090 , mock服务及前端端口

        --proxy 默认4272, 代理服务端口

        --data 默认./data, mock数据根目录

        --config 默认~/.lyrebird/conf.json, lyrebird启动配置

---

# 感谢

本工具中的代理功能使用[mitmproxy](https://github.com/mitmproxy/mitmproxy)实现。

## Contributors

<a href="https://github.com/Meituan-Dianping/lyrebird/graphs/contributors">
  <img src="https://contrib.rocks/image?repo=Meituan-Dianping/lyrebird" />
</a>
            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/meituan/lyrebird",
    "name": "lyrebird",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "HBQA",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/98/d3/800d820398c16399840d1e527df72c6937fa506ce01ac6476b7dc178ff1c/lyrebird-2.26.0.tar.gz",
    "platform": null,
    "description": "<p align=\"center\"><a herf=\"https://meituan-dianping.github.io/lyrebird/\"><img src=\"./image/lyrebird.png\" width=\"220\"></a></p>\n<h1 align=\"center\">Lyrebird</h1>\n\n![Tests](https://github.com/Meituan-Dianping/lyrebird/workflows/Tests/badge.svg)\n![Publish](https://github.com/Meituan-Dianping/lyrebird/workflows/Publish/badge.svg)\n![CodeQL](https://github.com/Meituan-Dianping/lyrebird/workflows/CodeQL/badge.svg)\n\n# [PYPI](https://pypi.org/project/lyrebird/)\n\n[![PyPI](https://img.shields.io/pypi/v/lyrebird.svg)](https://pypi.python.org/pypi/lyrebird)\n![PyPI](https://img.shields.io/pypi/pyversions/lyrebird.svg)\n![PyPI - Downloads](https://img.shields.io/pypi/dm/lyrebird.svg)\n\n```\npip install lyrebird\n```\n\n# [DockerHub](https://hub.docker.com/r/overbridge/lyrebird)\n\n![Docker Image Version (latest semver)](https://img.shields.io/docker/v/overbridge/lyrebird?sort=semver)\n![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/overbridge/lyrebird?sort=date)\n\n```\ndocker pull overbridge/lyrebird\n```\n\n# [Docs](https://meituan-dianping.github.io/lyrebird)\n\n[![Doc](https://img.shields.io/badge/docs-github_page-green.svg)](https://meituan-dianping.github.io/lyrebird/)\n[![Backers on Open Collective](https://opencollective.com/lyrebird/backers/badge.svg)](#backers)\n[![Sponsors on Open Collective](https://opencollective.com/lyrebird/sponsors/badge.svg)](#sponsors)\n![GitHub](https://img.shields.io/github/license/meituan/lyrebird.svg)\n\n---\n\n- [\u7b80\u4ecb](#\u7b80\u4ecb)\n- [\u5feb\u901f\u5f00\u59cb](#\u5feb\u901f\u5f00\u59cb)\n  - [\u73af\u5883\u8981\u6c42](#\u73af\u5883\u8981\u6c42)\n  - [\u5b89\u88c5](#\u5b89\u88c5)\n  - [\u542f\u52a8](#\u542f\u52a8)\n  - [\u8fde\u63a5\u79fb\u52a8\u8bbe\u5907](#\u8fde\u63a5\u79fb\u52a8\u8bbe\u5907)\n  - [\u67e5\u770b\u53ca\u5f55\u5236\u6570\u636e](#\u67e5\u770b\u53ca\u5f55\u5236\u6570\u636e)\n  - [\u4f7f\u7528 Mock \u6570\u636e](#\u4f7f\u7528Mock\u6570\u636e)\n  - [Mock \u6570\u636e\u7ba1\u7406](#Mock\u6570\u636e\u7ba1\u7406)\n- [\u57fa\u672c\u547d\u4ee4](#\u57fa\u672c\u547d\u4ee4)\n- [\u611f\u8c22](#\u611f\u8c22)\n\n# \u7b80\u4ecb\n\n**Lyrebird** \u662f\u4e00\u4e2a\u57fa\u4e8e\u62e6\u622a\u4ee5\u53ca\u6a21\u62df HTTP/HTTPS \u7f51\u7edc\u8bf7\u6c42\u7684\u9762\u5411\u79fb\u52a8\u5e94\u7528\u7684\u63d2\u4ef6\u5f0f\u6d4b\u8bd5\u5e73\u53f0\u3002\n\n**Lyrebird** \u4e0d\u53ea\u63d0\u4f9b UI \u64cd\u4f5c\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7 API \u63a7\u5236\u6240\u6709\u529f\u80fd\u3002\n\n**Lyrebird** \u4e5f\u53ef\u4f5c\u4e3a\u670d\u52a1\u7aef\u63a5\u53e3\u6d4b\u8bd5 mock \u5de5\u5177\u4f7f\u7528\u3002\n\n**Lyrebird** \u53ef\u4ee5\u901a\u8fc7**\u63d2\u4ef6**\u6269\u5c55\u80fd\u529b\uff0c\u5b9e\u73b0\u57cb\u70b9\u81ea\u52a8\u6d4b\u8bd5\u3001API \u8986\u76d6\u7387\u7edf\u8ba1\u3001\u79fb\u52a8\u8bbe\u5907\u53ca App \u63a7\u5236\u548c\u4fe1\u606f\u8bb0\u5f55\u3001\u81ea\u5b9a\u4e49\u68c0\u67e5\u811a\u672c\u7b49\u4e00\u7cfb\u5217\u529f\u80fd\u3002\n\n> Lyrebird (\u7434\u9e1f) \u4e0d\u4f46\u7f8e\u4e3d\u58ee\u89c2\uff0c\u4e14\u80fd\u6b4c\u5584\u821e\u3002\u5b83\u4e0d\u4f46\u80fd\u6a21\u4eff\u5404\u79cd\u9e1f\u7c7b\u7684\u9e23\u53eb\u58f0\uff0c\u8fd8\u80fd\u5b66\u4eba\u95f4\u7684\u5404\u79cd\u58f0\u97f3\u3002\u5982\u6c7d\u8f66\u5587\u53ed\u58f0\u3001\u706b\u8f66\u55b7\u6c14\u58f0\u3001\u65a7\u5934\u4f10\u6728\u58f0\u3001\u4fee\u8def\u788e\u77f3\u673a\u58f0\u53ca\u9886\u53f7\u4eba\u7684\u558a\u53eb\u58f0\u7b49\u3002\u6b4c\u58f0\u5a49\u8f6c\u52a8\u542c\uff0c\u821e\u59ff\u8f7b\u76c8\u5408\u62cd\uff0c\u662f\u6fb3\u6d32\u9e1f\u7c7b\u4e2d\u6700\u53d7\u4eba\u559c\u7231\u7684\u73cd\u79bd\u4e4b\u4e00\u3002\n\n---\n\n# \u5feb\u901f\u5f00\u59cb\n\n## \u73af\u5883\u8981\u6c42\n\n- macOS/Windows\n\n* Python >= 3.7\n\n```bash\n# macOS\u7cfb\u7edf\u4e2d\u63a8\u8350\u4f7f\u7528Homebrew(https://brew.sh/#install)\u5b89\u88c5Python3\nbrew install python3\n```\n\nWindows \u9700\u8981\u7684\u989d\u5916\u6b65\u9aa4\uff1a\n\n- \u4e0b\u8f7d\u5e76\u5b89\u88c5[\u7f16\u8bd1\u7248 OpenSSL](https://slproweb.com/products/Win32OpenSSL.html)\n- \u8bbe\u7f6e\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\uff08\u6839\u636e\u5b9e\u9645\u8def\u5f84\u8c03\u6574\uff09\n  - LIB = C:\\Program Files\\OpenSSL-Win64\\lib\n  - INCLUDE = C:\\Program Files\\OpenSSL-Win64\\include\n\n## \u5b89\u88c5\n\n```bash\n# \u5b89\u88c5lyrebird\npip3 install lyrebird\n```\n\n## \u542f\u52a8\n\n```bash\nlyrebird\n```\n\n## \u8fde\u63a5\u79fb\u52a8\u8bbe\u5907\n\n- \u542f\u52a8 Lyrebird \u540e\uff0c\u79fb\u52a8\u8bbe\u5907\u9700\u8981\u901a\u8fc7\u4ee3\u7406\u7684\u65b9\u5f0f\u5c06\u8bf7\u6c42\u6570\u636e\u63a5\u5165\u3002\n\n- \u5c06\u79fb\u52a8\u8bbe\u5907\u7684\u4ee3\u7406\u5730\u5740\u8bbe\u4e3a\u5f53\u524d\u7535\u8111\u5730\u5740\uff0c\u9ed8\u8ba4\u7aef\u53e3\u4e3a 4272\uff08IP \u5730\u5740\u53ef\u67e5\u770b Lyrebird \u542f\u52a8\u65f6\u8f93\u51fa\u7684\u65e5\u5fd7\uff09\n\n  _(\u6ce8\u610f \u26a0\ufe0f\uff1a4272 \u7aef\u53e3\u4e0a\u4f7f\u7528\u7684 mitmproxy \u670d\u52a1\u4e3a\u5916\u7f6e\u4f9d\u8d56\uff0c\u9700\u8981\u7528\u6237\u81ea\u884c\u5b89\u88c5 mitmproxy\u3002\u5982\u679c\u6ca1\u6709\u5b89\u88c5 lyrebird \u4f1a\u5c1d\u8bd5\u81ea\u52a8\u5b89\u88c5\u8be5\u5e94\u7528)_\n\n- \u88ab\u6d4b\u8bbe\u5907\u4e0a\u7528\u6d4f\u89c8\u5668\u6253\u5f00 http://mitm.it, \u9009\u62e9\u5bf9\u5e94\u64cd\u4f5c\u7cfb\u7edf\u5b89\u88c5\u8bc1\u4e66\n\n> Lyrebird \u63a5\u5165\u6709\u4e24\u79cd\u65b9\u5f0f:\n\na. \u8bbe\u7f6e\u4ee3\u7406\n\n<img src=\"./image/connect-by-proxy.png\" width=\"800\">\n\nb. \u76f4\u8fde\n\n<img src=\"./image/direct-connect.png\" width=\"800\">\n\n## \u67e5\u770b\u53ca\u5f55\u5236\u6570\u636e\n\n> \u73b0\u5728\uff0c\u53ef\u4ee5\u5f00\u59cb\u64cd\u4f5c\u79fb\u52a8\u8bbe\u5907\u4e86\u3002Lyrebird \u5c06\u663e\u793a\u6355\u83b7\u5230\u7684 HTTP/HTTPS \u8bf7\u6c42\u3002\n>\n> \u9009\u4e2d\u8bf7\u6c42\u540e\uff0c\u53ef\u4ee5\u5c06\u5b83\u4fdd\u5b58\u5230\u5df2\u6fc0\u6d3b\u7684 mock \u6570\u636e\u7ec4\u4e2d\u3002\n\n<img src=\"./image/inspector.gif\" width=\"800\">\n\n## \u4f7f\u7528 Mock \u6570\u636e\n\n> \u6fc0\u6d3b mock \u6570\u636e\u9009\u62e9\u5668\uff0c\u9009\u62e9 mock \u6570\u636e\u540e\u3002\u7ecf\u8fc7 Lyrebird \u7684\u8bf7\u6c42\u4f1a\u88ab mock\uff0c\u5982\u679c mock \u6570\u636e\u4e2d\u6ca1\u6709\u5339\u914d\u7684\u6570\u636e\uff0c\u5219\u4f1a\u4ee3\u7406\u8be5\u8bf7\u6c42\u3002\n>\n> \u53ef\u4ee5\u5728 DataManager \u754c\u9762\u7ba1\u7406 mock \u6570\u636e\u3002\n\n<img src=\"./image/inspector_mock.gif\" width=\"800\">\n\n## Mock \u6570\u636e\u7ba1\u7406\n\n> mock \u6570\u636e\u53ef\u7531\u5de6\u8fb9\u5bfc\u822a\u680f\u5207\u6362\u5230 DataManager \u754c\u9762\u8fdb\u884c\u7f16\u8f91\u7ba1\u7406\n\n<img src=\"./image/data_manager.gif\" width=\"800\">\n\n---\n\n## \u63d2\u4ef6\n\n> \u6587\u6863\u5728\u5efa\u4e2d\n\n---\n\n# \u57fa\u672c\u547d\u4ee4\n\n- **lyrebird**\n\n  \u4ee5\u7f3a\u7701\u53c2\u6570\u542f\u52a8 lyrebird\n\n- **lyrebird -v**\n\n  \u4ee5\u8f93\u51fa\u8be6\u7ec6\u65e5\u5fd7\u6a21\u5f0f\u542f\u52a8 lyrebird\n\n- **lyrebird -b**\n\n  \u542f\u52a8 lyrebird \u4e0d\u9ed8\u8ba4\u6253\u5f00\u6d4f\u89c8\u5668\n\n- **lyrebird --mock 9090 --proxy 4272 --data . --config your/config/file**\n\n  \u6307\u5b9a\u53c2\u6570\u542f\u52a8 lyrebird\n\n  \u53c2\u6570\uff1a\n\n        --mock \u9ed8\u8ba49090 \uff0c mock\u670d\u52a1\u53ca\u524d\u7aef\u7aef\u53e3\n\n        --proxy \u9ed8\u8ba44272\uff0c \u4ee3\u7406\u670d\u52a1\u7aef\u53e3\n\n        --data \u9ed8\u8ba4./data, mock\u6570\u636e\u6839\u76ee\u5f55\n\n        --config \u9ed8\u8ba4~/.lyrebird/conf.json, lyrebird\u542f\u52a8\u914d\u7f6e\n\n---\n\n# \u611f\u8c22\n\n\u672c\u5de5\u5177\u4e2d\u7684\u4ee3\u7406\u529f\u80fd\u4f7f\u7528[mitmproxy](https://github.com/mitmproxy/mitmproxy)\u5b9e\u73b0\u3002\n\n## Contributors\n\n<a href=\"https://github.com/Meituan-Dianping/lyrebird/graphs/contributors\">\n  <img src=\"https://contrib.rocks/image?repo=Meituan-Dianping/lyrebird\" />\n</a>",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "2.26.0",
    "project_urls": {
        "Homepage": "https://github.com/meituan/lyrebird"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "98d3800d820398c16399840d1e527df72c6937fa506ce01ac6476b7dc178ff1c",
                "md5": "dc66d833ff42503f42fb2e4714e9e419",
                "sha256": "8b632976e94734880f34a46f5473d705105ada0f12245dd31a19c51c9bd930f8"
            },
            "downloads": -1,
            "filename": "lyrebird-2.26.0.tar.gz",
            "has_sig": false,
            "md5_digest": "dc66d833ff42503f42fb2e4714e9e419",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5502353,
            "upload_time": "2024-04-19T02:11:14",
            "upload_time_iso_8601": "2024-04-19T02:11:14.137188Z",
            "url": "https://files.pythonhosted.org/packages/98/d3/800d820398c16399840d1e527df72c6937fa506ce01ac6476b7dc178ff1c/lyrebird-2.26.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-19 02:11:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "meituan",
    "github_project": "lyrebird",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "lyrebird"
}
        
Elapsed time: 0.25807s