mloq.files#

This module defines all the different assets accessible from mloq.

Module Contents#

Classes#

File

Generates project files.

Functions#

file(name, path[, description, dst, is_static])

Define a new asset as a File namedtuple.

read_file(file)

Return and string with the content of the provided file.

Attributes#

ASSETS_PATH

SHARED_ASSETS_PATH

MLOQ_ASSETS_PATH

REQUIREMENTS_PATH

mloq_yml

what_mloq_generated

requirements

dogfood_req

makefile

pyproject_toml

class mloq.files.File[source]#

Bases: NamedTuple

Generates project files.

This class defines templating files, which will be rendered according to the user’s configuration. Besides, File instances have additional attributes used for specifying the destination of the generated file.

Attributes of this class:

name: Name of the templating file. src: Location of the templating file. dst: Name of the file generated from the templating file. description: Short description of the current file. is_static: Boolean value. If True, the templating file does not

admit render parameters.

name :str#
src :pathlib.Path#
dst :pathlib.Path#
description :str#
is_static :bool#
mloq.files.file(name, path, description=None, dst=None, is_static=False)[source]#

Define a new asset as a File namedtuple.

Parameters
  • name (str) –

  • path (Union[pathlib.Path, str]) –

  • description (Optional[str]) –

  • dst (Optional[Union[pathlib.Path, str]]) –

  • is_static (bool) –

Return type

File

mloq.files.ASSETS_PATH#
mloq.files.SHARED_ASSETS_PATH#
mloq.files.MLOQ_ASSETS_PATH#
mloq.files.REQUIREMENTS_PATH#
mloq.files.mloq_yml#
mloq.files.what_mloq_generated#
mloq.files.requirements#
mloq.files.dogfood_req#
mloq.files.makefile#
mloq.files.pyproject_toml#
mloq.files.read_file(file)[source]#

Return and string with the content of the provided file.

Parameters

file (File) –

Return type

str