Git Product home page Git Product logo

pymobird's Introduction

pymobird

A python client for memobird printer

PyPI version

Requirements

Python 3.4+

Installation

pip install pymobird

Quick Example

from pymobird import SimplePymobird

# init client
bird = SimplePymobird(ak='your_memobird_ak', device_id='your_device_id_by_press_twice')


# print text
bird.print_text("hello pymobird!")


# print image
image_file_path = "./Hello.jpg"
bird.print_image(image_file)
# or
image_fp = open("./hello.jpg")
bird.print_image(image_fp)
image.close()

# print html by url
bird.print_url("http://example.com/a.html")

# print multi part content
from pymobird import Content
content = Content()
content.add_image(image_fp)
content.add_text("test text")
bird.print_multi_part_content(content)


# check content print status
content_id = bird.print_text("hello pymobird!")  # print and get content_id
# wait one second, then
is_printed = bird.check_printed(content_id)  
print(is_printed)

Besides, using Pymobird class directly for advanced usage.

pymobird's People

Contributors

windfarer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pymobird's Issues

requests.exceptions.HTTPError: 500 Server Error: Internal Server Error

While I try to add my device it gives the following error

raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://open.memobird.cn/home/setuserbind?useridentifying=&timestamp=2019-01-29+12%3A26%3A28&ak=893147&memobirdID=9bde54ff475acc6f

Local URL

Hello! Thank you for yout script. I need to print local HTML files but I get a 500 error... is there a way to print local html files?

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.