A CLI based program in Python along with a Django application, for selecting agents for incoming issues based on different factors.
Explore the docs »
Table of Contents
You are given the following data for agents
- is_available
- available_since (the time since the agent is available)
- roles (a list of roles the user has, e.g. spanish speaker, sales, support etc.)
When an issue comes in we need to present the issue to 1 or many agents based on an agent selection mode. An agent selection mode can be all available, least busy or random.
- In all available mode the issue is presented to all agents so they pick the issue if they want.
- In least busy the issue is presented to the agent that has been available for the longest.
- In random mode we randomly pick an agent. An issue also has one or many roles (sales/support e.g.).
Issues are presented to agents only with matching roles.
Implement a function that takes an input the list of agents with their data, agent selection mode and returns a list of agents the issue should be presented to.
CLI Program: Implemented python code for a CLI based interaction for the problem. Used pickle to simulate as a simple database for storing Agents and their respective details.
Django Web App: Created a simple Django Web App to render a web UI for the problem.
To setup the project locally, follow the given steps:
Following software needs to be setup in the system
- git
- python
- pip
- python virtual environment (optional)
- github-cli (optional)
- Clone the repo by
or (if github-cli is installed)
git clone https://github.com/SubhradeepSS/py-Agent-Query.git
gh repo clone SubhradeepSS/py-Agent-Query
- Open the project in any source code editor.
- Navigate to the cli directory and start the cli program by running in terminal the following command:
python main.py
- Navigate to the web directory.
- Activate python virtual environment (see here for reference)
- Inside the virtual environment, run
pip install -r requirements.txt python manage.py makemigrations python manage.py migrate python manage.py createsuperuser # this will ask for username, email(optional) and password. Enter some credentials to be used later for django admin functionality.
The CLI Program will start once the main.py
script is activated and will start interacting with the user.
For running the project, navigate to the web directory and follow the given instructions:
-
Type the following in the command line(inside the virtual environment) to run the web-app server:
python manage.py runserver
-
Log on to django admin site using the superuser credentials and create some roles after opening the Roles section.
-
Finally, open the http://127.0.0.1:8000/ link and the home page of the web-app will load.
Any contributions made to the project are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request