Skip to content

Commit 2fa4f56

Browse files
Update docstring
1 parent 31bfbd0 commit 2fa4f56

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

aiida_restapi/routers/nodes.py

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

121139
from aiida.manage import get_manager
122140

0 commit comments

Comments
 (0)