Skip to content

Simple project that checks basic techniques (stdin/stdout, json, regex) in several languages

License

Notifications You must be signed in to change notification settings

DmitryBogomolov/training-plan-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCI

Training Plan Parser

Parses training plan in text format (like in sample) and outputs html page.

In terminal

  • Pass path/to/plan.txt as command line argument; path/to/plan.html is created.

    ./run path/to/plan.txt
  • Pass plan as stdin.

    cat path/to/plan.txt | ./run - > path/to/plan.html

    or

    ./run - < path/to/plan.txt > path/to/plan.html

In code

  • Pass path/to/plan.txt.

    from trpp import process_file
    
    process_file('path/to/plan.txt')
  • Manage streams manually.

    from trpp import process
    
    with open('path/to/plan.txt', mode='r') as in_stream, open('path/to/plan.html', mode='w') as out_stream:
        process(in_stream, out_stream)

Format

See sample.

About

Simple project that checks basic techniques (stdin/stdout, json, regex) in several languages

Resources

License

Stars

Watchers

Forks

Packages

No packages published