Skip to main content

A simple Python library and a REST API server that interacts with COM ports

Project description

COM-Server

GitHub Workflow Status Documentation Status

Note: This is still in beta. If you want to help contribute/test, please read the contributing page.

COM-Server is a Python library and a local web server that hosts an API locally and interacts with serial or COM ports. The Python library provides a different way of sending and receiving data from the serial port using a thread, and it also gives a set of tools that simplifies the task of manipulating data to and from the port. Additionally, the server makes it easier for other processes to communicate with the serial port.

The serial communication uses pyserial as its back-end and the server uses flask-restful and Flask. Reading their documentations may help with developing with COM-Server.

NOTE: COM-Server has only been tested on:
Operating systems:

  • Ubuntu 20.04 (Focal Fossa)
  • Raspberry Pi OS 10 (Buster)
  • Mac OS 10.15.x (Catalina)
  • Mac OS 11.6 (Big Sur)

Python versions:

  • Python 3.7.2
  • Python 3.7.3
  • Python 3.8.10

Serial ports:

  • Arduino UNO
  • Arduino Nano

Installation

NOTE: COM-Server only works on Python >= 3.6.

Using pip:

> pip install -U com-server

Quickstart

# launches a development server on http://0.0.0.0:8080

import com_server

conn = com_server.Connection("<port>", <baud>) 
handler = com_server.RestApiHandler(conn) 
com_server.Builtins(handler) 

handler.run_dev(host="0.0.0.0", port=8080) 

conn.disconnect()

Replace "<port>" and "<baud>" with the serial port and baud rate.

Alternatively, you can use the command line:

> com_server -p <port> -b <baud> run

Again, replace "<port>" and "<baud>" with the serial port and baud rate.

Links:

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

com-server-0.0.tar.gz (43.5 kB view details)

Uploaded Source

Built Distribution

com_server-0.0-py2.py3-none-any.whl (26.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file com-server-0.0.tar.gz.

File metadata

  • Download URL: com-server-0.0.tar.gz
  • Upload date:
  • Size: 43.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for com-server-0.0.tar.gz
Algorithm Hash digest
SHA256 f2fa7b210639eb14edce554db9bf7ce2a3cd75f70a58a9811676a288f7de934d
MD5 b4953d25fbf2bc2b5bcab6bc76477c7e
BLAKE2b-256 3db85be0b5e00327aa6e1956770b0d79086abd6b9a0e0695ff0d5424b8303669

See more details on using hashes here.

Provenance

File details

Details for the file com_server-0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: com_server-0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 26.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.8

File hashes

Hashes for com_server-0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8b6699f599a1cbf10da93a16551052ce445d16f3904d6a1cecf5cf14004e8521
MD5 a17b219013b3ca952449e70fb16c605f
BLAKE2b-256 e060c997296e88232965d21a9849000612d295c9a79586b6c091604d99702db7

See more details on using hashes here.

Provenance

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