All Projects → csurfer → Pypette

csurfer / Pypette

Licence: mit
Ridiculously simple flow controller for building complex pipelines

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pypette

Crypto Rl
Deep Reinforcement Learning toolkit: record and replay cryptocurrency limit order book data & train a DDQN agent
Stars: ✭ 328 (+27.13%)
Mutual labels:  multithreading, multiprocessing
React Native Multithreading
🧵 Fast and easy multithreading for React Native using JSI
Stars: ✭ 164 (-36.43%)
Mutual labels:  multithreading, multiprocessing
Autooffload.jl
Automatic GPU, TPU, FPGA, Xeon Phi, Multithreaded, Distributed, etc. offloading for scientific machine learning (SciML) and differential equations
Stars: ✭ 21 (-91.86%)
Mutual labels:  multithreading, multiprocessing
Mongols
C++ high performance networking with TCP/UDP/RESP/HTTP/WebSocket protocols
Stars: ✭ 250 (-3.1%)
Mutual labels:  multithreading, multiprocessing
Archive Password Cracker
设计精良的压缩包密码破解工具,具有自定义字典、导出字典、选择字典等功能。基于Python实现,支持多线程与多进程,不断完善中……
Stars: ✭ 65 (-74.81%)
Mutual labels:  multithreading, multiprocessing
bsuir-csn-cmsn-helper
Repository containing ready-made laboratory works in the specialty of computing machines, systems and networks
Stars: ✭ 43 (-83.33%)
Mutual labels:  multiprocessing, multithreading
endurox-go
Application Server for Go (ASG)
Stars: ✭ 32 (-87.6%)
Mutual labels:  multiprocessing
Track-Stargazers
Have fun tracking your project's stargazers
Stars: ✭ 38 (-85.27%)
Mutual labels:  multithreading
vmlens
unit-testing multi-threaded applications on the JVM made easy
Stars: ✭ 88 (-65.89%)
Mutual labels:  multithreading
Socket-Programming-Python
Client Server running code described with comments here.
Stars: ✭ 48 (-81.4%)
Mutual labels:  multithreading
asynqro
Futures and thread pool for C++ (with optional Qt support)
Stars: ✭ 103 (-60.08%)
Mutual labels:  multithreading
parallel-dfs-dag
A parallel implementation of DFS for Directed Acyclic Graphs (https://research.nvidia.com/publication/parallel-depth-first-search-directed-acyclic-graphs)
Stars: ✭ 29 (-88.76%)
Mutual labels:  multithreading
dannyAVgleDownloader
知名網站avgle下載器
Stars: ✭ 27 (-89.53%)
Mutual labels:  multithreading
space
A SCI-FI community game server simulating space(ships). Built from the ground up to support moddable online action multiplayer and roleplay!
Stars: ✭ 25 (-90.31%)
Mutual labels:  multithreading
tweetsOLAPing
implementing an end-to-end tweets ETL/Analysis pipeline.
Stars: ✭ 24 (-90.7%)
Mutual labels:  multithreading
pblat
parallelized blat with multi-threads support
Stars: ✭ 34 (-86.82%)
Mutual labels:  multithreading
trading sim
📈📆 Backtest trading strategies concurrently using historical chart data from various financial exchanges.
Stars: ✭ 21 (-91.86%)
Mutual labels:  multithreading
MemoryAllocator.KanameShiki
Fast multi-threaded memory allocator
Stars: ✭ 73 (-71.71%)
Mutual labels:  multithreading
ddos
Simple dos attack utility
Stars: ✭ 36 (-86.05%)
Mutual labels:  multithreading
MultiHttp
This is a high performance , very useful multi-curl tool written in php. 一个超级好用的并发CURL工具!!!(httpful,restful, concurrency)
Stars: ✭ 79 (-69.38%)
Mutual labels:  multithreading

pypiv pyv Build Status Coverage Status License Thanks


pypette (to be read as pipette) is a module which makes building pipelines ridiculously simple, allowing users to control the flow with minimal instructions.

Features

  • Ridiculously simple interface.
  • Ability to view pipeline structure within the comfort of a terminal.
  • Run pipeline in exception resilient way if needed.
  • Create dependencies on pipelines easily.
  • Generate a easy to view/understand report within the comfort of a terminal.

Setup

Using pip

pip install pypette

Directly from the repository

git clone https://github.com/csurfer/pypette.git
python pypette/setup.py install

Documentation

Detailed documentation can be found at https://csurfer.github.io/pypette

Structures

Job

The basic unit of execution, say a python method or a callable.

from pypette import Job

def print_hello():
    print("Hello!")

def print_hello_msg(msg):
    print("Hello " + msg + "!")

# Job without arguments
j1 = Job(print_hello)

# Job with arguments specified as argument list
j2 = Job(print_hello_msg, args=("pypette is simple",))

# Job with arguments specified as key word arguments
j3 = Job(print_hello_msg, kwargs={"msg":"pypette is simple"})

BashJob

The basic unit of execution, which runs a bash command.

from pypette import BashJob

# Job with bash commands
b1 = BashJob(['ls', '-l'])
b2 = BashJob(['pwd'])

Pipe

Structure to specify the flow in which the jobs need to be executed. The whole interface consists of only 4 methods.

from pypette import Pipe

# 1. Create a new Pipe
p = Pipe('TestPipe')

# 2. Add jobs to execute. (Assuming job_list is a list of python/bash jobs)

# To run the jobs in job_list in order one after the other where each job waits
# for the job before it to finish.
p.add_jobs(job_list)

# To run the jobs in job_list parallelly and run the next step only after all
# jobs in job list finish.
p.add_jobs(job_list, run_in_parallel=True)

# Add jobs in a builder format.
p.add_stage(job1).add_stage(job2) # To add jobs in series.
p.add_stage(job1, job2) # To add jobs in parallel.

Building complex pipelines

Jobs submitted to pipeline should be callables i.e. structures which can be run. This means python methods, lambdas etc qualify.

What about Pipe itself?

Of course, it is a callable and you can submit a pipe object to be run along with regular jobs. This way you can build small pipelines which achieve a specific task and then combine them to create more complex pipelines.

from pypette import BashJob, Job, Pipe

def welcome():
    print("Welcome user!")

def havefun():
    print("Have fun!")

def goodbye():
    print("Goodbye!")

# Build a simple pipeline
p1 = Pipe('Fun')
p1.add_jobs([
    Job(havefun),
])

# Include simple pipeline into a complicated pipeline
p2 = Pipe('Overall')
p2.add_jobs([
    Job(welcome),
    p1,
    Job(goodbye),
    BashJob(['ls', '-l']),
    BashJob(['pwd'])
])

p2.run() # This first runs welcome, then runs p1 pipeline then runs goodbye.

Example pipeline

An example pipeline and its code are included in examples folder.

Visualizing the pipeline using graph()

Pipeline objects have a method called graph() which helps visualize the pipeline within the comfort of your terminal. The graph is recursive in nature and it visualizes everything that will be run if we call run() on the pipe object.

Visualizing the top-level pipeline in examples/basic.py led to the following visualization.

Running the entire pipeline.

The only thing you need to do at this point to run the entire pipeline is to call run() on your pipeline object.

Reporting the entire pipeline.

The only thing you need to do at this point to get the report of entire pipeline is to call report() on your pipeline object.

Contributing

Bug Reports and Feature Requests

Please use issue tracker for reporting bugs or feature requests.

Development

Pull requests are most welcome.

Buy the developer a cup of coffee!

If you found the utility helpful you can buy me a cup of coffee using

Donate

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].