bookstack #1

Merged
dcronin05 merged 8 commits from bookstack into master 2024-10-05 03:15:11 -07:00
Showing only changes of commit 1afd622196 - Show all commits

View File

@ -1,9 +1,29 @@
import pymongo import pymongo
import os import os
import json import ijson
import sys import sys
import bookstack import bookstack
# import paperless database export
# manifest_path = "/mnt/user/media/paperless/media/manifest.json"
f = open("/mnt/tower/media/paperless/media/backup/manifest.json")
manifest = ijson.items(f, 'item')
paperless_docs = {}
for doc in manifest:
fields = doc['fields']
if 'title' in fields and 'content' in fields:
pk = doc['pk']
title = fields['title']
content = fields['content']
check = fields['checksum']
paperless_docs[pk] = {'checksum': check, 'title': title, 'content': content}
db = pymongo.MongoClient("10.0.0.59", 27017).paperless.content db = pymongo.MongoClient("10.0.0.59", 27017).paperless.content