🍰 ConnectMP - An easy and efficient way to share data between Processes in Python.

Overview

ConnectMP - Taking Multi-Process Data Sharing to the moon 🚀

Contribute · Community · Documentation


🎫 Introduction :

🍤 ConnectMP is the easiest and efficient way to share data between Processes. It's superfast, can handle big datas, can create multiple data connection and really simple to get started. 🍰

🥐 ConnectMP is created out of pure Frustration of not being able to find a good solution to comminucate between Processes 🥨

🥗 Installation :

via pip (recommended) :

pip install connectmp

🧇 Quickstart : (Docs)

Please read till the end to find what you're looking for!

🍤 connectmp.Process :

from connectmp import Process

This Process class is same as multiprocessing.Process, it's just modified. So, just use connectmp.Process where you would use multiprocessing.Process

import time
from connectmp import Process


def do_something(connection):
    connection.data = "Sending Some Data."


def track_data(connection):
    time.sleep(1)
    print(f"Track i: {connection.data}")


if __name__ == '__main__':
    p1 = Process(target=do_something, connection=True)
    p2 = Process(target=track_data, args=(p1.connection,))

    p1.start()
    p2.start()

Just let me explain what's happening here. we have 2 functions, one is do_something which just sends data and track_data which recieves the data and print's it. You can see in p1 we are not pasing any argument but our function do_something requires a connection argument.

When you enable Process(connection=True) Your target function will recieve a keyword-argument value named connection which's value will contain the Connection object. This Connection object is an individual connection. But You can of course share this connection with other process.

in p2 we shared the connection of our p1 by p1.connection which returns the connection object of p1. In track_data function we just recieve the data from p1.connection. You can send and recieve data from and to each other.

And yeah to send data all you do is assign the data to connection.data and also to get data you have to do it with connection.data

HOLD ON! You might also be looking for something like this down below!

So, if you're wondering if we can create Conenction seperately without creting Process object? 🎉 YES! YES YOU CAN! with:

🥨 connectmp.Connection

from connectmp import Connection

You can create your own Connection with this. Let me show you how:

from connectmp import Connection

connection = Connection()

that's it! 🎉 You can create multiple Connection! To use it just do it like how we did before, pass it as an argument and use it anywhere you want 🥂

NOTE: Make sure Process(connection=True) is not enabled, or it will conflict with your function params. turn Process(connection=True) when you want to create another Connection and get it in the function as an argument('connection').

🌮 Example:

import time
from connectmp import Process, Connection


def do_something(connection):
    connection.data = "Sending Some Data."


def track_data(connection):
    time.sleep(1)
    print(f"Track i: {connection.data}")


if __name__ == '__main__':
    conn = Connection()  # Creating connection
    
    p1 = Process(target=do_something, args=(conn,))
    p2 = Process(target=track_data, args=(conn,))

    p1.start()
    p2.start()

Now each Process can communicate with each other! That's all you need to know about ConnectMP. Hope this helped you 🎉

🌟 Back to Top

You might also like...
Application for easy configuration of swap file and swappiness priority in slackware and others linux distributions.

Swap File Program created with the objective of assisting in the configuration of swap file in Distributions such as Slackware. Required packages: pyt

Stubmaker is an easy-to-use tool for generating python stubs.

Stubmaker is an easy-to-use tool for generating python stubs. Requirements Stubmaker is to be run under Python 3.7.4+ No side effects during

VerSign: Easy Signature Verification in Python

VerSign: Easy Signature Verification in Python versign is a small Python package which can be used to perform verification of offline signatures. It a

A utility that makes it easy to work with Python projects containing lots of packages, of which you only want to develop some.

Mixed development source packages on top of stable constraints using pip mxdev [mɪks dɛv] is a utility that makes it easy to work with Python projects

Shypan, a simple, easy to use, full-featured library written in Python.

Shypan, a simple, easy to use, full-featured library written in Python.

Easy compression and extraction for any compression or archival format.
Easy compression and extraction for any compression or archival format.

Tzar: Tar, Zip, Anything Really Easy compression and extraction for any compression or archival format. Usage/Examples tzar compress large-dir compres

A collection of common regular expressions bundled with an easy to use interface.

CommonRegex Find all times, dates, links, phone numbers, emails, ip addresses, prices, hex colors, and credit card numbers in a string. We did the har

Regression Metrics Calculation Made easy

Regression Metrics Mean Absolute Error Mean Square Error Root Mean Square Error Root Mean Square Logarithmic Error Root Mean Square Logarithmic Error

A library for interacting with Path of Exile game and economy data, and a unique loot filter generation framework.

wraeblast A library for interfacing with Path of Exile game and economy data, and a set of item filters geared towards trade league players. Filter Ge

