Giter Site home page Giter Site logo

neotim / swim-system-python Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swimos/swim-system-python

0.0 1.0 0.0 664 KB

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

License: Apache License 2.0

Python 100.00%

swim-system-python's Introduction

Swim System Python Implementation

PyPI version Build Status codecov 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 swimai

Usage

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

from swimai 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:
  1. Install async test package: pip install aiounittest
  2. Run tests: python -m unittest
With coverage:
  1. Install async test package: pip install aiounittest
  2. Install coverage package: pip install coverage
  3. Generate report: coverage run --source=swimai -m unittest
  4. View report: coverage report -m

Run Lint

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

Build package

Building source distribution
  1. Run: python setup.py sdist
Building wheel
  1. Install wheel package: pip install wheel
  2. Run: python setup.py sdist

swim-system-python's People

Contributors

dobromirm avatar

Watchers

 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.