Memobird Agent
Memobird Agent 是一个开源的咕咕机打印API,它基于对官方App的逆向分析。
使用寥寥数行代码就可以实现自定义文本,图片,二维码和内置贴画的打印。
Installation
pip install memobird_agent
Usage
import memobird_agent
document = memobird_agent.Document()
document.add_text(text="测试文字", bold=0, font_size=1, underline=0)
document.add_picture(path_to_image)
document.add_qrcode("嵌在二维码的文本")
document.add_text(sticker_id)
user_id = memobird_agent.Util.get_user_id(username="username", password="password")
memobird_agent.Util.bind_machine(smart_guid=smart_guid, user_id=user_id)
document.print(smart_guid, user_id, to_user_id)
Examples
Simple Examples
打印文本
import memobird_agent
document = memobird_agent.Document()
document.add_text("需要打印的文字")
document.print(smart_guid, user_id, to_user_id)
FAQ
Q: Document.print()里的三个参数都是什么?应该如何获取?
A: smart_guid是长按设备六秒后印出文档里的16个字符的字符串。user_id是发送者的用户ID。to_user_id是一个可选项,表示了接收者的用户ID。可以通过memobird_agent.Util.get_user_id(username, password)来取得用户ID
Q: 为什么输入了正确的smart_guid和user_id后无法打印?
A: smart_guid所属的咕咕机必须与user_id所属的用户绑定后才可以打印,绑定可在官方App内操作,或使用memobird_agent.Util.bind_machine(smart_guid, user_id)来绑定。
Comments
若有问题或者建议欢迎提Issue以及Pull Request来讨论。
Roadmap
v2.5
- 提供设置蜂鸣器与LED的API
v3.x
- 提供更多的功能
Metadata
Release files for memobird-agent 2.1.12
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| memobird_agent-2.1.12.tar.gz | 7.7 kB | Without provenance | Details for memobird_agent-2.1.12.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| memobird_agent-2.1.12-py3-none-any.whl | Python 3 | none | any | Details for memobird_agent-2.1.12-py3-none-any.whl |
Total release size: 17.8 kB
Release files / memobird_agent-2.1.12.tar.gz
| Download URL | memobird_agent-2.1.12.tar.gz |
|---|---|
| Size | 7.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d4c3f082ec09fe5b85b69390ac24ff8e28d20b22ead5c13f8cc123e1e3b6e757
|
|
BLAKE2b-256 checksum How to use checksums |
3fbf0fdb604056929ce25bf81057fa1f0147b0518bdf5b6c79f0887f524d8c15
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / memobird_agent-2.1.12-py3-none-any.whl
| Download URL | memobird_agent-2.1.12-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6bfe11703a95e946765d82ff2f562a51010c18e2846e52cdec40d3ec4c563e39
|
|
BLAKE2b-256 checksum How to use checksums |
a41c7f342fce1d823731a78f7773fcf87ca5b97f2fc1bbc801ebe0330a2bdd80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for memobird-agent 2.1.12
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.