JSON schemas

Products with additional mapping fields and metadata

https://lhelwerd.github.io/rechu/schema/products.json

group_products

group_products

type

object

properties

  • shop

Identifier of the shop where the matching products are bought.

type

string

  • category

Category for the matching products.

type

string

  • type

Type of the matching products.

type

string

  • products

products

products

type

array

items

product

product

type

object

properties

  • labels

Labels from receipts to match for the product.

type

array

items

type

string

  • prices

Prices from receipts to match for the product. Items that would otherwise match but have different prices or prices outside the price range or out of the year are not matched to the product as a differentiation strategy.

oneOf

type

array

items

Specific price (without discount) from receipts to match.

price

type

object

properties

  • minimum

Lower inclusive bound of the price range to match.

price

  • maximum

Upper inclusive bound of the price range to match.

price

type

object

patternProperties

  • ^\d\d\d\d$

Specific prices (without discounts from receipts of the given year to match.

type

array

items

price

  • bonuses

Labels of discount actions from receipts to match for the product. Items that would otherwise match but are not involved in a discount with a label are not matched to the product as a differentiation strategy.

type

array

items

type

string

  • category

Category for the product.

type

string

  • brand

Brand of the product.

type

string

  • description

Disambiguating description of the product.

type

string

  • type

Type of the product.

type

string

  • portions

Number of times the product would typically be used by taking a separable amount from the package. Usually the number of items in the package.

type

integer

minimum

1

  • weight

The weight of the item expressed as a number and a unit of mass.

type

string

  • volume

The liquid content of the item expressed as a number and a unit of (fluid) space.

type

string

  • alcohol

The alcohol content of the item, expressed as a percentage or another unit.

type

string

  • sku

The Stock Keeping Unit, i.e., a merchant-specific identifier for the product.

type

string

  • gtin

The Global Trace Item Number of the product, expressed in 14 digits. This is the EAN-13 barcode with a preceding zero.

type

integer

maximum

99999999999999

minimum

1000000000000

price

type

number

multipleOf

0.01

minimum

0.0

Receipt information

https://lhelwerd.github.io/rechu/schema/receipt.json

receipt

receipt

type

object

properties

  • date

The date of the receipt.

type

string

format

date

  • shop

Identifier of the shop where the receipt was obtained and the products were bought.

type

string

  • products

type

array

items

type

array

items

False

maxItems

4

minItems

3

  • bonus

type

array

items

type

array

items

Label of a product involved in the discount action. The same product label can be in the same discount action multiple times, but only if it is also in the receipt’s products multiple times. The products should have an indicator of discount in the receipt’s products.

type

string

Receipt cataloging hub settings

https://lhelwerd.github.io/rechu/schema/settings.json

settings

settings

type

object

properties

  • data

data

  • database

database

patternProperties

  • ^.+$

type

object

patternProperties

  • ^.+$

type

string

data

Filesystem data IO settings.

type

object

properties

  • path

Relative or absolute path to the YAML data directory.

type

string

default

.

  • pattern

Subdirectory glob pattern to detect additional paths within the data path where receipt files are stored.

type

string

default

.

  • format

Path format for YAML receipt files generated with rechu new. This may have curly braces with date and shop variables with format specifiers as shown in <https://docs.python.org/3/library/string.html#formatstrings>.

type

string

default

{date:%Y}-{date:%m}-{date:%d}-{date:%H}-{date:%M}-{shop}.yml

  • products

Path format for YAML product matching files, also to find them. This may have curly braces with shop variable with format specifiers as shown in <https://docs.python.org/3/library/string.html#formatstrings>.

type

string

default

products-{shop}.yml

  • editor

Path to an executable plus space-separated arguments, which when combined with a final filename argument can be called to edit that file. If the executable is not found in the PATH, then fallbacks from VISUAL and EDITOR environment variables and a fixed list of editors is attempted.

type

string

default

vim

database

Database connection settings.

type

object

properties

  • uri

The SQLAlchemy connection URI to connect to the database.

type

string

default

sqlite+pysqlite:///example.db

format

uri

  • foreign_keys

Whether to use foreign keys on SQLite. Current versions of the models require this to correctly delete dependent entities, but it could be disabled when using older models where this support was not properly usable (and some models would break with foreign keys enabled). To disable, set to “OFF”.

type

string

enum

ON, OFF, on, off

default

ON