Skip to main content

A tool to convert markdown file to excel.

Project description

Tool to convert markdown list to Excel, mael.

Motivation

Do you use Excel for summarizing some lists as tables? Isn’t it difficult to manage Excel in git? The common repositories show differences in text files between versions but not in Excel files. How can we manage spreadsheet tables with versions? CSV is one of the choices but is it really easy? What if we can manage table data as markdown file?

This tool can convert markdown files to tables in an Excel file.

Installation

This tool is installed with pip:

$ pip install mael

Usage

  1. Initialize the directory, then initial files are created based on the templates.

    $ mael init some_dir
  2. Write your data in markdown. You can put multiple markdown files in the directory.

    # List title
    
    ## Summary
    
    Please write summary of the table data.
    
    ## List
    
    ### Column 1
    
    Value 1-1
    
    ### Column 2
    
    Value 1-2
    
    ---
    
    ### Column 1
    
    Value 2-1
    
    ---
    
    ### Column 2
    
    Value 3-2

    Separate each item with ---.

  3. Build Excel, then you can get an Excel file in the directory.

    $ mael build some_dir

    There, the Excel file contains the sheet as:

    Summary

    Please write summary of the table data.

    Column 1

    Column 2

    Column 3

    Value 1-1

    Value 2-1

    Value 2-1

    Value 3-2

    If you put multiple markdown files, the Excel file contains multiple sheets.

Attention

Please write all the files in UTF-8 encoding.

Advanced use

You can use variables. Also, you can define environmental variables for each environment.

  1. Define variables in some_dir/config/variables.ini:

    VARIABLE_1=ABCDEFG
    VARIABLE_2=HIJKLMN
  2. Use the variables in markdown files. Surround the variable name with {{ and }}:

    # List title
    
    ## Summary
    
    Variable 1 is {{ VARIABLE_1 }}.
    Variable 2 is {{ VARIABLE_2 }}.
    
    ......

    Of course, you can use the variables not only in the summary but also in the list.

  3. Build Excel, then you can get an Excel file in the directory.

    $ mael build some_dir

    There, the Excel file contains the sheet as:

    Summary

    variable 1 is ABCDEFG.
    variable 2 is HIJKLMN.
    ......

To use environmental variables, define the variables in some_dir/config/variables.${env_name}.ini, such as some_dir/config/variables.dev.ini. Environmental variable file overwrite the varabiles defined in the normal variable file, variable.ini. To build the environmental file, execute mael build some_dir -e dev, and you will get the Excel file, some_dir_dev.xlsx.

PyPI package

https://pypi.org/project/mael/

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

mael-0.0.3.35.tar.gz (13.1 kB view hashes)

Uploaded Source

Supported by

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