Code Monkey home page Code Monkey logo

pipen-report's Introduction

pipen-report

Report generation system for pipen

Installation

pip install -U pipen-report

Usage

from pipen import Proc, Pipen

class Figure(Proc):
    """Generate figures"""
    input_keys = ['a:var']
    input = [1,2,3]
    output = 'outfile:file:{{in.a}}.jpg'
    script = '''\
    wget https://picsum.photos/200/300 -O {{out.outfile}}
    '''
    plugin_opts = 'Figure.svx'

class Table(Figure):
    """Generate tables"""
    output = 'outfile:file:{{in.a}}.txt'
    script = '''\
    #!/usr/bin/env python

    outfile = "{{out.outfile}}"
    with open(outfile, 'w') as fout:
        fout.write("""\\
    id	first_name	last_name	email	gender	ip_address
    1	Lynda	Scirman	[email protected]	Female	22.123.155.57
    2	Moll	Niset	[email protected]	Female	6.154.75.63
    3	Jory	Mewitt	[email protected]	Male	233.225.101.101
    4	Dukie	Onslow	[email protected]	Male	238.209.40.250
    5	Carlee	Grasha	[email protected]	Female	22.65.237.2
    6	Leanora	Doughtery	[email protected]	Female	54.41.211.142
    7	Winona	Levison	[email protected]	Female	15.186.215.132
    8	Orrin	Baldick	[email protected]	Male	221.49.10.188
    9	Ingmar	Papez	[email protected]	Male	225.88.240.74
    10	Arlena	Compford	[email protected]	Female	49.30.204.242
    11	Domenico	Lorinez	[email protected]	Male	106.63.35.124
    12	Yul	Bonifas	[email protected]	Male	198.152.245.214
    13	Tony	Antonignetti	[email protected]	Male	61.64.103.108
    14	Bayard	Gilhooley	[email protected]	Male	124.48.176.234
    15	Hillary	Ashbee	[email protected]	Female	111.91.131.252
    16	Cherye	Spuffard	[email protected]	Female	206.113.100.79
    17	Dorey	Lorraway	[email protected]	Female	179.210.96.234
    18	Iolande	McKilroe	[email protected]	Female	92.62.191.79
    19	Ermina	Woodroofe	[email protected]	Female	193.75.48.192
    20	Quill	Skoggins	[email protected]	Male	157.11.232.242
    """)
    '''
    plugin_opts = 'Table.svx'

Pipen('Test pipeline',
      'Just for pipen-report testing').starts([Figure, Table]).run()

Figure.svx

# Generated Figures

{% for job in jobs %}

## This is a very long heading for figure {{job.index}}

![Figure{{job.index}}]({{job.out.outfile}})

{% endfor %}

# Another very very veryvery veryvery very long heading at level 1

## Short one

### Third level

## Very very very very very very very long one

## Another short one

Table.svx

<script>
import { DataTable } from "pipen-smelte";

</script>

# Heading 1

## SubHeading 2
<DataTable
    data="{{ job.out.outfile | @report.datatable: delimiter='\t' }}"
    datafile="{{ job.out.outfile }}"
    />

## SubHeading 3
<DataTable
    data="{{ jobs[1].out.outfile | @report.datatable: delimiter='\t', cols=['id', 'first_name', 'last_name'], rows=10 }}"
    datafile="{{ jobs[1].out.outfile }}"
    />

See here for the reports.

pipen-report's People

Contributors

pwwang avatar

Watchers

 avatar

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.