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

Tells if the string s could be a filename.

is_url_string

Tells if the string s could be a url.

Methods

method

truncated documentation

__init__

__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]

Bases: object

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

source on GitHub

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]
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]

usual

source on GitHub

set_date(date)[source]

set date

Parameters

date – date (a str or datetime)

source on GitHub

set_md5(checksum)[source]

set md5

Parameters

checksum – checksum

source on GitHub

set_mdate(mdate)[source]

set mdate

Parameters

mdate – mdate (a str or datetime)

source on GitHub

pyquickhelper.filehelper.file_info.checksum_md5(filename)[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]

Converts a string into a datetime.

Parameters

t – str

Returns

datetime

source on GitHub

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

Tells 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]

Tells if the string s could be a url.

Parameters

s – string

Returns

boolean

source on GitHub