Files
visual_critical_discourse_a…/tests/total_documents_test.py
T
Brian Bjarke Jensen fd9140093d
Code Quality Pipeline / Test (push) Successful in 4m5s
CI Pipeline / Test (pull_request) Failing after 3m42s
CI Pipeline / Build and Publish (pull_request) Has been skipped
moved webui and updated poetry packages
2024-05-20 19:19:29 +02:00

25 lines
656 B
Python

from __future__ import annotations
import os
from pathlib import Path
from dotenv import load_dotenv
from shared.database import connect
from shared.database import count_documents
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()
# get visual communication
num_docs = count_documents(
collection=collection,
only_with_annotation=False,
)
print(f"total number of documents in database: {num_docs}")