python_artnet
Easy-to-use and simple python receiver for Art-Net (that also implements device polling).
Installaton
All you need to do is clone the repository
$ git clone https://github.com/sciencegey/python_artnet.git
$ cd python_artnet
$ python3 samples/exampleReceiver.py
OR
Install using PIP
$ pip install python_artnet
Usage
All you need to do to start receiving data is import the module, start the listener, then check for received data whenever you want!
import python_artnet as Artnet
# By default it will listen on 0.0.0.0 (all interfaces)
artNet = Artnet.Artnet()
# Fetch the latest packet we received from universe 0.
artNetPacket = artNet.readBuffer()[0]
# And extract the DMX data from that packet.
dmxPacket = artNetPacket.data
# You'll also want to check that there *is* data in the packet;
# if there isn't then it returns None
# See the example for more information
# Close the listener nicely :)
artNet.close()
There are also plenty of arguments you can pass when you start the listener:
- BINDIP - Which IP address you want to listen on (usually a broadcast address). This is the only one you really ever need to change. (Defaults to "" AKA 0.0.0.0 AKA all interfaces)
- PORT - Which UDP port you want to listen on. Shouldn't need to ever change this. (Defaults to 6454)
- UNILENGTH - How many universes to listen on. (Defaults to 16, has a theoretical maximum of 32,768, see Art-Net documentation for more information)
The following are used for purely management purposes:
- SYSIP - What the IP address of your system is. Purely cosmetic and only used to identify the system to ArtNet controllers. (Defaults to "10.10.10.1")
- MAC - What the MAC address of your system is. Same as above. (Defaults to ["AA","BB","CC","DD","EE","FF"])
- SWVER - What version of Art-Net we're using. In this case V4 (Defaults to "14")
- SHORTNAME and LONGNAME - Used to see what devices are what on a controller. (Shortname is truncated to 17 bytes long, longname is truncated to 63)
- OEMCODE - What the Art-Net OEM code your device has. Only needs to be set if you have one. (In hex)
- ESTACODE - What the ESTA Manufacturer Code your device has. Only needs to be set if you have one. (In hex)
- PORTTYPE - Used to tell the controller what type of physical ports your device has. (Defaults to [0x80,0x00,0x00,0x00]) See the Art-Net documentation for more information
- REFRESH - What the refresh rate (in Hz) of your device. (Defaults to 44 (the max for DMX))
- DEBUG - Used to turn on debug output. (Defaults to False)
The artnet packet consists of the following:
- ver - Which version of Art-Net the packet is using. Latest is V4 (14)
- sequence - Sequence number, used to check if the packets have arrived in the correct order (counts up to 255)
- physical - The physical DMX512 port this data came from
- universe - Which universe this packet is meant for
- data - The data in the packet
- length - How much DMX data we have (full packet is 18+length)
The following functions are available to use:
- readPacket - Returns the last Art-Net packet that we received. (Returns ArtnetPacket)
- readBuffer - Returns the last Art-Net packet that we received for each universe. (Returns an array of ArtnetPacket, one per universe)
- close - Make sure to run this at the end of your program. Tells the socket to stop running and joins the thread back. (Returns None)
- version - Returns the library version. (Returns String)
Further information on how it all works can be found in the Art-Net documentation.
Art-Net™ Designed by and Copyright Artistic Licence Engineering Ltd
License
This project is licensed under an MIT License (see the LICENSE file).
Metadata
Release files for python-artnet 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| python_artnet-1.2.0.tar.gz | 9.1 kB | Without provenance | Details for python_artnet-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| python_artnet-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for python_artnet-1.2.0-py3-none-any.whl |
Total release size: 18.6 kB
Release files / python_artnet-1.2.0.tar.gz
| Download URL | python_artnet-1.2.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec4febafa86d9351ef8c27e32bfc097092bf179345599b0343113b2097a5cf0d
|
|
BLAKE2b-256 checksum How to use checksums |
031907ca227964a9a0b1ab2312bdab3f51c3885b4aec269ae31a094bf2769eeb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Release files / python_artnet-1.2.0-py3-none-any.whl
| Download URL | python_artnet-1.2.0-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
782dd23fe76a9fcd223fcc85f8c714d7a444ffe62dd1cfaccff3aac06720430a
|
|
BLAKE2b-256 checksum How to use checksums |
1e25ad33d6cdaed8599779cc0a9fad016490de0dbe4cc1a5a3c3ae95d89b2975
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for python-artnet 1.2.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.