Skip to content

Commit 701b22c

Browse files
Update docstring
1 parent 612b8b2 commit 701b22c

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

aiida_restapi/routers/nodes.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,25 @@ class NodeStatistics(pdt.BaseModel):
115115
@read_router.get('/nodes/statistics', response_model=NodeStatistics)
116116
@with_dbenv()
117117
async def get_nodes_statistics(user: int | None = None) -> dict[str, t.Any]:
118-
"""Get node statistics."""
118+
"""Get node statistics.
119+
120+
:param user: Optional user PK to filter statistics by user.
121+
:return: A dictionary containing total node count, counts by node type, and creation time statistics.
122+
123+
>>> {
124+
>>> "total": 47,
125+
>>> "types": {
126+
>>> "data.core.int.Int.": 42,
127+
>>> "data.core.singlefile.SinglefileData.": 5,
128+
>>> ...
129+
>>> },
130+
>>> "ctime_by_day": {
131+
>>> "2012-01-01": 10,
132+
>>> "2012-01-02": 15,
133+
>>> ...
134+
>>> },
135+
>>> }
136+
"""
119137

120138
from aiida.manage import get_manager
121139

0 commit comments

Comments
 (0)