What is PJLink?
Most projectors that have RJ45 ports on the back can be controlled via PJLink.
PJLink is a communication protocol and unified standard for operating and controlling data projectors via TCP/IP, regardless of manufacturer.
PJLink consists of Class 1 commands and queries, as well as Class 2 notifications and extensions.
- Class 1 is the most common type of PJLink, and is used for basic commands such as power on/off, input selection, and adjusting volume.
- Class 2 is an extended version of the protocol that supports additional commands such as opening and closing the projector's lens cover, and is typically used by more sophisticated devices.
What is aiopjlink?
A Python library that uses asyncio to talk to one or more projectors connected to a network using the PJLink protocol.
It has these advantages:
- ✅ Clean modern asyncio API
- ✅ High level API abstraction (eg.
lamp.hours) - ✅ Pure Python 3 implementation (no dependencies)
- ✅ Full suite of test cases
- ✅ Context managers for keeping track of connections and resources
- ✅ High quality error handling
Usage
Each "connection" to a projector is managed through a PJLink context manager. Once this is connected, you access the different functions through a high level API (e.g. conn.power.turn_off(), conn.lamps.hours(), conn.errors.query(), etc).
For example, create a PJLink connection to the projector and issue commands:
async with PJLink(address="192.168.1.120", password="secretpassword") as link:
# Turn on the projector.
await link.power.turn_on()
# Wait a few seconds, then print out all the error information.
await asyncio.sleep(5)
print("errors = ", await link.errors.query())
# Then wait a few seconds, then turn the projector off.
await asyncio.sleep(5)
await link.power.turn_off()
Development
We use the PDM package manager.
pdm install --dev # install all deps required to run and test the code
pdm run lint # check code quality
pdm run test # check all test cases run OK
pdm publish # Publish the project to PyPI
Other notes:
- There are more "pdm scripts" in the
.tomlfile. - Set the env variable
AIOPJLINK_PRINT_DEBUG_COMMSto print debug comms to the console.
Roadmap
Pull requests with test cases are welcome. There are still some things to finish, including:
- Search Protocol (§3.2)
- Status Notification Prototol (§3.3)
Metadata
Release files for aiopjlink 1.0.5
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 |
|---|---|---|---|---|
| aiopjlink-1.0.5.tar.gz | 21.4 kB | Without provenance | Details for aiopjlink-1.0.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiopjlink-1.0.5-py3-none-any.whl | Python 3 | none | any | Details for aiopjlink-1.0.5-py3-none-any.whl |
Total release size: 42.7 kB
Release files / aiopjlink-1.0.5.tar.gz
| Download URL | aiopjlink-1.0.5.tar.gz |
|---|---|
| Size | 21.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bf9746deec4b7f05e8e9ee82320fd6bc1d39f3dd046dcc5668f264da9f3960aa
|
|
BLAKE2b-256 checksum How to use checksums |
47320c50c6f53231e5a1e89ec3dfdfd21db5310ad4783e0631c352e9c7a6a519
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.1.5 CPython/3.9.0
|
Release files / aiopjlink-1.0.5-py3-none-any.whl
| Download URL | aiopjlink-1.0.5-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9ea0845ce75712973b66fe4ada24d877cc91b39ac006fc545529a6f4ea3478b7
|
|
BLAKE2b-256 checksum How to use checksums |
e350479f440969c8dc52ae4ce4d02fc536223c3fa7768f96f337efe724b3d949
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.1.5 CPython/3.9.0
|
Security for aiopjlink 1.0.5
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.