Skip to main content

GetMeadow

A Python client for the Meadow API, built on httpx and pydantic.

Meadow's public Open API covers many admin-portal actions, but not all of them. This client supports both:

  • API key auth (api_key and client_key) for the public API
  • Username and password for login/admin features that are not in the public API

Installation

pip install getmeadow

Authentication

import os
from getmeadow import MeadowClient

# Public API — each client key is tied to a single organization
client = MeadowClient(
    api_key=os.getenv("MEADOW_API_CONSUMER_KEY"),
    client_key=os.getenv("MEADOW_API_CLIENT_KEY"),
)

# Login / admin portal features
client = MeadowClient(
    username=os.getenv("MEADOW_USERNAME"),
    password=os.getenv("MEADOW_PASSWORD"),
    organization="Optional Org Name",  # optional; switches to this org after login
)

Calling a login-only method while using API keys raises UnsupportedAPIFeatureException.

Response format

Most client methods return a two-item tuple of the HTTP status code and the response data:

status_code, data = client.get_orders()

A few helpers, such as get_inventory(), return only the data.

Organizations

In login mode, organization handling works like the Meadow web app. Requests use the client's current organization ID, and client.change_org_by_name("Org Name") switches the active organization. Available organizations are on client.roles["organizations"].

API keys are issued for a single organization, so org switching is not available in API key mode. Use a separate client key for each org.

Most methods, such as get_orders(), operate on the currently selected organization.

Example: create an order (login mode)

import os
from getmeadow import MeadowClient

client = MeadowClient(
    username=os.getenv("MEADOW_USERNAME"),
    password=os.getenv("MEADOW_PASSWORD"),
)

order = {
    "type": "in-store",
    "status": "draft",
    "lineItems": [{
        "productId": 12345,
        "productOptionId": 678910,
        "quantity": 1,
    }],
    "payments": [{
        "paymentTypeId": 54321,
        "remaining": True,
    }],
    "patientHash": "9mLifw",
}
status_code, result = client.create_order(order)

In API key mode, create_order has no status field. Whether the order is created as a draft or as new depends on the organization's settings.

Login-only features

These actions require username and password auth. They are not supported with API keys:

Orders

  • Cancel an order
  • Change an order's status
  • Check whether an address is in a delivery zone
  • Get a customer's recent addresses

Customers

  • Create, delete, or search customers
  • List the members of a customer group (the API can add or remove a customer, but cannot list members)
  • Read or delete customer documents (the API can only upload)

Products & inventory

  • Delete a product
  • Create a product category
  • Brands (list and create)
  • Vendors (list, read one, or create)
  • Inventory transaction history
  • Inventory reconciliations
  • Discounts

Purchase orders

  • Read a single purchase order (the API can only list them)
  • Receive line items
  • Change a PO's status
  • PO payments (read and create)

Compliance (Metrc)

  • Read a single compliance transfer (the API can only list them)
  • Trigger a Metrc sync

Reporting

  • Sales, product, and customer insights
  • Reports (list and download)

Account & org

  • Full org config (payment types are available in the public API via get_payment_types())
  • Current user, roles, and permissions data
  • Switching organizations

Metadata

Release files for getmeadow 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for getmeadow 1.1.0
File Size Uploaded Provenance Actions
getmeadow-1.1.0.tar.gz 12.5 kB Without provenance Details for getmeadow-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for getmeadow 1.1.0
File Interpreter ABI Platform Actions
getmeadow-1.1.0-py3-none-any.whl Python 3 none any Details for getmeadow-1.1.0-py3-none-any.whl

Total release size: 26.9 kB

Release files / getmeadow-1.1.0.tar.gz

Download URL getmeadow-1.1.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
33bc4fff400e979653641ad0261080d113a9a72f61b1f9b91d6c85288938b937
BLAKE2b-256 checksum
How to use checksums
2659a621e7f1a21307e07b5e2c6757ffcf5fe7ab5f5540030802381511419fd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / getmeadow-1.1.0-py3-none-any.whl

Download URL getmeadow-1.1.0-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f7af28f60c6a9bd513e140f23cd3ffc39442a03db1e8018fc064e361892def5
BLAKE2b-256 checksum
How to use checksums
489b2d83ec00ce4db80b41f217dd0c4cb04f2114ca90225b034aadcfd3bbe1df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for getmeadow 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page