Skip to content

mkjmckinlay/arctic-shores

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arctic Shores - Technical Task

Requirements

The task has been completed using Python 3.8 and Django 2.2.9.

##Overview

Django has been used to create a candidate class and a Score Class.

The import and sort scripts have been written in pure Python.

##Assumptions

  • Pyhon 3.8 is installed on the machine and available from the CLI as python38
  • Virtualenvwrapper is installed

##Instructions

  1. create a folder and clone the repo into it

    mkdir arctic-shores
    cd arctic-shores
    git clone git@github.com:mkjmckinlay/arctic-shores.git . 
  2. Create a Virtual Enviroment and then activate it

    mkvirtualenv -p /usr/bin/python38 venv
    . venv/bin/activate
  3. install the requirements

    pip install requirements.txt
  4. create the database and admin user

    python manage.py migrate
    python manage.py createsuperuser
  5. Start the Django Webserver

    python manage.py runserver 0.0.0.0:8000

Running the importer script

the script assumes that the csv is in the files folder and is called candidates.csv

   python importer.py

The code displays a message advising if a result has been added, If the Candidate reference is invalid(In this case Candiate is not created) and if the score is outside of the range (0.0-100.0)

Running the Sorted Script

    python sorter.py

The script imports the json file and sorted the results by score before outputting to a csv file called sorted.csv(this is created in the files folder)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published