An open-source tool for visual and modular block programing in python

Overview

PyFlow

Pytest badge Codacy Badge Pylint badge Total coverage Codacy Badge Unit coverage badge Integration coverage badge Licence - GPLv3 PRs Welcome

PyFlow is an open-source tool for modular visual programing in python !

Although for now the tool is in Beta and features are coming in bit by bit, stay tuned for the first release soon !

Help the project !

Join our Discord to beta-test features, share your ideas or even contribute !

Features

  • Put your python code in small interconnected blocks

  • Export and Import your graphs and share them with other people in the new Interactive PYthon Graph format (.ipyg)

  • Chain your blocks to perform complex functions.

Installation

Make sure you have Python 3 installed. You can download it from here

Clone the current repo:

git clone https://github.com/MathisFederico/OpenCodeBlocks/

Install the dependencies

pip install -r requirements.txt

Run !

python -m opencodeblocks optional_path_to_ipyg

Contributing

If you are interested in contributing to the project, see CONTRIBUTING.md.

License

See LICENSE

Comments
  • Add ipynb conversion

    Add ipynb conversion

    This is a draft, many required features are missing. What is there

    1. A basic converter which uses the default code block and fills it with the pieces of codes, and align them left to right
    2. The load button now supports loading a ipynb file What is missing
    3. Many crucial things (such as markdown and outputs) are ignored by the converter (see the TODOs in the python file)
    4. There is not dedicated "load ipynb button" for now. It works with the load button when a .ipynb file is selected.
    5. Unit tests might be required for this one, but are not yet present
    opened by FabienRoger 11
  • :tada: Adds Visual Flow

    :tada: Adds Visual Flow

    https://user-images.githubusercontent.com/62465003/145698162-1afec762-46e0-4770-9be7-2a928c58af22.mp4

    Pressing a run button will now highlight in green the graph traversal that is made to gather the blocks to run Running blocks are now highlighted in red

    Closes #66

    enhancement 
    opened by AlexandreSajus 5
  • Vertical structure

    Vertical structure

    To help with lowering the barrier of entry between Jupyter and Pyflow, we could adopt a vertical structure where blocks are aligned top to bottom instead of left to right.

    A good first step towards this would be having top and bottom sockets

    enhancement 
    opened by AlexandreSajus 4
  • 🛠️Execution Refactor & 🎉 Nested Nodes

    🛠️Execution Refactor & 🎉 Nested Nodes

    A lot of new blocks have been added but they are not executable yet !

    This pull request aims to:

    • Make the new blocks like slider executable
    • Polish the executing code
    • Fix some bugs
    • Introduce new node types

    While this might seem like multiple features added at once, because they are all deeply intertwined, it makes sense to group them in the same branch. More specifically, we will try to fix:

    • #112
    • Tests to prevent #112 regressions
    • #94
    • Tests to prevent #94 regressions
    • #5
    opened by vanyle 4
  • Add new shortcuts for block creations

    Add new shortcuts for block creations

    In a Jupyter notebook, adding new blocks is easy. Just press "Shift+Enter" and it adds a new block after executing the current one. In OCB, for now, you have to right-click, new block, and link it with the previous one, which is cumbersome.

    The new shortcuts which could be added:

    • Shift+ Arrow to add a new block linked to the current one in the direction of the arrow and launch the execution of the current cell
    • Shift+ Enter to add a new block linked to the current one to the right and launch the execution of the current cell
    • Control + Enter to execute the current cell
    • Something to insert a cell between two others (this is really slow with the current system)
    enhancement 
    opened by FabienRoger 4
  • :tada: Add editing navigation using alt & escape

    :tada: Add editing navigation using alt & escape

    Adds:

    • Navigation can be trigger from inside editors using alt+arrow
    • Editing mode can be entered from navigation using alt
    • Selection & Focus can be cleared using escape
    opened by MathisFederico 3
  • 🎉 🎨 Add persistent colors

    🎉 🎨 Add persistent colors

    Add persistent colors to ease the user comprehension and let him remember what was run. Fixes #272 Refactored 'run_state' and 'has_been_run' using Enum for better maintenance.

    opened by MathisFederico 3
  • stdout is not correctly rendered in some cases

    stdout is not correctly rendered in some cases

    import pandas as pd
    
    d = {'col1':[1,2],'col2':[3,4]}
    df = pd.DataFrame(data=d)
    
    df.describe()
    

    On a jupyter notebook, the code above renders a pretty image: image

    This is not the case currently: image

    bug 
    opened by vanyle 3
  • Execution Flow

    Execution Flow

    Executing a cell should trigger other cells depending of the graph.

    • Cells before should be run if they have not already or have been modified
    • Cells after should be run if the socket allows for it depending on socket flowtype (#47)

    This should be sequentially at first, in a depth-first or breadth-first manner (this could be a user choice for both before and after cells).

    enhancement 
    opened by MathisFederico 3
  • PyFlow crashes because undefined symbol: _ZdlPvm

    PyFlow crashes because undefined symbol: _ZdlPvm

    Installation goes normally and without error. But try to run PyFlow and there is a message about an undefined symbol _ZdlPvm. What might the remedy be?

    python3 -m pyflow
    Traceback (most recent call last):
      File "/usr/lib/python3.9/runpy.py", line 197, in _run_module_as_main
        return _run_code(code, main_globals, None,
      File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
        exec(code, run_globals)
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/__main__.py", line 22, in <module>
        from pyflow.graphics.window import Window
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/graphics/window.py", line 22, in <module>
        from pyflow.graphics.widget import Widget
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/graphics/widget.py", line 11, in <module>
        from pyflow.scene import Scene
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/scene/__init__.py", line 6, in <module>
        from pyflow.scene.scene import Scene
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/scene/scene.py", line 17, in <module>
        from pyflow.blocks.block import Block
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/blocks/__init__.py", line 7, in <module>
        from pyflow.blocks.codeblock import CodeBlock
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/blocks/codeblock.py", line 15, in <module>
        from pyflow.blocks.pyeditor import PythonEditor
      File "/home/johnb/.local/lib/python3.9/site-packages/pyflow/blocks/pyeditor.py", line 18, in <module>
        from PyQt5.Qsci import QsciScintilla, QsciLexerPython
    ImportError: /home/johnb/.local/lib/python3.9/site-packages/PyQt5/Qsci.abi3.so: undefined symbol: _ZdlPvm, version Qt_5
    

    System info:

    qmake --version
    QMake version 3.1
    Using Qt version 5.15.2 in /usr/lib/x86_64-linux-gnu
    
    python3 --version
    Python 3.9.7
    
    cat /etc/lsb-release
    DISTRIB_ID=Pop
    DISTRIB_RELEASE=21.10
    DISTRIB_CODENAME=impish
    DISTRIB_DESCRIPTION="Pop!_OS 21.10"
    
    qtdiag
    Qt 5.15.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.2.0) on "xcb" 
    OS: Pop!_OS 21.10 [linux version 5.16.11-76051611-generic]
    
    Architecture: x86_64; features: SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX AVX2
    <snip>
    
    opened by johnblommers 2
  • Run right does not work: it executes itself multiple times

    Run right does not work: it executes itself multiple times

    Steps to reproduce: Take the flow_test asset and add "counter += 1" in Cell 5 in the middle. Initialize the counter elsewhere. Run right the cell with the "counter += 1" Print what is in the counter elsewhere. It contains 4.

    image

    bug 
    opened by FabienRoger 2
  • Separate graphs should have different variables spaces

    Separate graphs should have different variables spaces

    Graphs that are not connected together should work on separate kernels so that if the same variable name exists in both graphs, changing the variable in one graph should not change the variable in the other graph

    For example: image

    This seems wrong

    enhancement 
    opened by AlexandreSajus 1
  • Duplicating saves to clipboard permanently

    Duplicating saves to clipboard permanently

    Duplicating a block using Ctrl + D saves the block to clipboard permanently. Trying to Ctrl + C then Ctrl + V after duplicating will paste the duplicating block instead of the Ctrl + C one.

    Duplicating should not save to clipboard and should not hinder copy pasting

    bug 
    opened by AlexandreSajus 0
  • Dragging an edge on a block should highlight the block

    Dragging an edge on a block should highlight the block

    During closed beta 2, a user complained about not getting feedback when dragging an edge onto a block.

    He suggested that the block should be highlighted when dragging an edge over it to explain that the edge will connect to the block when dropped.

    In this situation: image

    The block should be highlighted

    enhancement 
    opened by AlexandreSajus 0
Releases(v1.0.0)
  • v1.0.0(Feb 24, 2022)

    PyFlow - Release 1.0.0

    First Full Release

    We are happy to release the first full version of PyFlow by Bycelium ! Feel free to reach us on discord for feedback, suggestions, contribution or a simple chat !

    What's Changed

    • :beetle: Fix block execution freeze by @AlexandreSajus in #138
    • :beetle: Fix zoom stuck by @FabienRoger in #145
    • :beetle: Fix socket missing when converting from .ipynb by @FabienRoger in #143
    • :beetle: Fix execution of complex ipynb by @AlexandreSajus in #147
    • :beetle: Deal with ipynb of different format by @FabienRoger in #221
    • :tada: Sort blocks when saving as ipynb by @FabienRoger in #144
    • :beetle: Paste exactly where the mouse is by @FabienRoger in #224
    • :tada: Restrict file loading to .ipyg and .ipynb by @FabienRoger in #223
    • :beetle: Fix click-selection bug by @FabienRoger in #226
    • 🎉 Create a distinct clipboard for blocks by @FabienRoger in #229
    • 🎉:art: Switch to vertical layout by @FabienRoger in #227
    • :tada: Add logging & improve CLI by @MathisFederico in #231
    • :tada: Add custom undo system by @FabienRoger in #118
    • :tada: Make execution flow ignore off-sockets by @FabienRoger in #255
    • 🎉 Add socket on/off toggle by @FabienRoger in #254
    • :tada: Create a new add socket button by @FabienRoger in #249
    • :art: Make blocks output more visible by @FabienRoger in #257
    • :art: Highlight the add edge button on block hover by @FabienRoger in #258
    • :beetle: Removes kernel timeout by @AlexandreSajus in #259
    • ☔ Add python 3.10 support by @MathisFederico in #262
    • :tada: Add interrupt execution on error by @AlexandreSajus in #265
    • 🪲 Fix block removing crash by @FabienRoger in #267
    • :tada: Add button to create linked block by @AlexandreSajus in #266
    • :tada: Improve markdown editing by @FabienRoger in #269
    • :tada: Add new shortcuts by @AlexandreSajus in #264
    • 🎉 Make shift+enter in editor run left by @FabienRoger in #270
    • :tada: Add prompt before exiting the program by @FabienRoger in #271
    • :beetle: Prevent crash when there is a loop by @FabienRoger in #279
    • 🎉 🎨 Add persistent colors by @MathisFederico in #276
    • :beetle: Prevent checkpoint when the scene has not changed by @FabienRoger in #281
    • :art: Set exit font color to white by @AlexandreSajus in #285
    • :tada: Add zoom in and out shortcut by @FabienRoger in #286
    • :beetle: Fix Ctrl+z crash by @FabienRoger in #289
    • :tada: Add editing navigation using alt & escape by @MathisFederico in #287
    • :art: updated gifs and README by @AlexandreSajus in #290

    Full Changelog: https://github.com/Bycelium/PyFlow/compare/v1.0.0-beta...v1.0.0

    Source code(tar.gz)
    Source code(zip)
  • v1.0.0-beta(Jan 8, 2022)

    PyFlow - Release 1.0.0-beta

    First Beta Release

    We are happy to release the first beta version of PyFlow by Bycelium ! More is to come as we will have our features tested in the following weeks ! Feel free to reach us on discord for feedback, suggestions, contribution or a simple chat !

    What's Changed

    • :tada: Add base node editor application inspired from this tutorials series by @MathisFederico
    • :tada: Bring selected blocks to the front. by @vanyle in https://github.com/Bycelium/PyFlow/pull/11
    • :memo: Write a CONTRIBUTING file with contributing guidelines by @vanyle in https://github.com/Bycelium/PyFlow/pull/13
    • :beetle: Fix the null pointer error issue when deleting a code block by @vanyle in https://github.com/Bycelium/PyFlow/pull/14
    • 📝 Add docstrings to graphics classes by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/15
    • :tada: Add multiple windows handleling by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/18
    • :beetle: Fix cursor and resize by @vanyle in https://github.com/Bycelium/PyFlow/pull/29
    • :tada: Add select pasted items by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/30
    • ☔ Integration tests by @vanyle in https://github.com/Bycelium/PyFlow/pull/31
    • :wrench: ☔ Refactor integration tests by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/34
    • :tada: :art: Syntax highlighting and Themes by @vanyle in https://github.com/Bycelium/PyFlow/pull/33
    • :tada: Add IPython kernel by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/17
    • :tada: Add IPython console by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/38
    • :memo: :art: better readme gif by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/39
    • ✨ Autopep8, shorter lines, docstring and removed unnecessary function by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/40
    • 📝 ☔ Add codacy workflow and total coverage badge by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/45
    • 🔨 Sizes and widgets refactor by @vanyle in https://github.com/Bycelium/PyFlow/pull/41
    • :tada: :art: Adds ANSI color coding support in codeblocks by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/53
    • 🎉 Add saves and loads codeblock output by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/55
    • :tada: Add separate threads for GUI and Kernel by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/58
    • :tada: Add socket flow type by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/59
    • :tada: New block creation by @vanyle in https://github.com/Bycelium/PyFlow/pull/60
    • :art: Increases output fontsize by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/69
    • 🎉 Prevent bad autoscroll in PyEditor by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/73
    • :tada: Add arrow navigation from block to block by @vanyle in https://github.com/Bycelium/PyFlow/pull/74
    • :tada: 🔨 Improve autoscroll & Tests refactor by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/77
    • :beetle: Improve codeblock displays for tensorflow history by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/79
    • :tada: Add open example from command line by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/78
    • :beetle: Hide output panel without output by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/70
    • :tada: Editable titles and :wrench: Refactor of block widgets by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/81
    • Add move to global view by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/84
    • :memo: Add Discord link and beta disclaimer by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/87
    • :tada: Add support for new block types by @vanyle in https://github.com/Bycelium/PyFlow/pull/80
    • 🎉 Add sockets on codeblocks by default by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/89
    • :tada: Functional flow execution by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/98
    • :tada: Add zoom on blocks pressing spacebar by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/91
    • 🎉 Improve arrow navigation by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/99
    • :beetle: Fix splitter position saving by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/101
    • :beetle: Add html output support by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/102
    • :beetle: Add indentation in pyeditor by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/104
    • 🪲 Fix 'Save As' bug by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/107
    • :beetle: Fix saving bug by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/105
    • :tada: Adds the ability to cancel execution by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/103
    • :sparkles: switched autopep8 to black by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/115
    • :tada: Add notebook-pygraph conversion by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/86
    • 🪲 Fix default fields handling by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/96
    • :umbrella: Add execution flow testing by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/116
    • :sparkles: Apply black formatter to everything by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/120
    • :memo: Improve CONTRIBUTING.md by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/121
    • :umbrella: Add unit tests to ipynb conversion by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/117
    • 🛠️ Execution Refactor & 🎉 Nested Nodes by @vanyle in https://github.com/Bycelium/PyFlow/pull/113
    • :tada: Add Visual Flow by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/114
    • :beetle: Fix editing a block resets output's states by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/127
    • 🪲 Fix bug related to ipynb conversion by @FabienRoger in https://github.com/Bycelium/PyFlow/pull/129
    • 📝 🎨 Adds gifs describing each main feature on README.md by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/130
    • :beetle: fixes run_right without output by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/134
    • 🔨 Huge refactor before release by @AlexandreSajus in https://github.com/Bycelium/PyFlow/pull/133
    • :tada: Released the beta 1.0.0 by @MathisFederico in https://github.com/Bycelium/PyFlow/pull/135

    New Contributors

    • @vanyle made their first contribution in https://github.com/Bycelium/PyFlow/pull/10
    • @AlexandreSajus made their first contribution in https://github.com/Bycelium/PyFlow/pull/17
    • @FabienRoger made their first contribution in https://github.com/Bycelium/PyFlow/pull/84
    Source code(tar.gz)
    Source code(zip)
Owner
null
The open-source tool for building high-quality datasets and computer vision models

The open-source tool for building high-quality datasets and computer vision models. Website • Docs • Try it Now • Tutorials • Examples • Blog • Commun

Voxel51 209 Feb 17, 2021
An open-source plotting library for statistical data.

Lets-Plot Lets-Plot is an open-source plotting library for statistical data. It is implemented using the Kotlin programming language. The design of Le

JetBrains 820 Jan 6, 2023
An open-source plotting library for statistical data.

Lets-Plot Lets-Plot is an open-source plotting library for statistical data. It is implemented using the Kotlin programming language. The design of Le

JetBrains 509 Feb 17, 2021
RockNext is an Open Source extending ERPNext built on top of Frappe bringing enterprise ready utilization.

RockNext is an Open Source extending ERPNext built on top of Frappe bringing enterprise ready utilization.

Matheus Breguêz 13 Oct 12, 2022
Implement the Perspective open source code in preparation for data visualization

Task Overview | Installation Instructions | Link to Module 2 Introduction Experience Technology at JP Morgan Chase Try out what real work is like in t

Abdulazeez Jimoh 1 Jan 23, 2022
Visual Python is a GUI-based Python code generator, developed on the Jupyter Notebook environment as an extension.

Visual Python is a GUI-based Python code generator, developed on the Jupyter Notebook environment as an extension.

Visual Python 564 Jan 3, 2023
PyFlow is a general purpose visual scripting framework for python

PyFlow is a general purpose visual scripting framework for python. State Base structure of program implemented, such things as packages disco

null 1.8k Jan 7, 2023
The visual framework is designed on the idea of module and implemented by mixin method

Visual Framework The visual framework is designed on the idea of module and implemented by mixin method. Its biggest feature is the mixins module whic

LEFTeyes 9 Sep 19, 2022
Lumen provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

Lumen project provides a framework for visual analytics, which allows users to build data-driven dashboards from a simple yaml specification

HoloViz 120 Jan 4, 2023
Make visual music sheets for thatskygame (graphical representations of the Sky keyboard)

sky-python-music-sheet-maker This program lets you make visual music sheets for Sky: Children of the Light. It will ask you a few questions, and does

null 21 Aug 26, 2022
A small script written in Python3 that generates a visual representation of the Mandelbrot set.

Mandelbrot Set Generator A small script written in Python3 that generates a visual representation of the Mandelbrot set. Abstract The colors in the ou

null 1 Dec 28, 2021
This is a small program that prints a user friendly, visual representation, of your current bsp tree

bspcq, q for query A bspc analyzer (utility for bspwm) This is a small program that prints a user friendly, visual representation, of your current bsp

nedia 9 Apr 24, 2022
Pebble is a stat's visualization tool, this will provide a skeleton to develop a monitoring tool.

Pebble is a stat's visualization tool, this will provide a skeleton to develop a monitoring tool.

Aravind Kumar G 2 Nov 17, 2021
Yata is a fast, simple and easy Data Visulaization tool, running on python dash

Yata is a fast, simple and easy Data Visulaization tool, running on python dash. The main goal of Yata is to provide a easy way for persons with little programming knowledge to visualize their data easily.

Cybercreek 3 Jun 28, 2021
Dipto Chakrabarty 7 Sep 6, 2022
Displaying plot of death rates from past years in Poland. Data source from these years is in readme

Average-Death-Rate Displaying plot of death rates from past years in Poland The goal collect the data from a CSV file count the ADR (Average Death Rat

Oliwier Szymański 0 Sep 12, 2021
erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes

erdantic is a simple tool for drawing entity relationship diagrams (ERDs) for Python data model classes. Diagrams are rendered using the venerable Graphviz library.

DrivenData 129 Jan 4, 2023
A simple python tool for explore your object detection dataset

A simple tool for explore your object detection dataset. The goal of this library is to provide simple and intuitive visualizations from your dataset and automatically find the best parameters for generating a specific grid of anchors that can fit you data characteristics

GRADIANT - Centro Tecnolóxico de Telecomunicacións de Galicia 142 Dec 25, 2022
Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Minimalistic tool to visualize how the routes to a given target domain change over time, feat. Python 3.10 & mermaid.js

Péter Ferenc Gyarmati 1 Jan 17, 2022