diff --git a/README.md b/README.md index bb692be..6a11226 100644 --- a/README.md +++ b/README.md @@ -87,9 +87,11 @@ with Client() as client: print(client.projects.list()) ``` +Learn more [in the documentation](https://getodk.github.io/pyodk/). + ### Examples -**👉 See detailed tutorials in the Examples library in the pyODK documentation.** +**👉 See detailed tutorials in [the documentation](https://getodk.github.io/pyodk/examples/).** ```python from pyodk.client import Client @@ -108,17 +110,6 @@ client.forms.update( client.close() ``` -### Raw HTTP requests -For interacting with parts of the ODK Central API ([docs](https://odkcentral.docs.apiary.io)) that have not been implemented in `pyodk`, use HTTP verb methods exposed on the `Client`: - -``` -client.get("projects/8") -client.post("projects/7/app-users", json={"displayName": "Lab Tech"}) -``` -You can find a more detailed tutorial in the Examples library in the pyODK documentation. - -These methods provide convenient access to `Client.session`, which is a `requests.Session` object subclass. The `Session` has customised to prefix request URLs with the `base_url` from the pyodk config. For example with a base_url `https://www.example.com`, a call to `client.session.get("projects/8")` gets the details of `project_id=8`, using the full url `https://www.example.com/v1/projects/8`. - ### Session customization If Session behaviour needs to be customised, for example to set alternative timeouts or retry strategies, etc., then subclass the `pyodk.session.Session` and provide an instance to the `Client` constructor, e.g. `Client(session=my_session)`. diff --git a/mkdocs.yml b/mkdocs.yml index ae79d07..223f348 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,5 +1,5 @@ site_name: pyODK -edit_uri: https://github.com/getodk/pyodk/docs +edit_uri: https://github.com/getodk/pyodk/tree/master/docs repo_url: https://github.com/getodk/pyodk repo_name: getodk/pyodk docs_dir: docs diff --git a/pyodk/_endpoints/projects.py b/pyodk/_endpoints/projects.py index 8c63436..901de2d 100644 --- a/pyodk/_endpoints/projects.py +++ b/pyodk/_endpoints/projects.py @@ -44,7 +44,7 @@ class ProjectService(bases.Service): from pyodk.client import Client client = Client() - forms = client.projects.list() + projects = client.projects.list() ``` """ diff --git a/pyodk/_endpoints/submissions.py b/pyodk/_endpoints/submissions.py index 8e62351..41ff07e 100644 --- a/pyodk/_endpoints/submissions.py +++ b/pyodk/_endpoints/submissions.py @@ -44,7 +44,7 @@ class SubmissionService(bases.Service): from pyodk.client import Client client = Client() - data = client.forms.get_table()["value"] + data = client.submissions.get_table(form_id="my-form")["value"] ``` """