Releases(v1.1.0)
  • v1.1.0(Dec 24, 2021)

  • v1.0.0(Dec 24, 2021)

  • v0.1.1(Dec 22, 2021)

    🍩 What's new in ConnectMP v0.1.1 :

    • Now defaultly supports multithreaded Connection
    • Fixed some bugs
    • Added support for command 'connectmp'
    • Can change config with command
    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(Dec 21, 2021)

    🧇 Official First Release Of ConnectMP

    • ConnectMP.Process
    • ConnectMP.Connection

    Share data between Processes.Share big data.Low latency.Ability to create Connection separately.Works in all System

    Source code(tar.gz)
    Source code(zip)
Owner
Aiden Ellis
Kon'nichiwa, you got my blessings 🥳
Aiden Ellis
Package that allows for validate and sanitize of string values.

py.validator A library of string validators and sanitizers Insipired by validator.js Strings only This library validates and sanitizes strings only. P

Sanel Hadzini 22 Nov 08, 2022
Auto-generate /etc/hosts for HackTheBox machines

Auto-generate /etc/hosts for HackTheBox machines Save yourself some tedium on getting started on a new machine by having your /etc/hosts ready to go.

3 Feb 16, 2022
Control-Alt-Delete - Help Tux Escape Beastie's Jail!

Control-Alt-Delete Help Tux escape Beastie's jail by completing the following challenges! Challenges Challenge 00: Drinks: Tux needs to drink less. Ch

NDLUG 8 Oct 31, 2021
Produce a simulate-able SDF of an arbitrary mesh with convex decomposition.

Mesh-to-SDF converter Given a (potentially nasty, nonconvex) mesh, automatically creates an SDF file that describes that object. The visual geometry i

Greg Izatt 22 Nov 23, 2022
A thing to simplify listening for PG notifications with asyncpg

A thing to simplify listening for PG notifications with asyncpg

ANNA 18 Dec 23, 2022
isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections and by type.

isort is a Python utility / library to sort imports alphabetically, and automatically separated into sections and by type. It provides a command line utility, Python library and plugins for various e

Python Code Quality Authority 5.5k Jan 08, 2023
kawadi is a versatile tool that used as a form of weapon and is used to cut, shape and split wood.

kawadi kawadi (કવાડિ in Gujarati) (Axe in English) is a versatile tool that used as a form of weapon and is used to cut, shape and split wood. kawadi

Jay Vala 2 Jan 10, 2022
A simple API that will return a key-value pair of randomly generated UUID

A simple API that will return a key-value pair of randomly generated UUID. Key will be a timestamp and value will be UUID. While the server is running, whenever the API is called, it should return al

Pius Lucky 2 Jan 18, 2022
A tool to create the basics of a project

Project-Scheduler Instalação Para instalar o Project Maker, você necessita está em um ambiente de desenvolvimento Linux ou wsl com alguma distro debia

2 Dec 17, 2021
Python utilities for writing cross-version compatible libraries

Python utilities for writing cross-version compatible libraries

Tyler M. Kontra 85 Jun 29, 2022
This is a tool to calculate a resulting color of the alpha blending process.

blec: alpha blending calculator This is a tool to calculate a resulting color of the alpha blending process. A gamma correction is enabled and the def

Igor Mikushkin 12 Sep 07, 2022
A python app which aggregates and splits costs from multiple public cloud providers into a csv

Cloud Billing This project aggregates the costs public cloud resources by accounts, services and tags by importing the invoices from public cloud prov

1 Oct 04, 2022
Finger is a function symbol recognition engine for binary programs

Finger is a function symbol recognition engine for binary programs

332 Jan 01, 2023
A library to easily convert climbing route grades between different grading systems.

pyclimb A library to easily convert climbing route grades between different grading systems. In rock climbing, mountaineering, and other climbing disc

Ilias Antonopoulos 4 Jan 26, 2022
jsoooooooon derulo - Make sure your 'jason derulo' is featured as the first part of your json data

jsonderulo Make sure your 'jason derulo' is featured as the first part of your json data Install: # python pip install jsonderulo poetry add jsonderul

jesse 3 Sep 13, 2021
Analyze metadata of your Python project.

Analyze metadata of your Python projects Setup: Clone repo py-m venv venv (venv) pip install -r requirements.txt specify the folders which you want to

Pedro Monteiro de Carvalho e Silva Prado 1 Nov 10, 2021
Customized python validations.

A customized python validations.

Wilfred V. Pine 2 Apr 20, 2022
API Rate Limit Decorator

ratelimit APIs are a very common way to interact with web services. As the need to consume data grows, so does the number of API calls necessary to re

Tomas Basham 575 Jan 05, 2023
a demo show how to dump lldb info to ida.

用一个demo来聊聊动态trace 这个仓库能做什么? 帮助理解动态trace的思想。仓库内的demo,可操作,可实践。 动态trace核心思想: 动态记录一个函数内每一条指令的执行中产生的信息,并导入IDA,用来弥补IDA等静态分析工具的不足。 反编译看一下 先clone仓库,把hellolldb

25 Nov 28, 2022
Search, generate & deliver Msfvenom payloads in an quick and easy way

Goal Search, generate & deliver payloads in an quick and easy way Be as simple as possible BUT with all msfvenom payloads. Ever lost time searching th

2 Mar 03, 2022