mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-23 14:55:48 +03:00
d43c579d78
The crunch library and generator are tools to export group graph data to a CSV-format file. The purpose of crunch is to help quantify the growth of the Urbit network. The code added here is work done under the grant https://urbit.org/grants/bounties/analytics-script/
28 lines
809 B
Plaintext
28 lines
809 B
Plaintext
/- ms=metadata-store
|
|
/+ crunch
|
|
:- %say
|
|
|= [[now=@da * bec=beak] [csv-path=path from=@da ~] [to=@da groups=(list path) content=(unit ?) ~]]
|
|
=/ our=@p p.bec
|
|
:: get all graph associations ship is a part of
|
|
::
|
|
=/ associations=associations:ms
|
|
(~(scry-graph-associations crunch [our now]))
|
|
:: filter by input groups, if any (default: all from scry)
|
|
::
|
|
=/ filtered-associations=associations:ms
|
|
?~ groups
|
|
associations
|
|
%+ filter-associations-by-group-resources.crunch
|
|
associations
|
|
(paths-to-resources.crunch groups)
|
|
:: walk graphs to extract content
|
|
::
|
|
=/ file-content=wain
|
|
%: ~(walk-graph-associations crunch [our now])
|
|
filtered-associations
|
|
?~ content %.n u.content
|
|
from
|
|
?: =(*@da to) now to
|
|
==
|
|
[%helm-pass (note-write-csv-to-clay.crunch csv-path file-content)]
|