Hey there! Welcome to Knowledge Lens Intern Training Program.
This Assignment will serve as a quick refresher on the usage of NoSQL and Time-series databases.
There are three tasks in this assignment, on completion of which you'll learn:
* How to interact with Mongo DB
* Using Pandas Dataframe and generating your own excel reports
* Leveraging Kairos Time-series database for data ingestion and querying the same
* Publishing and Consuming messages via MQTT protocol
* Caching mechanism using Redis DB
Happy Coding! :tada:
## :pushpin: Task 1: Working with Mongo - Advanced
### :golf: Areas covered:
- Timeseries Operation
- Working with NoSQL
- Working with Pandas
### :books: Description:
You are given with a dataset of an inspection company in the form of a JSON file. The end goal of the project is to create an API interface that will provide the following:
1. Business name with maximum number of "`Violation Issued`".
2. Business name that has no violation.
3. Generate Excel Report based on `result`, `business name` and `date`
Sample Document:
```json
{
"id":"10021-2015-ENFO",
"certificate_number":9278806,
"business_name":"ATLIXCO DELI GROCERY INC.",
"date":"Feb 20 2015",
"result":"No Violation Issued",
"sector":"Cigarette Retail Dealer - 127",
"address":{
"city":"RIDGEWOOD",
"zip":11385,
"street":"MENAHAN ST",
"number":1712
}
}
```
Bonus Points: Use Mongo Aggregate framework
### :wrench: Tools to use:
1. Pycharm / VSCode
2. Robo3T / Studio3T / MongoDB Compass
3. PyMongo
### :mag: References:
*[Querying Documents on Mongo](https://www.mongodb.com/docs/manual/tutorial/query-documents/)
*[Quick Summary on Mongo Aggregation Stages](https://www.mongodb.com/docs/manual/reference/operator/aggregation-pipeline/)
*[Generating Excel Sheets from a Pandas Dataframe](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.to_excel.html)
*[How to return files on FastAPI response](https://fastapi.tiangolo.com/advanced/custom-response/#fileresponse)
*[PyMongo Official Documentation](https://pymongo.readthedocs.io/en/stable/)
_________________________________
## :pushpin: Task 2: Working with Timeseries
### :golf: Areas covered:
- Timeseries Operation
- Working with Timeseries
- Working with Pandas
### :books: Description:
You are given with a dataset of weather in the form of a CSV file. The end goal of the project is to create an API interface that will provide the following:
1. Get daily, monthly, weekly and monthly aggregate (min, max, and average) of the data and generate report in Excel format.