Poetry Installation poetry-installation
Creates a new virtual env for the repo
poetry shell
Install Dependencies
poetry install --no-root
Install test dependencies
poetry install --with test
lock poetry file(development only)
poetry lock --no-update
pip install -r requirements.txt
pre-commit run --all-files
To start the api using the below command from root dir
uvicorn app.main:app --reload
http://127.0.0.1:8000/wiki/word_analysis?topic=Artificial intelligence&n=10
{
"data": {
"topic": "Artificial intelligence",
"word_count": 10,
"frequent_words": {
"AI": 161,
"intelligence": 59,
"learning": 52,
"used": 44,
"artificial": 35,
"machine": 35,
"human": 33,
"use": 30,
"problems": 29,
"research": 28
}
},
"request_at": "2024-02-08 13:19:03.749992",
"status": "successful"
}
http://127.0.0.1:8000/wiki/search_history
[
{
"data" : {
"topic": "2022",
"word_count": 10,
"frequent_words": {
"Russian": 47,
"Ukraine": 41,
"invasion": 29,
"election": 27,
"September": 25,
"held": 24,
"Russia": 23,
"Prime": 22,
"Minister": 22,
"United": 22
}
},
"requested_at": "2024-02-08 01:45:28.073141",
"status": "successful"
},
{
"topic": "123123",
"requested_at": "2024-02-08 02:02:04.407498",
"status": "unsuccessful",
"message": "No Wikipedia article found for '123123'"
}
]
http://127.0.0.1:8000/docs
pytest .