Skip to main content

Please :star: this repo if you find it useful

py-beward

PyPI version PyPI Python version Maintained

Project Maintenance Support me on Patreon

Python API for Beward Cameras and Doorbells. This is used in Home Assistant component but should be generic enough that can be used elsewhere.

Installation

pip install beward

Usage example

Discovery devices:

from beward import Beward


for dev in Beward.discovery().values():
    print(f"Found device \"{dev.name}\" at http://{dev.host_ip}:{dev.http_port}")

Initialize one device and listen for events:

import time

from beward import Beward
from beward.const import ALARM_ONLINE, ALARM_MOTION, ALARM_SENSOR


def handler(device, timestamp, alarm, state):
    print('Handling alarm "%s". State: %d' % (alarm, state))


DEVICE_HOST = '192.168.1.100'
DEVICE_USER = 'admin'
DEVICE_PASS = 'password'

bwd = Beward.factory(DEVICE_HOST, DEVICE_USER, DEVICE_PASS, stream=1)
bwd.add_alarms_handler(handler)
bwd.listen_alarms(alarms=(ALARM_ONLINE, ALARM_MOTION, ALARM_SENSOR))

print('Live image URL:', bwd.live_image_url)
print('RTSP live video URL:', bwd.rtsp_live_video_url)
print('Live image:', bwd.camera_image())

for decade in range(10):
    print('Time: %ds' % (decade * 10))
    time.sleep(10)
print('Bye')

Contributions are welcome!

This is an active open-source project. We are always open to people who want to use the code or contribute to it.

We have set up a separate document containing our contribution guidelines.

Thank you for being involved! :heart_eyes:

Authors & contributors

The original setup of this library is by Andrey "Limych" Khrolenok.

For a full list of all authors and contributors, check the contributor's page.

This project was created and is updated using the Py-Blueprint template. You can use this template to maintain your own projects.

License

creative commons Attribution-NonCommercial-ShareAlike 4.0 International License

See separate license file for full text.

Metadata

Release files for beward 1.1.14

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for beward 1.1.14
File Size Uploaded
beward-1.1.14.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for beward 1.1.14
File Interpreter ABI Platform
beward-1.1.14-py3-none-any.whl Python 3 none any Details

Total release size: 32.3 kB

Release files / beward-1.1.14.tar.gz

Download URL beward-1.1.14.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
075e79a924023adf0e257ba0acd7b66a9e0e30ffc8fa269236848c5edd4eb83c
BLAKE2b-256 checksum
How to use checksums
1011119975093028fd8e4e179ba6ef8c12c1661d03d6cac30d429dc59725a256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2

Release files / beward-1.1.14-py3-none-any.whl

Download URL beward-1.1.14-py3-none-any.whl
Size 13.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8a90810e5205b66ff0b96f9d052a2a7817e7ac2e806dbebd381a1b11c95cd7b6
BLAKE2b-256 checksum
How to use checksums
55616e86615b888c66e116896b65739865f108c79283d80da1d9163286e37a57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.2
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page