Skip to content
Jupiter documentation
Menu

Add a marketplace

Write a lane for a new source and register it, so that search_offers and health pick it up.

A Lane is two functions and one registry entry. The orchestrator in procurement/lanes/base.py handles the deadline, the missing key and the diagnostics.

Steps#

  1. Create procurement/lanes/example.py with a parser. The parser maps the source's items to Offer objects and makes no HTTP call, so a test can feed it a recorded reply.

  2. Add the search function. Raise LaneError with a diagnostic code for every failure you can name.

  3. Register the lane in _SPECS of procurement/lanes/__init__.py.

  4. If the lane needs a key, add the setting to procurement/config.py and to .env.example. Pass a missing function that returns the variable's name when it is unset. tests/test_env_docs.py fails when the two files disagree.
  5. If the source does not state delivery for each offer, add a rule for the marketplace to _RULES in procurement/landed.py. Without a rule the offers get delivery: unknown.
  6. Add a parser test to tests/test_lanes.py, then run the checks.

LaneSpec fields#

SearchCtx fields#

Apify actor lanes#

Call apify_run_sync(actor, run_input, timeout_s=ctx.wait_s(85)) from procurement/http.py. It sends the request once, because each call starts a paid run. It raises LaneError with missing_key, upstream_error or quota.

Set the lane to verified only after scripts/live_smoke.py returned offers for it.

Source: belikh/procurement HEAD