pre-commit renamed files to PEP standard and removed unused imports
pipeline / Test (push) Failing after 51s

This commit is contained in:
Brian Bjarke Jensen
2024-02-25 14:26:54 +01:00
parent ea28f23304
commit ce063822b5
12 changed files with 230 additions and 215 deletions
+29
View File
@@ -0,0 +1,29 @@
from __future__ import annotations
import os
from pathlib import Path
from database import connect
from database import VisualCommunication
from dotenv import load_dotenv
if __name__ == '__main__':
# prepare env vars
env_path = Path(__file__).parent.parent / 'local.env'
assert env_path.exists()
load_dotenv(env_path)
os.environ['MONGO_HOST'] = 'localhost'
# connect to database
collection, db, client = connect()
print(client.server_info())
# download images
data = None
for data in collection.find().limit(3):
if data is None:
print('no document found')
break
vis_com: VisualCommunication = VisualCommunication.model_validate(data)
print(repr(vis_com))
if data is not None:
print(vis_com.image)
print(vis_com.model_dump())