You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

swimos

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swimos

Standalone Python framework for building massively real-time streaming WARP clients.

1.6.0a0
PyPI
Maintainers
1

Swim System Python Implementation

PyPI version Build Status License Code of Conduct chat

The Swim System Python implementation provides a standalone set of frameworks for building massively real-time streaming WARP clients.

The Swim Python Client is a streaming API client for linking to lanes of stateful Web Agents using the WARP protocol, enabling massively real-time applications that continuously synchronize all shared states with ping latency. WARP is like pub-sub without the broker, enabling every state of a Web API to be streamed, without interference from billions of queues.

Installation

pip install swimos

Usage

# Setting the value of a value lane on a remote agent.
import time

from swimos import SwimClient

with SwimClient() as swim_client:
    host_uri = 'ws://localhost:9001'
    node_uri = '/unit/foo'
    lane_uri = 'info'

    value_downlink = swim_client.downlink_value()
    value_downlink.set_host_uri('ws://localhost:9001')
    value_downlink.set_node_uri('/unit/foo')
    value_downlink.set_lane_uri('info')
    value_downlink.open()

    new_value = 'Hello from Python!'
    value_downlink.set(new_value)

    print('Stopping the client in 2 seconds')
    time.sleep(2)

Development

Dependencies

Code dependencies

pip install -r requirements.txt

Development tools dependencies

pip install -r requirements-dev.txt

Run unit tests

Basic:
  • Install async test package: pip install aiounittest
  • Run tests: python -m unittest
With coverage:
  • Install async test package: pip install aiounittest
  • Install coverage package: pip install coverage
  • Generate report: coverage run --source=swimos -m unittest
  • View report: coverage report -m

Run Lint

Manual
  • Install lint package: pip install flake8
  • Run checks: flake8
Automatic (before commit)
  • Install commit hook package: pip install pre-commit
  • Run hook installation: pre-commit install

Build package

Building package distribution
  • Install build package: pip install build
  • Run: python -m build
Releasing a new version
  • Add version tag: git tag VERSION (e.g. 0.1.0)
  • Push to remote: git push origin VERSION

Keywords

swim client

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts