Add MongoDB integration and JSON download functionality

- Created a new script `update_mongodb.py` to handle downloading JSON data from APIs and loading it into MongoDB.
- Implemented functions for downloading JSON files, loading data into MongoDB collections, and managing updates.
- Updated `update_json.py` to instantiate the `dbmongo` class for MongoDB operations.
- Enhanced logging for better tracking of the download and load processes.
This commit is contained in:
2026-02-05 09:02:37 -05:00
parent bbf92af79f
commit df89aad7e6
3 changed files with 84790 additions and 1 deletions
+1 -1
View File
@@ -10,7 +10,6 @@ import db.sql
import logs.Logger
from db.functions import settype, dbmongo
from datetime import datetime
import json_downloader
import json
response = None
@@ -108,6 +107,7 @@ def main() -> int:
config_options = settings.config.Config(ROOTDIR)
options = config_options.config_options
mongo_updater = dbmongo(options) # Create an instance of dbmongo
dbtype, apitype = options["dbtype"], options["apitype"]
dbs = settype(dbtype, apitype, options)
dbclass, dbengine, apiengine = dbs.dbclass, dbs.dbengine, dbs.apiengine