Skip to main content

Pandas pipeline in graphviz

Project description

Pandas pipeline in graphviz

Python package to build a nice explanative schema of a data processing pipeline in pandas.

It's heavily inspired by dask's .visualize method, but improved with 2 useful features:

  • visualize columns names in data nodes
  • highlight created columns at each task

Here is an example from the examples folder:

Installation

Pip

Install with pip:

$ pip install pandas-pipeline-graphviz

Manual installation

Install manually:

  • git clone
  • use python setup.py

Usage

Disclaimer

⚠️ WARNING — it's a hack!

There are no reliable methods in python to get variables names, either as input or as output. The methods used in this package are quite hacky, as discussed in this stackoverflow thread.

To build the graph, this package makes use of:

  • globals() to get the names of input dataframes, doing a comparison between the input dataframes and all the variables available in the global variables.
  • inspect.stack() to get the name of the output dataframe, gathering the code lines calling the function and parsing it to find the output. Currently it supports only single-output transformations.

Both methods should be considered as experimental and the behavior of the decorator is expected to break easily if it's not used as presented in the examples.

Conditions for use

  • do not use several decorators on your function, only this decorator, otherwise it will break the output dataframe name detection through inspect.stack()
  • use only single output transformation functions, i.e. functions which return only 1 dataframe.

Examples

See examples folder in the repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pandas-pipeline-graphviz-0.1.5.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pandas_pipeline_graphviz-0.1.5-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file pandas-pipeline-graphviz-0.1.5.tar.gz.

File metadata

  • Download URL: pandas-pipeline-graphviz-0.1.5.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.18.0 CPython/3.7.7

File hashes

Hashes for pandas-pipeline-graphviz-0.1.5.tar.gz
Algorithm Hash digest
SHA256 97e3d6e059ccf8a74d2176f7ef7f6667f6d1d94c8704e83e13373e35204923fa
MD5 26ff581bbf40decdd6a9fd6f205d2045
BLAKE2b-256 3a0d79a7d34191897bd5f04bb81e4a3809f4b191d7a21eeede88f3bfc09dd325

See more details on using hashes here.

File details

Details for the file pandas_pipeline_graphviz-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: pandas_pipeline_graphviz-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.18.0 CPython/3.7.7

File hashes

Hashes for pandas_pipeline_graphviz-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 47c730551ca54bd7d4991287607300d83dd88b1d75e499b44ca75f5964037b44
MD5 4fcbe7d7342498192bf0fc8f925a3b62
BLAKE2b-256 f54bd85360a37828755ee4efe55259456b23f469d5409e96f3cdb13bd18892c7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page