Skip to main content

Official MNRQ (Menuraq) Python SDK

Project description

MNRQ Python SDK (mnrq-sdk)

Official Python SDK for the Menuraq Developer API.

Version

1.1.1

Install

pip install mnrq-sdk

Quick Start

from mnrq_sdk import MnrqClient

client = MnrqClient(
    api_key="<YOUR_API_KEY>",
    base_url="https://menuraq.com",
)

business = client.get_business()
print(business["data"]["business"]["name"])

Client Configuration

client = MnrqClient(
    api_key="mnrq_live_xxx",
    base_url="https://menuraq.com",
    timeout=20.0,  # optional
)
  • api_key required
  • base_url required
  • timeout optional (seconds, default 20.0)

Auth headers sent automatically:

  • Authorization: Bearer <api_key>
  • x-api-key: <api_key>

API Coverage

System

  • get_api_info() -> GET /api/v1

Business and Branches

  • get_business() -> GET /api/v1/business
  • get_branches(include_inactive=False) -> GET /api/v1/branches

Menus

  • get_menus(limit=20, offset=0, status=None, include_items=False) -> GET /api/v1/menus
  • get_menu(menu_id, include_analytics=False) -> GET /api/v1/menus/:menuId
  • get_menu_items(menu_id=None, category_id=None, available=None, limit=50, offset=0) -> GET /api/v1/menu-items

Analytics

  • get_analytics(menu_id=None, date_from=None, date_to=None, include_daily=True) -> GET /api/v1/analytics

Promotions

  • get_promotions(menu_id=None, active_only=True, limit=25, offset=0) -> GET /api/v1/promotions
  • get_promotion(promotion_id) -> GET /api/v1/promotions/:promotionId

Templates

  • get_template_render(menu_id=None, menu_slug=None, mode='iframe', hide_header=None) -> GET /api/v1/templates/render
  • get_template_iframe(menu_id=None, menu_slug=None, hide_header=None) convenience wrapper
  • get_template_html(menu_id=None, menu_slug=None, hide_header=None) convenience wrapper

hide_header=True makes the returned public/iframe URL use embed mode so /m/[slug] header is hidden.

Menu Item Writes

  • update_menu_item(item_id, patch) -> PATCH /api/v1/menu-items/:itemId

Examples

Read menus

menus = client.get_menus(limit=20, status="live")
print(menus["data"])

Get template iframe response

render = client.get_template_iframe(menu_slug="main-menu", hide_header=True)
print(render["data"]["public_url"])
print(render["data"]["embed_code"])

Update a menu item

client.update_menu_item(
    "item_uuid_here",
    {
        "title": "Spicy Chicken Deluxe",
        "price": 18.5,
        "available": True,
    },
)

Error Handling

The SDK raises MnrqApiError for non-2xx or ok: false responses.

from mnrq_sdk import MnrqApiError

try:
    client.get_business()
except MnrqApiError as error:
    print(error.status_code, error.code, error.request_id, error.details)

Backward Compatibility

Legacy aliases are preserved:

  • MenuraqClient alias for MnrqClient
  • MenuraqApiError alias for MnrqApiError

Test

cd sdk/python
python -m unittest discover -s tests -p "*_test.py" -v

The suite validates constructor behavior, every SDK method mapping, payload/params, and error translation.

Build and Publish

cd sdk/python
python -m pip install --upgrade build twine
python -m build
twine upload dist/*

Package name on PyPI is mnrq-sdk, import module name is mnrq_sdk.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mnrq_sdk-1.1.1.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mnrq_sdk-1.1.1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file mnrq_sdk-1.1.1.tar.gz.

File metadata

  • Download URL: mnrq_sdk-1.1.1.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mnrq_sdk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5bc05fe3672062fed5c023829c66435b04aab35592143b1390136bc4e4cda03b
MD5 df0d9233370971eba40f13df177e4b19
BLAKE2b-256 6829ee4ed4be6ff5403cbc5a48a4ab8ea3031a3eabbe2a78fb48b89332a14fb6

See more details on using hashes here.

File details

Details for the file mnrq_sdk-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: mnrq_sdk-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mnrq_sdk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1bc7ef1a98cbb229d635e886fb365436229dd73f9ead3eabca247bb4e9b44b1d
MD5 b642ffcd2d0b51d84f605c07def460dd
BLAKE2b-256 65acd93c641fdea8ab890c7da892b817777defc38a27192b6bad1bba6c29ad96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page