Skip to content

Commit 4df9853

Browse files
committed
doc/rf: Import Client class into root, update docs
1 parent 45e7a5b commit 4df9853

File tree

3 files changed

+27
-8
lines changed

3 files changed

+27
-8
lines changed

docs/api.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ Information on specific functions, classes, and methods.
55
.. toctree::
66

77
api/templateflow.cli
8+
api/templateflow.client
89
api/templateflow.api
910
api/templateflow.conf

templateflow/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,14 @@
4040
del PackageNotFoundError
4141

4242
from templateflow import api
43+
from templateflow.client import TemplateFlowClient
4344
from templateflow.conf import update
4445

4546
__all__ = [
4647
'__copyright__',
4748
'__packagename__',
4849
'__version__',
50+
'TemplateFlowClient',
4951
'api',
5052
'update',
5153
]

templateflow/api.py

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,30 @@
2020
#
2121
# https://www.nipreps.org/community/licensing/
2222
#
23-
"""TemplateFlow's Python Client."""
24-
25-
__all__ = [
26-
'get',
27-
'ls',
28-
'get_metadata',
29-
'get_citations',
30-
]
23+
"""TemplateFlow's Python Client.
24+
25+
``templateflow.api`` provides a global, high-level interface to query the TemplateFlow archive.
26+
27+
There are two methods to initialize a client:
28+
29+
>>> from templateflow import api as client
30+
31+
>>> from templateflow import TemplateFlowClient
32+
>>> client = TemplateFlowClient()
33+
34+
The latter method allows additional configuration for the client,
35+
while ``templateflow.api`` is only configurable through environment variables.
36+
37+
.. autofunction:: get
38+
39+
.. autofunction:: ls
40+
41+
.. autofunction:: templates
42+
43+
.. autofunction:: get_metadata
44+
45+
.. autofunction:: get_citations
46+
"""
3147

3248
from .client import TemplateFlowClient
3349
from .conf import _cache

0 commit comments

Comments
 (0)