philh_myftp_biz.file

Module Contents

Classes

_Template

XML

.XML File

PKL

.PKL File

VHDX

.VHDX File

JSON

.JSON File

INI

.INI/.PROPERTIES File

YAML

.YML/.YAML File

TXT

.TXT File

ZIP

.ZIP File

CSV

.CSV File

TOML

.TOML File

Functions

temp

Get a random path in the temporary directory

API

philh_myftp_biz.file.temp(name: str = 'undefined', ext: str = 'ph', id: Any = None) philh_myftp_biz.pc.Path

Get a random path in the temporary directory

class philh_myftp_biz.file._Template(path: philh_myftp_biz.pc.Path, default: Any = None)

Initialization

parsed: Any = None
_read = None
_save = None
read()

Read data from the file

save(data: Any)

Write data to the file

property raw: bytes
Dict()
List()
class philh_myftp_biz.file.XML(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.XML File

Initialization

_read() dict
_save(data: dict) None
class philh_myftp_biz.file.PKL(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.PKL File

Initialization

_read()
_save(value: Any) None
class philh_myftp_biz.file.VHDX(VHD: philh_myftp_biz.pc.Path, MNT: philh_myftp_biz.pc.Path, timeout: int = 30, readonly: bool = False)

.VHDX File

Initialization

mount() None
dismount() None
class philh_myftp_biz.file.JSON(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.JSON File

Initialization

_read()
_save(data: dict) None
class philh_myftp_biz.file.INI(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.INI/.PROPERTIES File

Initialization

_read()
_save(data: dict) None
class philh_myftp_biz.file.YAML(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.YML/.YAML File

Initialization

_read()
_save(data: dict) None
class philh_myftp_biz.file.TXT(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.TXT File

Initialization

_read()

Read data from the txt file

_save(data: str) None

Save data to the txt file

class philh_myftp_biz.file.ZIP

.ZIP File

path: philh_myftp_biz.pc.Path = None
class Member
_zip: zipfile.ZipFile = None
path: str = None
open()
_zip() zipfile.ZipFile
property members: list[Member]
search(term: str) list[Member]

Search for files in the archive

Ex: ZIP.search(‘test1’) -> ‘test123.json’

extractFile(member: Member, path: philh_myftp_biz.pc.Path) None

Extract a single file from the zip archive

extractAll(path: philh_myftp_biz.pc.Path) None

Extract all files from the zip archive

class philh_myftp_biz.file.CSV(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.CSV File

Initialization

_read()
_save(data: list[list]) None
class philh_myftp_biz.file.TOML(path: philh_myftp_biz.pc.Path, default: Any = None)

Bases: philh_myftp_biz.file._Template

.TOML File

Initialization

_read()
_save(data: dict) None