From b8782fe0782cacf3352b85acd0429dab3394894c Mon Sep 17 00:00:00 2001 From: Alex Levy Date: Fri, 18 Aug 2023 09:44:45 -0700 Subject: [PATCH] Fix docs typos; resolves #297 --- pyairtable/api/api.py | 3 ++- pyairtable/api/table.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pyairtable/api/api.py b/pyairtable/api/api.py index f2ae4c0e..7f4f5dc0 100644 --- a/pyairtable/api/api.py +++ b/pyairtable/api/api.py @@ -24,7 +24,8 @@ class Api: Usage: >>> api = Api('auth_token') - >>> api.all('base_id', 'table_name') + >>> table = api.table('base_id', 'table_name') + >>> records = table.all() """ VERSION = "v0" diff --git a/pyairtable/api/table.py b/pyairtable/api/table.py index 386b71e4..56df9955 100644 --- a/pyairtable/api/table.py +++ b/pyairtable/api/table.py @@ -185,9 +185,10 @@ def all(self, **options: Any) -> List[RecordDict]: """ Retrieves all matching records in a single list. - >>> api.all('base_id', 'table_name', view='MyView', fields=['ColA', '-ColB']) + >>> table = api.table('base_id', 'table_name') + >>> table.all(view='MyView', fields=['ColA', '-ColB']) [{'fields': ...}, ...] - >>> api.all('base_id', 'table_name', max_records=50) + >>> table.all(max_records=50) [{'fields': ...}, ...] Keyword Args: @@ -238,7 +239,8 @@ def create( Creates a new record >>> record = {'Name': 'John'} - >>> api.create('base_id', 'table_name', record) + >>> table = api.table('base_id', 'table_name') + >>> table.create(record) Args: fields: Fields to insert. Must be a dict with field names or IDs as keys.