Skip to main content

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

Project description

Build Status Test Coverage Latest PyPI version Apache License

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

PyPI

pip install pandablocks

Source code

https://github.com/PandABlocks/PandABlocks-client

Documentation

https://pandablocks.github.io/PandABlocks-client/master/index.html

TODO - Test 0.1.4

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}")

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.1.4.tar.gz (18.4 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.1.4-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pandablocks-0.1.4.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for pandablocks-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3897227cde1101975956b4faa9b65babe980b170b7f93c6505e2650a844e0b54
MD5 dadbf7fc59ee17221a13bac9185b0016
BLAKE2b-256 408bf962ec18529047394ee1dd44419fa1da6870b8fb7c4eb3091ea0e34024ae

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pandablocks-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.6

File hashes

Hashes for pandablocks-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 d33ff08c94c87a44cbcc81a263f5a839eabd56bfccc5e72285e1cd33bb4c61d0
MD5 bec74d5b012c75b757dda8a457a33832
BLAKE2b-256 52f7397edf112c1d5c4a7231f50b970491605b90f0af99b0b64f2f5c7e602f15

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