Git Product home page Git Product logo

pandablocks-client's Introduction

PandABlocks Python Client

Code CI Docs CI Test Coverage Latest PyPI version Apache License

A Python client which connects to the 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

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.

pandablocks-client's People

Contributors

alexanderwells-diamond avatar gilesknap avatar coretl avatar evalott100 avatar garryod avatar dependabot[bot] avatar aureocarneiro avatar callumforrester avatar ajoubertza avatar gdyendell avatar joshuaappleby avatar tizayi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.