module cli.head_cli

Short summary

module pyensae.cli.head_cli

Wrapper function file_head() into a command line.

Functions

function

truncated documentation

file_head_cli

Takes the first lines from a file using function file_head().

Documentation

Wrapper function file_head into a command line.

New in version 1.5.

source on GitHub

pyensae.cli.head_cli.file_head_cli(fLOG=<built-in function print>, args=None)

Takes the first lines from a file using function file_head.

Parameters:
  • fLOG – logging function

  • args – to overwrite sys.args

extract the first lines of a file

Extracts the first line of a file.

file_head_cli –help

usage: file_head [-h] [-f FILENAME] [-n NBLINE] [-e ENCODING] [-er ERRORS]

Extracts the first *nbline* of a file (assuming it is text file).

optional arguments:
  -h, --help            show this help message and exit
  -f FILENAME, --filename FILENAME
                        filename (default: None)
  -n NBLINE, --nbline NBLINE
                        number of lines (default: 10)
  -e ENCODING, --encoding ENCODING
                        encoding (default: utf8)
  -er ERRORS, --errors ERRORS
                        see open (default: strict)

source on GitHub