Skip to content

Commit 82d1e09

Browse files
committed
0.0.6 - add 'get_fields()' to client
1 parent 05b2549 commit 82d1e09

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ handling returned data easier. Here are a few of the most useful ones.
4040

4141
### Response Methods
4242

43+
- **data()**
44+
45+
Returns the actual data. Equivalent to calling `.get('data')`
46+
4347
- **denest()**
4448

4549
Denests the data. I.e. changes `{'fid': {'value': 'actualValue'}}` to `{'fid': 'actualValue'}`

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = quickbase-json-api-client
3-
version = 0.0.5
3+
version = 0.0.6
44
author = Robert Carroll
55
author_email = rob@shenandoah.capital
66
description = Python wrapper for quickbase JSON API.

src/quickbase_json/client.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,25 @@ def get_tables(self, app_id: str):
108108
body = None
109109
return requests.post('https://api.quickbase.com/v1/tables', params=params, headers=headers, json=body).json()
110110

111+
"""
112+
Fields API
113+
"""
114+
115+
def get_fields(self, table_id: str, **kwargs):
116+
"""
117+
Get fields for a given table.
118+
https://developer.quickbase.com/operation/getFields
119+
:param table_id: Id of quickbase table
120+
:param kwargs: optional args
121+
:return:
122+
"""
123+
124+
headers = self.headers
125+
params = {'tableId': f'{table_id}'}
126+
return requests.get('https://api.quickbase.com/v1/tables', params=params, headers=headers).json()
127+
128+
"""
129+
Misc.
130+
"""
111131
def __str__(self):
112132
return f'Quickbase Client: {self.realm}'

0 commit comments

Comments
 (0)