Ez-Cpp-Python-Socket
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.
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 | 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
-
Clone the repo
git clone https://github.com/Aditya-Diva/Ez-Cpp-Python-Socket.git
-
Enter the directory of the repo
-
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
Processed Webcam Stream
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - 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.
Metadata
Release files for ezpysocket 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ezpysocket-0.0.3.tar.gz | 10.8 kB | Without provenance | Details for ezpysocket-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ezpysocket-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for ezpysocket-0.0.3-py3-none-any.whl |
Total release size: 20.5 kB
Release files / ezpysocket-0.0.3.tar.gz
| Download URL | ezpysocket-0.0.3.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
136c4e4103fc9e991ed4715197bf552d3068ab0aee4727b617f4863b17b8689d
|
|
BLAKE2b-256 checksum How to use checksums |
1179f8d2074bcfc1f65e59ae052465814ef1d2f653e8adf8940cf51a11bf2bec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / ezpysocket-0.0.3-py3-none-any.whl
| Download URL | ezpysocket-0.0.3-py3-none-any.whl |
|---|---|
| Size | 9.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b6c0095e6a88e706628084733a45a3a99e45c504b193bb859b1612931e2c4362
|
|
BLAKE2b-256 checksum How to use checksums |
82cf0d34da316da6955482c9e67ac8fff6a048b50ae23b40d4ca4971e01adab2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for ezpysocket 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.