picopipe


Namepicopipe JSON
Version 1.0.2 PyPI version JSON
download
home_pagehttps://github.com/dsblank/picopipe
SummaryA small pipeline framework
upload_time2023-11-29 13:41:58
maintainer
docs_urlNone
authorDouglas Blank
requires_python>=3.9
licenseApache 2.0
keywords machine learning artificial intelligence pipelines python data science
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # picopipe
A small pipeline framework built on top of functions

An article describing development and use of picopipe: 
[Towards Data Science: The Worlds Smallest Data Pipeline Framework](https://medium.com/towards-data-science/the-worlds-smallest-data-pipeline-framework-408eaf1a4ce4)

## Installation

```shell
pip install picopipe
```
## Examples

```python
def add1(value):
    return value + 1

def add2(value):
    return value + 2

def add3(value):
    return value + 3

from picopipe import pipeline

p = pipeline(add1, add2, add3)
p([10, 20, 30])
```

See tests for more examples.

## Visualization

```python
with open("pipeline.mmd", "w") as fp:
    fp.write(to_mermaid(p))
```

Mermaid file (renders in github):

```mermaid
flowchart
subgraph pipeline_98e33e0628b546268abb2af5f74e50f1 ["pipeline"]
end
subgraph pipeline_205813c806fd4b37b40309497768f7c1 ["pipeline"]
    node0["identity"]
    node1["is_not_none"]
    node2["identity"]
end
node0 --> node1
node1 --> node2
click node0 console.log "def&#8194;identity(value):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;value<br/>"
click node1 console.log "@pfilter<br/>def&#8194;is_not_none(v):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;v&#8194;is&#8194;not&#8194;None<br/>"
click node2 console.log "def&#8194;identity(value):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;value<br/>"
subgraph pipeline_d2f205ef957a428abbaa208241125819 ["pipeline"]
    node3["add1"]
    node4["[lambda]"]
end
node3 --> node4
click node3 console.log "def&#8194;add1(value):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;value&#8194;+&#8194;1<br/>"
click node4 console.log "lambda&#8194;...:&#8194;..."
pipeline_98e33e0628b546268abb2af5f74e50f1 --> pipeline_205813c806fd4b37b40309497768f7c1
pipeline_205813c806fd4b37b40309497768f7c1 --> pipeline_d2f205ef957a428abbaa208241125819
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dsblank/picopipe",
    "name": "picopipe",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "",
    "keywords": "machine learning,artificial intelligence,pipelines,python,data science",
    "author": "Douglas Blank",
    "author_email": "",
    "download_url": "",
    "platform": "Linux",
    "description": "# picopipe\nA small pipeline framework built on top of functions\n\nAn article describing development and use of picopipe: \n[Towards Data Science: The Worlds Smallest Data Pipeline Framework](https://medium.com/towards-data-science/the-worlds-smallest-data-pipeline-framework-408eaf1a4ce4)\n\n## Installation\n\n```shell\npip install picopipe\n```\n## Examples\n\n```python\ndef add1(value):\n    return value + 1\n\ndef add2(value):\n    return value + 2\n\ndef add3(value):\n    return value + 3\n\nfrom picopipe import pipeline\n\np = pipeline(add1, add2, add3)\np([10, 20, 30])\n```\n\nSee tests for more examples.\n\n## Visualization\n\n```python\nwith open(\"pipeline.mmd\", \"w\") as fp:\n    fp.write(to_mermaid(p))\n```\n\nMermaid file (renders in github):\n\n```mermaid\nflowchart\nsubgraph pipeline_98e33e0628b546268abb2af5f74e50f1 [\"pipeline\"]\nend\nsubgraph pipeline_205813c806fd4b37b40309497768f7c1 [\"pipeline\"]\n    node0[\"identity\"]\n    node1[\"is_not_none\"]\n    node2[\"identity\"]\nend\nnode0 --> node1\nnode1 --> node2\nclick node0 console.log \"def&#8194;identity(value):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;value<br/>\"\nclick node1 console.log \"@pfilter<br/>def&#8194;is_not_none(v):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;v&#8194;is&#8194;not&#8194;None<br/>\"\nclick node2 console.log \"def&#8194;identity(value):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;value<br/>\"\nsubgraph pipeline_d2f205ef957a428abbaa208241125819 [\"pipeline\"]\n    node3[\"add1\"]\n    node4[\"[lambda]\"]\nend\nnode3 --> node4\nclick node3 console.log \"def&#8194;add1(value):<br/>&#8194;&#8194;&#8194;&#8194;return&#8194;value&#8194;+&#8194;1<br/>\"\nclick node4 console.log \"lambda&#8194;...:&#8194;...\"\npipeline_98e33e0628b546268abb2af5f74e50f1 --> pipeline_205813c806fd4b37b40309497768f7c1\npipeline_205813c806fd4b37b40309497768f7c1 --> pipeline_d2f205ef957a428abbaa208241125819\n```\n",
    "bugtrack_url": null,
    "license": "Apache 2.0",
    "summary": "A small pipeline framework",
    "version": "1.0.2",
    "project_urls": {
        "Homepage": "https://github.com/dsblank/picopipe"
    },
    "split_keywords": [
        "machine learning",
        "artificial intelligence",
        "pipelines",
        "python",
        "data science"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d0544bd565bc0930ce6998a500d53ef6c7a03d31ed89df9702cbac1bfabade7e",
                "md5": "cc5274324509ce8abc4ce5f6a08c53ee",
                "sha256": "eafc6eff96f45d11253d862ab9956bb13f69d5a08c4caea8587fa67444f3be62"
            },
            "downloads": -1,
            "filename": "picopipe-1.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cc5274324509ce8abc4ce5f6a08c53ee",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 8096,
            "upload_time": "2023-11-29T13:41:58",
            "upload_time_iso_8601": "2023-11-29T13:41:58.403709Z",
            "url": "https://files.pythonhosted.org/packages/d0/54/4bd565bc0930ce6998a500d53ef6c7a03d31ed89df9702cbac1bfabade7e/picopipe-1.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-29 13:41:58",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dsblank",
    "github_project": "picopipe",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "picopipe"
}
        
Elapsed time: 0.14664s