rechu.command package¶
Subpackages¶
Submodules¶
rechu.command.alembic module¶
Subcommand to run Alembic commands for database migration.
- class rechu.command.alembic.Alembic[source]¶
Bases:
Base
Run an alembic command.
- subparser_arguments: SubparserArguments = [('args', {'help': 'alembic arguments', 'nargs': '*'})]¶
- subparser_keywords: 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:
Generic
[ArgumentT
],TypedDict
Keyword arguments acceptable for registering an argument to a subparser of an argument parser.
- const: ArgumentT¶
- class rechu.command.base.Base[source]¶
Bases:
Namespace
Abstract command handling.
- classmethod get_command(name: str) Base [source]¶
Create a command instance for the given subcommand name.
- 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: SubparserKeywords = {}¶
rechu.command.config module¶
Subcommand to generate an amalgamate settings file.
- class rechu.command.config.Config[source]¶
Bases:
Base
Obtain settings file representation.
- subparser_arguments: SubparserArguments = [(('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: SubparserKeywords = {'description': 'Generate settings TOML representation with comments.', 'help': 'Obtain settings representation'}¶
rechu.command.create module¶
Database schema creation subcommand.
- class rechu.command.create.Create[source]¶
Bases:
Base
Create the database with the database schema.
- subparser_keywords: SubparserKeywords = {'description': 'Create database schema tables at the configured URI.', 'help': 'Create the database and schema'}¶
rechu.command.delete module¶
Subcommand to remove receipt YAML file(s) from data path and database.
- class rechu.command.delete.Delete[source]¶
Bases:
Base
Delete YAML files and database entries for receipts.
- subparser_arguments: SubparserArguments = [('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: SubparserKeywords = {'aliases': ['rm'], 'description': 'Delete YAML files for receipts from the 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.
- class rechu.command.dump.Dump[source]¶
Bases:
Base
Dump YAML files from the database.
- subparser_arguments: SubparserArguments = [('files', {'help': 'One or more product inventories or receipts to write; if no filenames are given, then the entire database is dumped', 'metavar': 'FILE', 'nargs': '*'})]¶
- subparser_keywords: SubparserKeywords = {'description': 'Create one or more YAML files for data in the database.', 'help': 'Export entities from the database'}¶
rechu.command.match module¶
Subcommand to match entities in the database.
- class rechu.command.match.Match[source]¶
Bases:
Base
Update entities with references to metadata based on matching patterns.
- subparser_arguments: SubparserArguments = [(('-u', '--update'), {'action': 'store_true', 'default': False, 'help': 'Also update existing matched product references'})]¶
- subparser_keywords: 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.
- class rechu.command.read.Read[source]¶
Bases:
Base
Read updated YAML files and import them to the database.
- subparser_keywords: 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.Base[source]¶
Bases:
Namespace
Abstract command handling.
- classmethod get_command(name: str) Base [source]¶
Create a command instance for the given subcommand name.
- 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: SubparserKeywords = {}¶