Skip to main content

Running local or remote python servers in the background and establish stream socket-based communication with clients.

Project description

https://img.shields.io/pypi/v/bgpy.svg https://github.com/munterfinger/bgpy/workflows/check/badge.svg Documentation Status https://codecov.io/gh/munterfinger/bgpy/branch/master/graph/badge.svg

Running local or remote python servers in the background using Popen from the subprocess module and establish stream socket-based communication with clients in both directions.

Getting started

Get the stable release of the package from pypi:

pip install bgpy

Run an example background process on localhost and communicate using stream sockets:

from bgpy.interface import initialize, execute, terminate
from bgpy.example.tasks import init_task, exec_task, exit_task

# Start background process
initialize(init_task, exec_task, exit_task)

# Increase value
execute({"command": "increase", "value_change": 10})

# Decrease value
execute({"command": "decrease", "value_change": 100})

# Terminate
args = terminate(await_response=True)

License

This project is licensed under the MIT License - see the LICENSE file for details

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

bgpy-0.1.0.tar.gz (9.3 kB view hashes)

Uploaded Source

Built Distribution

bgpy-0.1.0-py3-none-any.whl (11.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page