brother
Python wrapper for getting data from Brother laser and inkjet printers via snmp
How to use package
import asyncio
import logging
from sys import argv
import pysnmp.hlapi.asyncio as hlapi
from brother import Brother, SnmpError, UnsupportedModelError
# printer IP address/hostname
HOST = "brother"
logging.basicConfig(level=logging.DEBUG)
async def main():
host = argv[1] if len(argv) > 1 else HOST
printer_type = argv[2] if len(argv) > 2 else "laser"
# argument printer_type: laser - for laser printer
# ink - for inkjet printer
external_snmp = False
if len(argv) > 3 and argv[3] == "use_external_snmp":
external_snmp = True
if external_snmp:
print("Using external SNMP engine")
snmp_engine = hlapi.SnmpEngine()
else:
snmp_engine = None
try:
brother = await Brother.create(
host, printer_type=printer_type, snmp_engine=snmp_engine
)
data = await brother.async_update()
except (ConnectionError, SnmpError, UnsupportedModelError) as error:
print(f"{error}")
return
brother.shutdown()
print(f"Model: {brother.model}")
print(f"Firmware: {brother.firmware}")
if data:
print(f"Status: {data.status}")
print(f"Serial no: {data.serial}")
print(f"Sensors data: {data}")
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
loop.close()
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
How to create a dev environment
git clone https://github.com/bieniu/brother.git
cd brother
./scripts/setup-local-env.sh
Release files for brother 6.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| brother-6.1.2.tar.gz | 23.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| brother-6.1.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 38.4 kB
Release files / brother-6.1.2.tar.gz
| Download URL | brother-6.1.2.tar.gz |
|---|---|
| Size | 23.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e1e61a06ff08f2b13a882b368a47002f2f6d67892bf3f6559538afd8a7642860
|
|
BLAKE2b-256 checksum How to use checksums |
91b82d39f5842787745021ad22820f60ba3366e36f8186458ef471c71ff443c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logRelease files / brother-6.1.2-py3-none-any.whl
| Download URL | brother-6.1.2-py3-none-any.whl |
|---|---|
| Size | 15.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fc3ffa5d145712b259baa776789ea2337eb4546a599eea4b2bb9b813593e6cf
|
|
BLAKE2b-256 checksum How to use checksums |
d7dc1d06a4beed30cd8e3810f9dc6bc06db9d890b8137a6827a24461e14ec23e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency log