rechu.command package¶
Subpackages¶
- rechu.command.new package
- Subpackages
- rechu.command.new.step package
- Submodules
- rechu.command.new.step.base module
- rechu.command.new.step.discounts module
- rechu.command.new.step.edit module
- rechu.command.new.step.help module
- rechu.command.new.step.meta module
- rechu.command.new.step.products module
- rechu.command.new.step.quit module
- rechu.command.new.step.read module
- rechu.command.new.step.view module
- rechu.command.new.step.write module
- Module contents
- rechu.command.new.step package
- Submodules
- rechu.command.new.input module
- Module contents
- Subpackages
Submodules¶
rechu.command.alembic module¶
Subcommand to run Alembic commands for database migration.
- final class rechu.command.alembic.Alembic[source]¶
Bases:
BaseRun an alembic command.
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [('args', {'help': 'alembic arguments', 'nargs': '*'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'add_help': False, 'help': 'Perform database revision management', 'prefix_chars': '\x00'}¶
rechu.command.base module¶
Base for receipt subcommands.
- class rechu.command.base.ArgumentKeywords[source]¶
Bases:
TypedDictKeyword arguments acceptable for registering an argument to a subparser of an argument parser.
- class rechu.command.base.Base[source]¶
Bases:
NamespaceAbstract command handling.
- classmethod get_command(name: str) Base[source]¶
Create a command instance for the given subcommand name.
- classmethod register(name: str) Callable[[type[CommandT]], type[CommandT]][source]¶
Register a subcommand.
- classmethod register_arguments() ArgumentParser[source]¶
Create an argument parser for all registered subcommands.
- classmethod start(executable: str, argv: Sequence[str]) None[source]¶
Parse arguments from a sequence of command line arguments and determine which command to run, register any arguments to it and finally execute the action of the command.
- subparser_keywords: ClassVar[SubparserKeywords] = {}¶
rechu.command.config module¶
Subcommand to generate an amalgamate settings file.
- final class rechu.command.config.Config[source]¶
Bases:
BaseObtain settings file representation.
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [(('section',), {'help': 'Optional table section name to filter on', 'metavar': 'SECTION', 'nargs': '?'}), (('key',), {'help': 'Optional settings key to filter on', 'metavar': 'KEY', 'nargs': '?'}), (('-f', '--file'), {'help': 'Generate based on specific TOML file'}), (('-p', '--prefix'), {'default': (), 'help': 'Section prefixes in specific TOML file to look up', 'nargs': '+'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Generate settings TOML representation with comments.', 'help': 'Obtain settings representation'}¶
rechu.command.create module¶
Database schema creation subcommand.
rechu.command.delete module¶
Subcommand to remove receipt YAML file(s) from data path and database.
- final class rechu.command.delete.Delete[source]¶
Bases:
BaseDelete YAML files and database entries for receipts.
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [('files', {'help': 'One or more files to delete', 'metavar': 'FILE', 'nargs': '+'}), (('-k', '--keep'), {'action': 'store_true', 'default': False, 'help': 'Do not delete YAML file from data path'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'aliases': ['rm'], 'description': 'Delete receipts from the YAML data paths and from the database.', 'help': 'Delete receipt files and/or database entries'}¶
rechu.command.dump module¶
Subcommand to export database entries as YAML files.
- final class rechu.command.dump.Dump[source]¶
Bases:
BaseDump YAML files from the database.
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [('files', {'help': 'One or more product inventories or receipts to write; if no filenames are given, then dump the entire database', 'metavar': 'FILE', 'nargs': '*'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Create one or more YAML files based on database state.', 'help': 'Export entities from the database'}¶
rechu.command.match module¶
Subcommand to match entities in the database.
- final class rechu.command.match.Match[source]¶
Bases:
BaseUpdate entities with references to metadata based on matching patterns.
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [(('-u', '--update'), {'action': 'store_true', 'default': False, 'help': 'Also update existing matched product references'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Match products based on labels, prices and discounts and connect the items to their product metadata.', 'help': 'Connect receipt product items to metadata'}¶
rechu.command.read module¶
Subcommand to import receipt YAML files.
- final class rechu.command.read.Read[source]¶
Bases:
BaseRead updated YAML files and import them to the database.
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Find YAML files for products and receipts stored in the data paths and import new or updated entities to the database.', 'help': 'Import updated product and receipt files to the database'}¶
Module contents¶
Subcommand collection package.
- class rechu.command.Alembic[source]¶
Bases:
BaseRun an alembic command.
- logger: logging.Logger¶
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [('args', {'help': 'alembic arguments', 'nargs': '*'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'add_help': False, 'help': 'Perform database revision management', 'prefix_chars': '\x00'}¶
- class rechu.command.Base[source]¶
Bases:
NamespaceAbstract command handling.
- classmethod get_command(name: str) Base[source]¶
Create a command instance for the given subcommand name.
- classmethod register(name: str) Callable[[type[CommandT]], type[CommandT]][source]¶
Register a subcommand.
- classmethod register_arguments() ArgumentParser[source]¶
Create an argument parser for all registered subcommands.
- classmethod start(executable: str, argv: Sequence[str]) None[source]¶
Parse arguments from a sequence of command line arguments and determine which command to run, register any arguments to it and finally execute the action of the command.
- subparser_keywords: ClassVar[SubparserKeywords] = {}¶
- class rechu.command.Config[source]¶
Bases:
BaseObtain settings file representation.
- logger: logging.Logger¶
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [(('section',), {'help': 'Optional table section name to filter on', 'metavar': 'SECTION', 'nargs': '?'}), (('key',), {'help': 'Optional settings key to filter on', 'metavar': 'KEY', 'nargs': '?'}), (('-f', '--file'), {'help': 'Generate based on specific TOML file'}), (('-p', '--prefix'), {'default': (), 'help': 'Section prefixes in specific TOML file to look up', 'nargs': '+'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Generate settings TOML representation with comments.', 'help': 'Obtain settings representation'}¶
- class rechu.command.Create[source]¶
Bases:
BaseCreate the database with the database schema.
- logger: logging.Logger¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Create database schema tables at the configured URI.', 'help': 'Create the database and schema'}¶
- class rechu.command.Delete[source]¶
Bases:
BaseDelete YAML files and database entries for receipts.
- logger: logging.Logger¶
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [('files', {'help': 'One or more files to delete', 'metavar': 'FILE', 'nargs': '+'}), (('-k', '--keep'), {'action': 'store_true', 'default': False, 'help': 'Do not delete YAML file from data path'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'aliases': ['rm'], 'description': 'Delete receipts from the YAML data paths and from the database.', 'help': 'Delete receipt files and/or database entries'}¶
- class rechu.command.Dump[source]¶
Bases:
BaseDump YAML files from the database.
- logger: logging.Logger¶
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [('files', {'help': 'One or more product inventories or receipts to write; if no filenames are given, then dump the entire database', 'metavar': 'FILE', 'nargs': '*'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Create one or more YAML files based on database state.', 'help': 'Export entities from the database'}¶
- class rechu.command.Match[source]¶
Bases:
BaseUpdate entities with references to metadata based on matching patterns.
- logger: logging.Logger¶
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [(('-u', '--update'), {'action': 'store_true', 'default': False, 'help': 'Also update existing matched product references'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Match products based on labels, prices and discounts and connect the items to their product metadata.', 'help': 'Connect receipt product items to metadata'}¶
- class rechu.command.New[source]¶
Bases:
BaseCreate a YAML file for a receipt and import it to the database.
- subparser_arguments: ClassVar[Iterable[tuple[str | tuple[str, ...], ArgumentKeywords]]] = [(('-c', '--confirm'), {'action': 'store_true', 'default': False, 'help': 'Confirm before updating database files or exiting'}), (('-m', '--more'), {'action': 'store_true', 'default': False, 'help': 'Allow more discounts and metadata than product items'})]¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Interactively fill in a YAML file for a receipt and import it to the database.', 'help': 'Create receipt file and import'}¶
- class rechu.command.Read[source]¶
Bases:
BaseRead updated YAML files and import them to the database.
- logger: logging.Logger¶
- subparser_keywords: ClassVar[SubparserKeywords] = {'description': 'Find YAML files for products and receipts stored in the data paths and import new or updated entities to the database.', 'help': 'Import updated product and receipt files to the database'}¶