mrc-data
Official Python SDK for MRC Data -- China's apparel supply chain API.
Access 1,000+ verified suppliers, 350+ fabric specifications, and 170+ industrial clusters across China, each enriched with independent lab measurements (AATCC, ISO, GB).
Installation
pip install mrc-data
Quick start
from mrc_data import MRCData
client = MRCData(api_key="your-api-key")
# Search suppliers in Guangzhou
suppliers = client.search_suppliers(city="Guangzhou", certification="BSCI")
# Get supplier details
detail = client.get_supplier_detail("sup_abc123")
# Search fabrics by composition
fabrics = client.search_fabrics(composition="cotton", weight_min=150)
# Compare industrial clusters
comparison = client.compare_clusters(ids=["cls_humen", "cls_shaoxing"])
# Detect specification discrepancies
result = client.detect_discrepancy(supplier_id="sup_abc123", fabric_id="fab_xyz")
# Database statistics
stats = client.get_stats()
Async usage
import asyncio
from mrc_data import AsyncMRCData
async def main():
async with AsyncMRCData(api_key="your-api-key") as client:
suppliers = await client.search_suppliers(province="Guangdong")
fabrics = await client.search_fabrics(weave="twill")
print(suppliers)
asyncio.run(main())
API methods
| Method | Endpoint | Description |
|---|---|---|
search_suppliers(**kwargs) |
GET /v1/suppliers |
Search suppliers with filters |
get_supplier_detail(id) |
GET /v1/suppliers/{id} |
Get a single supplier |
get_supplier_fabrics(id) |
GET /v1/suppliers/{id}/fabrics |
List fabrics by supplier |
search_fabrics(**kwargs) |
GET /v1/fabrics |
Search fabrics with filters |
get_fabric_detail(id) |
GET /v1/fabrics/{id} |
Get a single fabric |
get_fabric_suppliers(id) |
GET /v1/fabrics/{id}/suppliers |
List suppliers for a fabric |
search_clusters(**kwargs) |
GET /v1/clusters |
Search industrial clusters |
compare_clusters(ids) |
POST /v1/clusters/compare |
Compare clusters side by side |
get_stats() |
GET /v1/stats |
Aggregate database statistics |
detect_discrepancy(**kwargs) |
POST /v1/discrepancy |
Detect spec discrepancies |
Error handling
from mrc_data import MRCData, AuthenticationError, NotFoundError, RateLimitError
client = MRCData(api_key="your-api-key")
try:
detail = client.get_supplier_detail("sup_invalid")
except AuthenticationError:
print("Check your API key")
except NotFoundError:
print("Supplier not found")
except RateLimitError:
print("Slow down -- rate limit exceeded")
Configuration
client = MRCData(
api_key="your-api-key",
base_url="https://api.meacheal.ai", # default
timeout=60.0, # seconds, default 30
)
Both MRCData and AsyncMRCData support context managers for automatic cleanup of the underlying HTTP connection pool.
License
MIT
Metadata
Release files for mrc-data 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mrc_data-0.1.0.tar.gz | 5.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mrc_data-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 13.5 kB
Release files / mrc_data-0.1.0.tar.gz
| Download URL | mrc_data-0.1.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e52c0a1a574979929adfc4c0000258c3a61ca54eeced01885e75df14153d3b19
|
|
BLAKE2b-256 checksum How to use checksums |
807e87fa88f68855215b23b06eae7f9f31944fd62cc28ba4faab930bb40e8f6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / mrc_data-0.1.0-py3-none-any.whl
| Download URL | mrc_data-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9dad0a3c6b584073d025e67b855bce45ca1a7d13dd48482a83e57477bc52c98e
|
|
BLAKE2b-256 checksum How to use checksums |
28b89dc43dcd99a257733e20abab3ce3ba041aaa081fc7639d1d448f068ea959
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Security for mrc-data 0.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.