Skip to main content

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.

Project description

Ez-Cpp-Python-Socket


Logo

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.
View Demo · Report Bug · Request Feature

Table of Contents

About The Project

Cpp Python socket abstraction library that attempts to simplify TCP/IP socket communication.

About The Project Gif

Types of messages that can be sent to and fro are as shown below:

Type Cpp Python Extra Info
bool Y Y
string Y Y
int Y Y
float Y Y
list Y Y vector <-> list
list Y Y vector <-> list
image Y Y cv::Mat

The following configurations are supported:

Server Client
Cpp Cpp
Cpp Py
Py Cpp
Py Py

Addition Server-Client Configurations include:

  • Polling in case address is busy: Cpp Python
  • Start and end tokens for every message passed Cpp Python
  • Continuous streaming (with webcam) Cpp Python

Built With

  • Python
  • Cpp
  • Docker
  • OpenCV

Getting Started

Preferably use dockers or virtual environments. For a quickstart demo, do not follow local installation steps.

Installation

  1. Clone the repo

    git clone https://github.com/Aditya-Diva/Ez-Cpp-Python-Socket.git
    
  2. Enter the directory of the repo

  3. Follow launch specific instruction

    • Linux Local Installation

      ./install_dep.sh # Install all python dependencies
      

      C++ Dependencies : Install OpenCV

    • Docker (Linux)

      ./build_docker.sh # Build docker image in demo or dev mode
      

Demo

Run Examples

run_example_gif

Processed Webcam Stream

run_webcam_gif

Docker

./run_docker.sh # runs demo directly if demo mode was selected while building

# If in dev mode, after launching docker with previous command
./run_examples.sh # run demo
./tests/test_<name_of_test>.sh # to test library configurations as a demo

# Finally to remove the docker image after playing around
./remove_docker.sh # removes docker image from system

Local Installation / VirtualEnv

Assuming that OpenCV has already been installed and accessible by C++. Run shell script to download python dependencies and run demo. To run demo of server and client together,

./run_examples.sh

To test out demo of example configurations

./tests/test_<name_of_test>.sh

Usage

To inspect usage of commands,
Refer to run_server and run_client scripts in python & cpp folders.
For additional examples check out the examples folders in each folder.

Contributing

Any contributions made are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Aditya Divakaran - @LinkedIn - @Github - @GMail

Note:

  • This was tested on Ubuntu 20.04 in a virtual environment and on Docker.
  • Image used in repo is from Pixabay.
  • This is a fun project that was picked up while understanding socket communication for other projects that I'm tinkering with.

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

ezpysocket-0.0.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

ezpysocket-0.0.3-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file ezpysocket-0.0.3.tar.gz.

File metadata

  • Download URL: ezpysocket-0.0.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for ezpysocket-0.0.3.tar.gz
Algorithm Hash digest
SHA256 136c4e4103fc9e991ed4715197bf552d3068ab0aee4727b617f4863b17b8689d
MD5 79425c6db5c5a3d206492da5d47a13ed
BLAKE2b-256 1179f8d2074bcfc1f65e59ae052465814ef1d2f653e8adf8940cf51a11bf2bec

See more details on using hashes here.

File details

Details for the file ezpysocket-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: ezpysocket-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.7.9

File hashes

Hashes for ezpysocket-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b6c0095e6a88e706628084733a45a3a99e45c504b193bb859b1612931e2c4362
MD5 80c1199adbe68688d8cac1642ed55d56
BLAKE2b-256 82cf0d34da316da6955482c9e67ac8fff6a048b50ae23b40d4ca4971e01adab2

See more details on using hashes here.

Supported by

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