Git Product home page Git Product logo

tsv-to-md's Introduction

tsv-to-md

A python script to convert a tab-separated value (tsv) file of an aligned parallel text to a markdown text file in a prose-like format.

It is the counterpart to md-to-tsv, which converts in the opposite direction.

Instructions

  • Download the python script to-md.py

  • Place it in the folder along with the TSV file that you would like to convert to a markdown file.

  • Open your terminal and navigate to the folder where the script and your file are

  • Run the script by typing in python to-md.py PLUS the name of your file.

    All together, this means you type something like this, for example:

    python to_md.py manuscript.tsv

Formatting specifications

Input file notes:

  • The input file must be a tab-separated value file
  • The first row must be a series of headers (e.g., ID --> Arabic --> Soninke --> English)
  • The first column must be identifiers for the segments
  • The TSV can have as many columns as you want

Output file notes:

  • Identifiers become level three markdown headers via three hashtag marks (###)
  • Language segments become markdown paragraphs (that is, with an empty line between them)

Ajami Lab Use

This script was designed in the context of the Ajami Lab to facilitate the conversion of Ajami annotation data extracted from a Tropy project into a format conducive to prose-like publication (as a critical edition style chapter, appendix, etc).

Once a TSV is put into markdown format, it can easily be edited further using pandoc flavored markdown that allows for footnotes, etc., and then easily exported as a static html page or common word-processing file for Word, LibreOffice, etc.

From this perspective, the Tropy project is the single or master "source code" for export to other formats (tabular or text) designed for further analysis or publication.

Screenshots

Go from something like this:

tabbedo

To this:

prose

tsv-to-md's People

Contributors

donaldsoncd 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.