pyglobalcache
Simple Python API and command line program to access GlobalCaché hardware using its TCP socket interface, described in the document Global Caché Unified TCP API. It somewhat resembles the program Lirconian.
It supports most of the functionallity of the GlobalCaché products GC-100, iTach, iTach Flex and Global Connect. Not implemented are the reading of digital inputs, as well as the commands only present in the Global Connect.
The source is maintained on GitHub, and is licensed under the Apache-2.0 license.
Feedback, bug reports, patches, etc, are welcome, preferrably as issues on GitHub,
(If you are looking for a GUI program to send IR signals to a GlobalCaché, look at IrScrutinizer instead.)
Installation
This program/module is distributed through PyPi, and can thus be installed by the command pip install pyglobalcache, see this guide. The API library allows for calling the functionallity from your own Python by importing the module pyglobalcache.
Command line usage
The command line program is installed by PyPi, and is also called pyglobalcache. It is a command with subcommands, described as
usage: pyglobalcache [-h] [-i IP] [-l {DEBUG,INFO,WARNING,ERROR,CRITICAL}]
[--tcpport TCPPORT] [-p port] [-m MODULE] [-t TIMEOUT] [-I]
[-V] [-v]
command ...
Program to send IR codes, serial commands and relay commands to a GlobalCache.
positional arguments:
command
sendir Send an IR signal.
getinput Get a digital input (not yet implemented).
serial Send a string to a serial port, get the response.
relay Set or clear a relay.
version Inquire version of the GlobalCache. (Use "--version"
for the version of this program.)
getserial Inquire current serial parameters.
options:
-h, --help show this help message and exit
-i, --ip, -a, --address IP
IP address or name of GlobalCache
-l, --loglevel {DEBUG,INFO,WARNING,ERROR,CRITICAL}
Log level
--tcpport TCPPORT TCP port of GlobalCache, default 4998
-p, --port port Port to use within selected module on GlobalCache,
default 1
-m, --module MODULE Module on GlobalCache, default 1
-t, --timeout TIMEOUT
Timeout in seconds
-I, --immediate_close
Close the GlobalCache immediately after every
interaction
-V, --version Display version information for this program
-v, --verbose Have the communication with the GlobalCache echoed
Sending IR commands
IR commands are sent using the subcommand sendir:
usage: pyglobalcache sendir [-h] [-c COMMANDNAME] [-f FILENAME]
[--count COUNT]
[pronto_hex_numbers ...]
positional arguments:
pronto_hex_numbers Numbers making up a pronto hex ir signal, or "-" for
reading from stdin
options:
-h, --help show this help message and exit
-c, --command COMMANDNAME
Named command to send from file in filename
-f, --file FILENAME File containing command definitions
--count, -# COUNT Number of times to send command
The command can be given either as Pronto Hex or as a command name, contained in a supplied text file. The Pronto Hex can be given either on the command line, or (by using "-" on the command line) read from standard input stdin. The text file should consist of the command line on one line, then one (probably long) line containing the Pronto Hex line, then an empty line, repeated for all the commands. (This format is generated by IrScrutinizer's export format Text, selecting (only) the subformat Pronto Hex.)
Examples
pyglobalcache -m 2 -p 1 sendir -f sonytv.txt -c ok -# 3
This sends three copies of the okcommand, contained in the text file sonytv.txtto a Global Cache at the IP address 192.168.1.70 (the default), using port 1 of module 2. (Sony devices normally requires 3 copies of an IR command.)
irptransmogrifier render -p -n D=1,F=21 sony12 | pyglobalcache -m 2 -p 1 -i 192.168.1.70 sendir -# 3 -
(Requires IrpTransmogrifier to be installed. This is normally the case when IrScrutinizer is installed.) Generates an IR signal with the protocol Sony12, parameters D=1, F=21 (which toggles power on a Sony TV) in Pronto Hex format, send it through the pipe to the current program, which transmits it as IR send command to a GlobalCache with the given IP, module and port.
Sending/receiving serial commands
usage: pyglobalcache serial [-h] message
positional arguments:
message String to send to the serial port
options:
-h, --help show this help message and exit
This sends a message through a serial port, and receives the immediate response. (For more complex scenarios, the API can be used.)
Example
pyglobalcache -i gc2 -m 2 serial MV?
Sends the string MV?to the serial port on module 2 on a GlobalCaché, known to a local name server by the name of gc2, and displays the response. (Assuming a Denon AV Receiver/Amplifier, this returns the current master volume.)
Controlling relays
usage: pyglobalcache relay [-h] {on,off,toggle,pulse,?}
positional arguments:
{on,off,toggle,pulse,?}
Value to set the relay to, ? to report current value
options:
-h, --help show this help message and exit
Metadata
Release files for pyglobalcache 0.3.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 |
|---|---|---|---|---|
| pyglobalcache-0.3.0.tar.gz | 12.0 kB | Without provenance | Details for pyglobalcache-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyglobalcache-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for pyglobalcache-0.3.0-py3-none-any.whl |
Total release size: 24.5 kB
Release files / pyglobalcache-0.3.0.tar.gz
| Download URL | pyglobalcache-0.3.0.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
816d81f178f31221ee60d32c71e36eba12bdd8185aef9628329eafc89c8699f5
|
|
BLAKE2b-256 checksum How to use checksums |
c5d527261e6b62a6b1b535bfaec85e6cdb2dae7b71650cb173929bb64fd99688
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / pyglobalcache-0.3.0-py3-none-any.whl
| Download URL | pyglobalcache-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3f211ae30718e000364161ac7d6465a8a09f34b820ed305e8b462250dfc7bb31
|
|
BLAKE2b-256 checksum How to use checksums |
c230d25fe0fc1303ff5a1767602b73e2f0414992ab44c215f4b10dcd4646dc72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Security for pyglobalcache 0.3.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.