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
- service¶
alias of
Service
- class dffml.cli.cli.Edit(extra_config=None, **kwargs)[source]¶
Edit records
- record¶
alias of
EditRecord
- 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.ImportExportCMD(*args, **kwargs)[source]¶
Shared import export arguments
- CONFIG¶
alias of
ImportExportCMDConfig
- 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