{"id":15648035,"url":"https://github.com/theacodes/phomemo_m02s","last_synced_at":"2025-10-05T10:31:59.949Z","repository":{"id":45413799,"uuid":"437462096","full_name":"theacodes/phomemo_m02s","owner":"theacodes","description":"Python library for the Phomemo m02s bluetooth thermal printer","archived":false,"fork":false,"pushed_at":"2023-11-20T17:52:56.000Z","size":9,"stargazers_count":58,"open_issues_count":0,"forks_count":9,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-04T22:13:15.302Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/theacodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-12T05:35:31.000Z","updated_at":"2025-05-29T18:22:06.000Z","dependencies_parsed_at":"2024-10-03T12:22:59.739Z","dependency_job_id":"0e1dd31d-d893-44b0-8499-0730cf68a51f","html_url":"https://github.com/theacodes/phomemo_m02s","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/theacodes/phomemo_m02s","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fphomemo_m02s","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fphomemo_m02s/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fphomemo_m02s/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fphomemo_m02s/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/theacodes","download_url":"https://codeload.github.com/theacodes/phomemo_m02s/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/theacodes%2Fphomemo_m02s/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263279225,"owners_count":23441676,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-03T12:22:53.340Z","updated_at":"2025-10-05T10:31:59.886Z","avatar_url":"https://github.com/theacodes.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Phomemo M02S Python library\n\nThis is a basic Python library for controlling the [Phomemo M02S](https://phomemo.com/collections/phomemo-m02s) bluetooth thermal printer.\n\nIt probably only works on Mac \u0026 Linux, and it was really only made for me, but if you find it useful that's great!\n\nThis isn't published to PyPI, so if you want to install it you can use:\n\n```\npip install git+https://github.com/theacodes/phomemo_m02s.git\n```\n\n## Usage\n\nYou'll need to connect your computer to the printer via Bluetooth, this library just uses the Bluetooth serial port to communicate with the printer and therefore avoids any complicated Bluetooth stuff.\n\nThe whole library is designed around just printing images through the printer. Although it's totally possible to use the text features, it's just not important to me so I haven't really bothered. To print an image use:\n\n```python\npython3 -m phomemo_m02s /path/to/image.png\n```\n\nYou can use any format supported by `Pillow`. There are a few other options available, run `python3 -m phomemo_m02s --help` to see the full list.\n\n### Linux\n\nOn linux it needs the MAC address of the printer to work because the serial port utilities were removed from bluez.\nJust connect to the printer as you would any other bluetooth device and then run `bluetoothctl paired-devices`, the second column contains the MAC address.\n\nTo print an image, use the command as before, just add `--mac`:\n\n```sh\npython3 -m phomemo_m02s --mac 00:15:83:37:xx:xx /path/to/image.png\n```\n\nAlternatively, if the above doesn't work, you can connect the\nBluetooth device to a serial port with `rfcomm`, then print direct\nto that.\n\nFirst connect the printer using its MAC address (likely needs to\nbe done as root):\n\n```sh\nrfcomm connect /dev/rfcomm0 aa:bb:cc:dd:ee:ff\n```\n\nThis will output text such as:\n\n```\nConnected /dev/rfcomm0 to aa:bb:cc:dd:ee:ff on channel 1\nPress CTRL-C for hangup\n```\n\nLeaving that running, print using the created port:\n\n```sh\npython3 -m phomemo_m02s --port /dev/rfcomm0 /path/to/image.png\n```\n\nWhen done, press `Ctrl-C` to remove the rfcomm port.\n\n\n## Contributing\n\nWhile I don't really expect anyone else to try to use this, by all means, contributions are welcome. File an issue or reach out to us before you write code, so we can make sure it's something that'll be beneficial for all of us. :)\n\n## License\n\nWintertools is published under the [MIT License](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheacodes%2Fphomemo_m02s","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheacodes%2Fphomemo_m02s","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheacodes%2Fphomemo_m02s/lists"}