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

Uploaded Source

File details

Details for the file mael-0.0.3.35.tar.gz.

File metadata

  • Download URL: mael-0.0.3.35.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.13

File hashes

Hashes for mael-0.0.3.35.tar.gz
Algorithm Hash digest
SHA256 b6f1113b0cb4466742253ced8d08f0c17aee0aa2255d40dd1a882c8f0115c2e8
MD5 a9d97f2f22d2c1356e618d093660062b
BLAKE2b-256 8165681e3e0b5c608adffb6e30f5a0ec9dc719622939ac5b8a7d913c4caa2881

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