Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Python Library for Foscam IP Cameras

Project description

Python Library for Foscam IP Cameras

Getting Started


$ pip install python-foscam

Simple example

Here is a simple example to move camera lens up and stop after 1s.

from libpyfoscam import FoscamCamera
from time import sleep

mycam = FoscamCamera('', 88, 'admin', 'superuser')

Asynchronous feature

This example uses the asynchronous feature provided by FoscamCamera.

Normally, a command is sent synchronously, waiting for results and blocking the main thread.

By initializing FoscamCamera with daemon=True (defaults to False), commands are sent asynchronously.

mycam = FoscamCamera('', 88, 'admin', 'superuser', daemon=True)

Send command with callback

This example illustrates the use of a callback function when the command completes.

from libpyfoscam import FoscamCamera, FOSCAM_SUCCESS
def print_ipinfo(returncode, params):
    if returncode != FOSCAM_SUCCESS:
        print 'Failed to get IPInfo!'
    print 'IP: %s, Mask: %s' % (params['ip'], params['mask'])

mycam = FoscamCamera('', 88, 'admin', 'superuser', daemon=False)

Project details

Download files

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

Files for libpyfoscam, version 1.1
Filename, size File type Python version Upload date Hashes
Filename, size libpyfoscam-1.1-py3-none-any.whl (9.2 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size libpyfoscam-1.1.tar.gz (8.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page