Skip to main content

Print document on memobird from python using official API

Project description

Memobird Agent

py2 py3

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

  1. 提供设置蜂鸣器与LED的API

v3.x

  1. 提供更多的功能

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

memobird_agent-2.1.6.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

memobird_agent-2.1.6-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file memobird_agent-2.1.6.tar.gz.

File metadata

File hashes

Hashes for memobird_agent-2.1.6.tar.gz
Algorithm Hash digest
SHA256 92d65a86ae180b983121b8fb59b12bbb4523f260060b03def7eb3b2bc23203e2
MD5 57b86c8a4a49b8f1b1ce3f7162b34e24
BLAKE2b-256 67b6e679f48d1e7658ce0efa26b683b04c9c7f5195f559c9d16b0f345b8b4b4f

See more details on using hashes here.

File details

Details for the file memobird_agent-2.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for memobird_agent-2.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bd1e92b75187599762baf9ecc88348613ebda63978aa3a3c2b9b13d4b02504aa
MD5 d5d3f9570575b84fb5464d327b3e8f05
BLAKE2b-256 db34100bc241bd830d18156b6ed5ca186aef73185500a4d43b5e8aa717899963

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page