mdutils.fileutils package

Submodules

mdutils.fileutils.fileutils module

class mdutils.fileutils.fileutils.MarkDownFile(name='', dirname: Optional[str] = None)[source]

Bases: object

MarkDownFile class creates a new file of MarkDown extension.

Features available are:
  • Create a file.
  • Rewrite a file with new data.
  • Write at the end of the file.
append_after_second_line(data: str)[source]

Write after the file’s first line.

Parameters:data (str) – is a string containing all the data that is written in the markdown file.
append_end(data: str)[source]

Write at the last position of a Markdown file.

Parameters:data (str) – is a string containing all the data that is written in the markdown file.
static read_file(file_name: str) → str[source]

Read a Markdown file using a file name. It is not necessary to add *.md extension.

Parameters:file_name (str) – Markdown file’s name.
Returns:return all file’s data.
Return type:str
rewrite_all_file(data: str)[source]

Rewrite all the data of a Markdown file by data.

Parameters:data (str) – is a string containing all the data that is written in the markdown file.

Module contents