- A fundamental Python implementation of Unix/Linux
wccommand-line utility wcused for word count, byte count and/or line count for a given file as an argument- Based on the Coding Challenge instructions - https://codingchallenges.fyi/challenges/challenge-wc/
This project provides a simple text-counting tool that can be used on files or piped input.
- Count lines
- Count words
- Count bytes
- Accept one or more files as input
- Read from standard input
- Clone the repository
$ git clone https://github.com/prak112/CodingChallenge_wc-tool.git- Change directory
$ cd CodingChallenge_wc-tool/- Use
pipxto install as a global tool by installing within a managed virtual environment
$ pipx install cc_wc$ cc_wc --help #lists usage, arguments, options for the tool (Thanks to 'typer')-l,--lines- count lines only-w,--words- count words only-c,--bytes- count bytes only-m,--charcters- count characters only
$ cc_wc file.txt #counts lines, words, bytes of file.txt
7145 58164 335045 test.txt$ cc_wc -l file.txt #counts lines in file.txt
7145 test.txt$ cat file.txt | cc_wc -w #counts words by reading from standard input
58164- Project layout and guide for a CLI tool from Official Python documentation
- Official Typer documentation
- Blog tutorial with a flat-hierarchy project setup for CLI tool