{"id":15532900,"url":"https://github.com/matham/pybarst","last_synced_at":"2025-04-09T10:14:49.579Z","repository":{"id":17036236,"uuid":"19800470","full_name":"matham/pybarst","owner":"matham","description":"An interface to the Barst server","archived":false,"fork":false,"pushed_at":"2017-07-12T22:17:06.000Z","size":433,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-15T04:26:11.804Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matham.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-15T00:10:53.000Z","updated_at":"2020-03-31T14:10:20.000Z","dependencies_parsed_at":"2022-09-24T12:44:36.268Z","dependency_job_id":null,"html_url":"https://github.com/matham/pybarst","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fpybarst","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fpybarst/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fpybarst/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matham%2Fpybarst/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matham","download_url":"https://codeload.github.com/matham/pybarst/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248018070,"owners_count":21034048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T11:33:46.143Z","updated_at":"2025-04-09T10:14:49.560Z","avatar_url":"https://github.com/matham.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"PyBarst is a python bindings for the Barst client API.\n\nThis project provides a python interface to the Barst server project.\nBarst is a server which provides access to commonly used hardware in the lab,\ne.g. FTDI USB devices, RTV cameras, serial ports etc.\n\nThe wheels come with the Barst executable and therefore does not need\nto be installed separately. The path to the executable can be found in\n`pybarst.dep_bins`.\n\nFor more information: http://matham.github.io/pybarst/index.html\n\nTo install https://matham.github.io/pybarst/installation.html\n\n.. image:: https://ci.appveyor.com/api/projects/status/q9om4pu4og1kkdut/branch/master?svg=true\n    :target: https://ci.appveyor.com/project/matham/pybarst/branch/master\n    :alt: Appveyor status\n\n.. image:: https://img.shields.io/pypi/pyversions/pybarst.svg\n    :target: https://pypi.python.org/pypi/pybarst/\n    :alt: Supported Python versions\n\n.. image:: https://img.shields.io/pypi/v/pybarst.svg\n    :target: https://pypi.python.org/pypi/pybarst/\n    :alt: Latest Version on PyPI\n\nUsage example\n-------------\n\nStarting a server::\n\n    \u003e\u003e\u003e # create a local server instance with a pipe named TestPipe. Since not\n    \u003e\u003e\u003e # provided, the executable is searched for in pybarst.dep_bins and in\n    \u003e\u003e\u003e # Program Files.\n    \u003e\u003e\u003e server = BarstServer(pipe_name=r'\\\\.\\pipe\\TestPipe')\n    \u003e\u003e\u003e # now actually create the server and start it running\n    \u003e\u003e\u003e server.open_server()\n    \u003e\u003e\u003e # Connect to a server running on remote computer named PC_Name using a pipe named TestPipe\n    \u003e\u003e\u003e server2 = BarstServer(pipe_name=r'\\\\PC_Name\\pipe\\TestPipe')\n    \u003e\u003e\u003e # now open the connection to the remote server\n    \u003e\u003e\u003e server2.open_server()\n\nGet the current server time::\n\n    \u003e\u003e\u003e server.clock()\n    (1.5206475727928106, 13045896424.049448)\n\nAn example using the RTV-4 video card::\n\n    \u003e\u003e\u003e from pybarst.core.server import BarstServer\n    \u003e\u003e\u003e from pybarst.rtv import RTVChannel\n\n    \u003e\u003e\u003e server = BarstServer(pipe_name=r'\\\\.\\pipe\\TestPipe')\n    \u003e\u003e\u003e server.open_server()\n    \u003e\u003e\u003e print(server.get_manager('rtv'))\n    {'version': 1080L, 'chan': 1, 'chan_id': 'RTVMan'}\n\n    \u003e\u003e\u003e # for the code below, there should be a RTV-4 like device connected, with\n    \u003e\u003e\u003e # a port 0 available\n    \u003e\u003e\u003e rtv = RTVChannel(server=server, chan=0, video_fmt='full_NTSC', frame_fmt='rgb24', lossless=False)\n    \u003e\u003e\u003e rtv.open_channel()\n    \u003e\u003e\u003e rtv.set_state(state=True)\n\n    \u003e\u003e\u003e # data is a buffer containing the raw image data\n    \u003e\u003e\u003e time, data = rtv.read()\n    \u003e\u003e\u003e print(time, len(data), rtv.buffer_size)\n    (12865.015067682945, 921600, 921600L)\n    \u003e\u003e\u003e time, data = rtv.read()\n    \u003e\u003e\u003e print(time, len(data), rtv.buffer_size)\n    (12865.048412758983, 921600, 921600L)\n    \u003e\u003e\u003e # remove any data queued, otherwise read will return any waiting data\n    \u003e\u003e\u003e rtv.set_state(state=False, flush=True)\n\nA example using the windows serial port::\n\n    \u003e\u003e\u003e from pybarst.core.server import BarstServer\n    \u003e\u003e\u003e from pybarst.serial import SerialChannel\n\n    \u003e\u003e\u003e server = BarstServer(pipe_name=r'\\\\.\\pipe\\TestPipe')\n    \u003e\u003e\u003e server.open_server()\n    \u003e\u003e\u003e print(server.get_manager('serial'))\n    {'version': 498139398L, 'chan': 0, 'chan_id': 'SerMan'}\n\n    \u003e\u003e\u003e # for this example, COM3 should have a loopback cable connected to it.\n    \u003e\u003e\u003e serial = SerialChannel(server=server, port_name='COM3', max_write=32, max_read=32)\n    \u003e\u003e\u003e serial.open_channel()\n\n    \u003e\u003e\u003e time, val = serial.write(value='How are you today?', timeout=10000)\n    \u003e\u003e\u003e print(time, val)\n    (1931.5567431509603, 18)\n    \u003e\u003e\u003e # read the exact number of chars written.\n    \u003e\u003e\u003e time, val = serial.read(read_len=len('How are you today?'), timeout=10000)\n    \u003e\u003e\u003e print(time, val)\n    (1931.5607736011307, 'How are you today?')\n\n    \u003e\u003e\u003e serial.close_channel_server()\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatham%2Fpybarst","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatham%2Fpybarst","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatham%2Fpybarst/lists"}