Skip to main content

Package to generate different kind of markdown texts

Project description

MD Generator (mdgenerator)

mdgenerator is a package to generate different kinds of markdown texts

Following details the functionality provided by the package:

  • Generate File Structure Trees in Markdown
  • Generate Tables in Markdown from pandas dataframe or python arrays

Installation

There are two ways to install mdgenerator:

  • Install mdgenerator from PyPI (recommended):
pip install mdgenerator
  • Install mdgenerator from the Github source:
git clone https://github.com/nilansaha/mdgenerator.git
cd mdgenerator
pip install .

Usage

  • Generate File Tree Structure in Markdown

    • Using Python
     from mdgenerator import generate_file_structure
    
     generate_file_structure(target_dir='/path/to/directory', output_dir='/output/directory')
    
    • Using the terminal
     mdgenerator --target_dir "/path/to/directory" --output_dir "/output/directory"
    

    Output is stored in file_structure.md in the specified output_dir

    Sample Output -

     ├── .DS_Store
     ├── mdgenerator.py
     ├── __init__.py
     ├── test.py
     ├── cli.py
     ├── file-structure.md
     ├── ABC
     |   ├── a.txt
     |   ├── BCD
     |   |   ├── b.txt
     ├── __pycache__
     |   ├── mdgenerator.cpython-37.pyc
    
  • Generate Markdown Table using Python

    • Using Python lists
     from mdgenerator import generate_table
    
     data = [['Word_1','Word_2'],['Happy','Sad'],['Nice','Bad']]
     table = generate_table(data)
     print(table)
    

    Output

    Word_1 Word_2
    Happy Sad
    Nice Bad
    • Using Pandas DataFrame
     import pandas as pd
     from mdgenerator import generate_table
    
     df = pd.DataFrame([['Happy','Sad'], ['Nice','Bad']], columns = ['Word_1','Word_2'])
     table = generate_table(df)
     print(table)
    

    Output

    Word_1 Word_2
    Happy Sad
    Nice Bad

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

mdgenerator-0.1.0.tar.gz (2.7 kB view details)

Uploaded Source

Built Distribution

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

mdgenerator-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file mdgenerator-0.1.0.tar.gz.

File metadata

  • Download URL: mdgenerator-0.1.0.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for mdgenerator-0.1.0.tar.gz
Algorithm Hash digest
SHA256 079b90657329c66b0e6bec9180fb19c637762e8f87c472f6939713da69362971
MD5 e09c6fd915965ef203ad52669c40ccb7
BLAKE2b-256 b925287e56ffc7dfb1c6cabf4508d9b966156a4a7f5fea455d997b9bb184b2fa

See more details on using hashes here.

File details

Details for the file mdgenerator-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mdgenerator-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.2

File hashes

Hashes for mdgenerator-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db13f67a42746d01af4b4d7a90033095f58559dc1c0db897bc8954c0ddcc9dfc
MD5 66ea307b81778adcf85a5bda99faa047
BLAKE2b-256 21938eff4803a352058726d00bd19731c6d99d765b873eb50b8312e0b6d672d9

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