Python client for the Modelshop REST API
Project description
py-modelshop
Python client for the Modelshop REST API. Load datalists as pandas DataFrames, discover models, and inspect schemas.
Install
pip install py-modelshop
Quick Start
from py_modelshop import Modelshop
ms = Modelshop(
domain='https://demo.modelshop.com',
model_owner='demo',
model='My Model',
user='demo',
password='demo'
)
# Discover available data
print(ms.list_datalists())
print(ms.list_views())
# Load a datalist as a pandas DataFrame
df = ms.datalist('Loan')
print(df.describe())
# Inspect field schema
print(ms.schema('Loan'))
Authentication
Basic Auth — provide user and password:
ms = Modelshop('https://demo.modelshop.com', 'demo',
model='My Model', user='demo', password='demo')
Access Token — provide a pre-authorized token (no credentials needed):
ms = Modelshop('https://demo.modelshop.com', 'demo',
model='My Model', access_token='a1b2c3d4-...')
If neither is provided, you'll be prompted for credentials interactively.
API Reference
Discovery
| Method | Returns | Description |
|---|---|---|
ms.list_datalists() |
list[str] |
Names of all datalists in the model |
ms.list_views(datalist=None) |
list[str] |
Names of all views, optionally filtered by datalist |
ms.schema(name) |
dict |
Field names and types for a datalist or view |
Data Access
| Method | Returns | Description |
|---|---|---|
ms.datalist(name, limit=None, filters=None) |
DataFrame |
Load a datalist as a pandas DataFrame |
ms.get(model, view, output='dict') |
varies | Legacy method — retrieve records as dict, DataFrame, or JSON |
ms.put(model, view, payload) |
dict |
Update records in a view |
Loading Data
# Full datalist
df = ms.datalist('Loan')
# Limited rows
df = ms.datalist('Loan', limit=1000)
# Filtered
df = ms.datalist('Loan', filters=[
{'fieldName': 'Status', 'operator': '=', 'value': 'Active'}
])
Column names use natural field names (e.g., df['Loan Amount'], not df['loanAmount']).
Requirements
- Python 3.8+
- requests
- pandas
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file py_modelshop-1.0.1.tar.gz.
File metadata
- Download URL: py_modelshop-1.0.1.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
01e12f7502d746b50a8dffa6893b29506f61c3254f0d85aa1170186c33d8a24e
|
|
| MD5 |
77b7471b50fdc2712a7a1ead8afe7e6d
|
|
| BLAKE2b-256 |
fb189dfca00a23f0ba41b15f4fbef015c5a54143e39f9d66b3372846fcd707fb
|
File details
Details for the file py_modelshop-1.0.1-py3-none-any.whl.
File metadata
- Download URL: py_modelshop-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b2e3504e978a2de404ae9e7ab8fb523cae7f1ef7a64c3fca13d0c1cda484e29
|
|
| MD5 |
c5f43e7eaa5d1dd154c48190b7e07f18
|
|
| BLAKE2b-256 |
d83c4b6d9fd461035d0f282d3d1a90e96521a408ca2a9e0f33876aeb74284091
|