module filehelper.file_info

Inheritance diagram of pyquickhelper.filehelper.file_info

Short summary

module pyquickhelper.filehelper.file_info

Defines class FileInfo

source on GitHub

Classes

class

truncated documentation

FileInfo

intermediate class: it represents the data it collects about a file to determine whether or not it was modified

Functions

function

truncated documentation

checksum_md5

computes MD5 for a file

convert_st_date_to_datetime

converts a string into a datetime

is_file_string

says if the string s could be a filename

is_url_string

says if the string s could be a url

Methods

method

truncated documentation

__init__

constructor

__str__

usual

set_date

set date

set_md5

set md5

set_mdate

set mdate

Documentation

Defines class FileInfo

source on GitHub

class pyquickhelper.filehelper.file_info.FileInfo(filename, size, date, mdate, checksum)[source][source]

Bases: object

intermediate class: it represents the data it collects about a file to determine whether or not it was modified

source on GitHub

constructor

Parameters
  • filename – filename

  • size – size

  • date – date (str or datetime)

  • mdate – modification date (str or datetime)

  • checksum – to check the file was modified

Dates will be converted into datetime.

source on GitHub

__init__(filename, size, date, mdate, checksum)[source][source]

constructor

Parameters
  • filename – filename

  • size – size

  • date – date (str or datetime)

  • mdate – modification date (str or datetime)

  • checksum – to check the file was modified

Dates will be converted into datetime.

source on GitHub

__str__()[source][source]

usual

source on GitHub

set_date(date)[source][source]

set date

Parameters

date – date (a str or datetime)

source on GitHub

set_md5(checksum)[source][source]

set md5

Parameters

checksum – checksum

source on GitHub

set_mdate(mdate)[source][source]

set mdate

Parameters

mdate – mdate (a str or datetime)

source on GitHub

pyquickhelper.filehelper.file_info.checksum_md5(filename)[source][source]

computes MD5 for a file

Parameters

filename – filename

Returns

string

source on GitHub

pyquickhelper.filehelper.file_info.convert_st_date_to_datetime(t)[source][source]

converts a string into a datetime

Parameters

t – str

Returns

datetime

source on GitHub

pyquickhelper.filehelper.file_info.is_file_string(s)[source][source]

says if the string s could be a filename

Parameters

s – string

Returns

boolean

source on GitHub

pyquickhelper.filehelper.file_info.is_url_string(s)[source][source]

says if the string s could be a url

Parameters

s – string

Returns

boolean

source on GitHub