mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 18:36:44 +00:00
Small adjustments for csv export
This commit is contained in:
parent
e5e38a6faf
commit
4f5f0f76be
@ -12,7 +12,7 @@ def export(outfile="out.csv"):
|
|||||||
docs = es.stream_all_docs()
|
docs = es.stream_all_docs()
|
||||||
docs_with_website = db.join_website_on_scan(docs)
|
docs_with_website = db.join_website_on_scan(docs)
|
||||||
|
|
||||||
print("Connected")
|
print("Connected, writing to csv")
|
||||||
|
|
||||||
with open(outfile + ".temp", "w") as out:
|
with open(outfile + ".temp", "w") as out:
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ def export(outfile="out.csv"):
|
|||||||
doc["_source"]["mtime"]])
|
doc["_source"]["mtime"]])
|
||||||
print("Wrote to csv, compressing with xz")
|
print("Wrote to csv, compressing with xz")
|
||||||
|
|
||||||
os.system("xz " + outfile + ".temp")
|
os.system("xz -0 " + outfile + ".temp")
|
||||||
os.system("mv " + outfile + ".temp.xz " + outfile + ".xz")
|
os.system("mv " + outfile + ".temp.xz " + outfile + ".xz")
|
||||||
print("Compressed to " + str(os.path.getsize(outfile + ".xz")) + " bytes")
|
print("Compressed to " + str(os.path.getsize(outfile + ".xz")) + " bytes")
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<div class="card-header">Downloads</div>
|
<div class="card-header">Downloads</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<p>The entire database is exported to CSV every ±30min</p>
|
<p>The entire database is exported to CSV regularly</p>
|
||||||
|
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
|
|
||||||
@ -25,7 +25,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><a href="/get_export">out.csv.xz</a></td>
|
<td><a href="/get_export">out.csv.xz</a></td>
|
||||||
<td>{{ export_file_stats.st_size |filesizeformat }}</td>
|
<td>{{ export_file_stats.st_size |filesizeformat }}</td>
|
||||||
<td>{{ export_file_stats.st_mtime|date_format }}</td>
|
<td>{{ export_file_stats.st_mtime|datetime_format }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user