Added raw query results to json
This commit is contained in:
parent
f62e6a58df
commit
a54c800051
BIN
dist/drstats-1.3.37-py3-none-any.whl
vendored
BIN
dist/drstats-1.3.37-py3-none-any.whl
vendored
Binary file not shown.
BIN
dist/drstats-1.3.37.tar.gz
vendored
BIN
dist/drstats-1.3.37.tar.gz
vendored
Binary file not shown.
BIN
drstats.db
BIN
drstats.db
Binary file not shown.
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
Binary file not shown.
@ -8,8 +8,9 @@ printr = functools.partial(print, file=sys.stderr)
|
||||
|
||||
|
||||
def dump():
|
||||
global db
|
||||
statistics_text = [
|
||||
f"===devRant(developer community) haves {db.get_user_count()} active users(ranters)."
|
||||
f"===devRant(developer community) has {db.get_user_count()} active users(ranters)."
|
||||
f"===All users(ranters) of devRant together did contribute {db.get_contribution_count()} times in total."
|
||||
f"===The average user(ranter) of devrant(developer community) contributed {db.get_contribution_average_per_user()} times on devrant(developer community)."
|
||||
]
|
||||
@ -71,6 +72,7 @@ def dump():
|
||||
print("```")
|
||||
|
||||
for view in db.get_views():
|
||||
print(f"export/view-f{view['name']}.json")
|
||||
with pathlib.Path(f"export/view-f{view['name']}.json").open("w+") as f:
|
||||
json.dump(view, db.query(view['sql']))
|
||||
printr(f"export/view-{view['name']}.json")
|
||||
with pathlib.Path(f"export/view-{view['name']}.json").open("w+") as f:
|
||||
with db.Db() as _db:
|
||||
json.dump([dict(record) for record in _db.query("SELECT * FROM {}".format(view['name']))],f)
|
Loading…
Reference in New Issue
Block a user