Giter Site home page Giter Site logo

pyflow's Introduction

PyFlow

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

PyFlow is an open-source graph-structured interactive Python development tool

Check out this quick video comparing features between Pyflow to Jupyter:

Pyflow: a 2D Alternative to Jupyter

Community

Join our Discord to beta-test features, share your ideas, contribute or just to have a chat with us.

Features

  • Create blocks of code in which you can edit and run Python code

  • Move and resize blocks on an infinite 2D plane

  • Link blocks to highlight dependencies, Pyflow will then automatically run your blocks in the correct order

  • Convert your Jupyter notebooks to Pyflow graphs and vice versa

Installation

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

Install PyFlow

Using pip:

pip install byc-pyflow

Run PyFlow

python -m pyflow

See SHORTCUTS.md for a better experience.

Contributing

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

You can also join our Discord to get in touch with us.

License

See LICENSE

pyflow's People

Contributors

alexandresajus avatar fabienroger avatar mathisfederico avatar vanyle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyflow's Issues

Graph to notebook conversion

We should be able to:

  • convert .ipynb to linear graphs in .ipyg
  • convert .ipyg to .ipynb in a reversible way with branding included

Visual execution flow

Once #48 is done, we might want to add some visuals, like edges lighting up when execution is transferred and blocks highlighting when blocks are running (multi-thread would look incredible with this)

Kernel CWD is incorrect

When starting the python kernel, the current working directory should be set relative to the path of the file loaded, not relative to the opencodeblocks program.

This means that when doing:

print(open("data.txt").read())

data.txt should be located next to the .ipyg file, not next to the opencodeblocks folder.

Nodes color

We should be able to edit a node color from the UI.

Text doesn't wrap inside markdown blocks

Most of the time, in other contexts, text wraps around in markdown (editing mode, not the output). Making it wrap around removes the need for the user to add artificial line breaks (which might be destroyed when the block is resized) or to scroll horizontally to see the whole text being written.

ipynb ๐Ÿ” ipyg

image

We need to add in this menu buttons to :

  • Import from a .pynb file
  • Export to a .pynb file
  • Export to a .py python module

Create a VSCode extension

A VSCode extension could be created.
It would open ipynb files with the OpenCodeBlocks interface, save it as ipynb (with all the metadata secretly stored), making the transition between Jupyter and OCB very easy, allowing the collaboration between people using Jupyter and people using OCB.
One issue I see is that for additional blocks, the ipyg-ipynb compatibility isn't easy (in the ipyg->ipynb direction).

Executing a block while another one is running crashes the application

Currently, executing a block while another one is running displays the output of the running block. It should instead display nothing as output and show a loading animation to signal that the block will run when the other one has finished.

After feature/multithreading, this also crashes the application

Putting a block out of focus loses the undo history of a block

Currently, when a code block goes out of focus, it loses its undo history which means that pressing Ctrl+Z to undo its code does nothing. Ideally, the undo history should be saved per block. The user should be able to undo on a newly focused block.

Node code edition in UI

We should be able to "fork" a node and modify it's behavior with a python code interface in the UI.

Block navigation

We should be able to navigate from block to block using only the keyboard arrows

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

Convert blocks to widget

Block should be widgets instead of QGraphicsItem.

This would enable several things:

  • Because widget can be embedded inside other widget, we could add a QGripSize to not reimplement the resizing of blocks.
  • We could also add a QSplitter widget to separate the output panel and the code editor for better sizeing.

This would reduce the amount of ui code we have to implement are reduce ui bugs.

Socket flowtype

Socket should have a flowtype argument that would modify either the socket color or/and shape.

Font inside code is wrong

The font size of some elements inside code blocks (like strings, or comments) is uncorrect.
Moreover, the default font used (Courier) is ugly. Consolas, Inconsolata or Roboto Mono would look better.

I would recommend Roboto Mono as it is license under the Apache 2 License.
We are also compatible with the Inconsolata license.

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).

Block renaming

We should be able to rename blocks by double-clicking on the title

Cancel run button, loading animation

The user should be able to click the run cell button again to cancel a run. The button should show a loading animation when a cell is running

Output should be saved and copy-pasted

Currently, saving and loading a scene removes the outputs because they are not saved. Copy-pasting a code block does not copy its output. Saving and copying should conserve output.

Run cell button

Currently, to execute a code block, the user needs to modify the code and put the block out of focus. The user should instead be able to execute the code by pressing a "run cell" button.

App freezes when running a cell

Running a cell causes the app to freeze for a few seconds

Could be fixed by running pyqt and the kernel on different threads

Package structure, main execution

The commands:
python -m opencodeblocks
opencodeblocks
should run main.py

Might be solved by replacing main.py by main.py and placing it inside the opencodeblocks folder

Widgets (slider, image edition)

A widget block that outputs a variable could be useful.

Examples:

  • Slider block that outputs a float
  • Image editor block where one could draw a number in MNIST-style and it could be instantly evaluated by a code block containing a classifier

Class nodes

We should be able to represent a class with a node where methods are nodes themselves.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.