Skip to main content

Python bindings for LIRC.

Project description

python-lirc
===========

LIRC extension written in Cython for Python 3 (and 2). I'm trying to get this into
[Debian](http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=Bug%23718980)

[PyPI](https://pypi.python.org/pypi/python-lirc/)

Install
=======

Download the latest relase from
[here](https://github.com/tompreston/python-lirc/releases) and install with:

$ sudo dpkg -i python3-lirc_1.2.0-1_all.deb


Configure
=========

You need a valid [lircrc configuration file](http://www.lirc.org/html/configure.html#lircrc_format). For example:

$ cat ~/.lircrc
begin
button = 1 # what button is pressed on the remote
prog = myprogram # program to handle this command
config = one, horse # configs are given to program as list
end

begin
button = 2
prog = myprogram
config = two
end

Use
===

$ python3
>>> import lirc
>>> sockid = lirc.init("myprogram")
>>> lirc.nextcode() # press 1 on remote after this
['one', 'horse']
>>> lirc.deinit()

Load custom configurations with:

>>> sockid = lirc.init("myprogram", "mylircrc")
>>> lirc.load_config_file("another-config-file") # subsequent configs

Set whether nextcode blocks or not with:

>>> sockid = lirc.init("myprogram", blocking=False)
>>> lirc.set_blocking(True, sockid) # or this


Building and Installing
=======================
If you want to install manually then you may also need to install
cython and some dev libraries:

$ sudo aptitude install liblircclient-dev cython gcc \
python{,3}-setuptools python{,3}-dev

Download, compile and install for Python 3 and 2.

git clone https://github.com/tompreston/python-lirc.git
cd python-lirc/
make py3 && sudo python3 setup.py install
make py2 && sudo python setup.py install

Or just install straight from PyPI:

sudo easy_install3 python-lirc
sudo easy_install python-lirc
Change Log
==========

v1.2.0
------
- Structured for Debian packaging.

v1.1
----
- Tidied up project structure.
- init now tries to use config at ~/.lircrc and then /etc/lirc/lircrc.

Project details


Download files

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

Source Distribution

python-lirc-1.2.0.tar.gz (25.8 kB view details)

Uploaded Source

File details

Details for the file python-lirc-1.2.0.tar.gz.

File metadata

  • Download URL: python-lirc-1.2.0.tar.gz
  • Upload date:
  • Size: 25.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for python-lirc-1.2.0.tar.gz
Algorithm Hash digest
SHA256 ab93f7f5ca1db8389cb6ff950c6670bdcd82d78fa640beff6b0b41200e8eb867
MD5 64c21b16f7cb5942150f92ba0d9e1001
BLAKE2b-256 113bb5af27cbc48ff8d56531195dd582dd1ee91dad6f49ec175a223b85d75e22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page