Skip to main content

A Python client to control and data ports of the PandABlocks TCP server

Project description

CI Coverage PyPI License

pandablocks

A Python client to control and data ports of the PandABlocks TCP server

Source https://github.com/PandABlocks/PandABlocks-client
PyPI pip install pandablocks
Docker docker run ghcr.io/pandablocks/PandABlocks-client:latest
Documentation https://pandablocks.github.io/PandABlocks-client
Releases https://github.com/PandABlocks/PandABlocks-client/releases

Command line tool features an interactive console, load/save control, and HDF5 writing:

$ pip install pandablocks

$ pandablocks control <panda-hostname>
< PCAP.     # Hit TAB key...
PCAP.ACTIVE     PCAP.BITS1      PCAP.BITS3      PCAP.GATE       PCAP.SAMPLES    PCAP.TRIG       PCAP.TS_END     PCAP.TS_TRIG
PCAP.BITS0      PCAP.BITS2      PCAP.ENABLE     PCAP.HEALTH     PCAP.SHIFT_SUM  PCAP.TRIG_EDGE  PCAP.TS_START
< PCAP.ACTIVE?
OK =1

$ pandablocks hdf <panda-hostname> /tmp/panda-%d.h5
INFO:Opened '/tmp/panda-1.h5' with 60 byte samples stored in 11 datasets
INFO:Closed '/tmp/panda-1.h5' after writing 50000000 samples. End reason is 'Disarmed'

Library features a Sans-IO core with both asyncio and blocking wrappers:

from pandablocks.blocking import BlockingClient
from pandablocks.commands import Get

with BlockingClient("hostname-or-ip") as client:
    # Commands sent to Control port
    idn = client.send(Get("*IDN"))
    print(f"Hello {idn}")
    for data in client.data():
        # Data captured from Data port
        print(f"I got some PCAP data {data}")

See https://pandablocks.github.io/PandABlocks-client for more detailed documentation.

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

pandablocks-0.8.0.tar.gz (501.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandablocks-0.8.0-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file pandablocks-0.8.0.tar.gz.

File metadata

  • Download URL: pandablocks-0.8.0.tar.gz
  • Upload date:
  • Size: 501.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pandablocks-0.8.0.tar.gz
Algorithm Hash digest
SHA256 3be30bb1ded0ab0c199a84feeeff85d4cc4303ef112d14f2b3cf9ccce557729d
MD5 376c97f43c44b350214f2b077998c0ac
BLAKE2b-256 fcbd437cfecfbf9173416d623846caa5f52060499f305d1cadfe61ff7eb901f3

See more details on using hashes here.

File details

Details for the file pandablocks-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: pandablocks-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for pandablocks-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 154cb705c773fae93cc87d6df405203c42a4086cc18f89c352005b85d7b5845a
MD5 222f068799437c9e8c3b29f501c22cbe
BLAKE2b-256 d875c70849e2f3814b3284cad53cdbde8d0c7231b18e50594109f398eb823b18

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