Cli Cli

Command line interface evaluates packages given their source URLs

class dffml.cli.cli.CLI(extra_config=None, **kwargs)[source]

CLI interface for dffml

accuracy

alias of Accuracy

edit

alias of Edit

export

alias of Export

merge

alias of Merge

predict

alias of Predict

service

alias of Service

train

alias of Train

version

alias of Version

class dffml.cli.cli.Edit(extra_config=None, **kwargs)[source]

Edit records

record

alias of EditRecord

class dffml.cli.cli.EditAllRecords(*args, **kwargs)[source]

Edit all records using operations

class dffml.cli.cli.EditCMDConfig(dataflow: str = None, config: dffml.configloader.configloader.BaseConfigLoader = None, features: dffml.feature.feature.Features = <factory>, sources: dffml.source.source.Sources = <factory>)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1
class dffml.cli.cli.EditRecord(*args, **kwargs)[source]

Edit each specified record

CONFIG

alias of EditRecordConfig

class dffml.cli.cli.EditRecordConfig(keys: List[str], dataflow: str = None, config: dffml.configloader.configloader.BaseConfigLoader = None, features: dffml.feature.feature.Features = <factory>, sources: dffml.source.source.Sources = <factory>)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1
class dffml.cli.cli.Export(*args, **kwargs)[source]

Exports records

class dffml.cli.cli.Import(*args, **kwargs)[source]

Imports records

class dffml.cli.cli.ImportExportCMD(*args, **kwargs)[source]

Shared import export arguments

CONFIG

alias of ImportExportCMDConfig

class dffml.cli.cli.ImportExportCMDConfig(port: Port)[source]
class dffml.cli.cli.Merge(extra_config=None, **kwargs)[source]

Merge record data between sources

CONFIG

alias of MergeConfig

class dffml.cli.cli.MergeConfig(src: dffml.source.source.BaseSource, dest: dffml.source.source.BaseSource)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1
class dffml.cli.cli.Version(extra_config=None, **kwargs)[source]

Print version and installed dffml packages

CONFIG

alias of VersionConfig

async static git_hash(path: Union[Path, str])[source]

If the path is a git repo we’ll return.

Examples

>>> import pathlib
>>> import asyncio
>>> import subprocess
>>>
>>> import dffml.cli.cli
>>>
>>> subprocess.check_call(["git", "init"])
0
>>> subprocess.check_call(["git", "config", "user.name", "First Last"])
0
>>> subprocess.check_call(["git", "config", "user.email", "first.last@example.com"])
0
>>> pathlib.Path("README.md").write_text("Contents")
8
>>> subprocess.check_call(["git", "add", "README.md"])
0
>>> subprocess.check_call(["git", "commit", "-m", "First commit"])
0
>>> dirty, short_hash = asyncio.run(dffml.cli.cli.Version.git_hash("."))
>>> dirty
False
>>> int(short_hash, 16) > 0
True
class dffml.cli.cli.VersionConfig(no_errors: bool = False)[source]
no_enforce_immutable()

By default, all properties of a config object are immutable. If you would like to mutate immutable properties, you must explicitly call this method using it as a context manager.

Examples

>>> from dffml import config
>>>
>>> @config
... class MyConfig:
...     C: int
>>>
>>> config = MyConfig(C=2)
>>> with config.no_enforce_immutable():
...     config.C = 1
dffml.cli.cli.failed_to_load_service(loading_what: str = 'services')[source]

Sometimes weird dependency issues show up and prevent us from loading anything. We log the traceback in that case.

dffml.cli.cli.services()[source]

Loads dffml.services.cli entrypoint and creates a CMD class incorporating all of the loaded CLI versions of services as subcommands.