Files
visual_critical_discourse_a…/tests/total_documents_test.py
T
brian ba0fc050fe
CI Pipeline / Test (pull_request) Successful in 2m23s
CI Pipeline / Build and Publish (./Dockerfile.model, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/model) (pull_request) Successful in 7m3s
CI Pipeline / Build and Publish (./Dockerfile.web_ui, ${{ vars.docker_repo_url }}/${{ gitea.repository }}/web_ui) (pull_request) Successful in 6m13s
fixed mypy types
2024-10-19 21:37:08 +00:00

24 lines
645 B
Python

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