Giter Club home page Giter Club logo

kickup's Introduction

kickup

Kickup: Template for Quick Projects (Machine Coding Interviews)

About

This repo serves as a great starting point for fast prototype projects.

  • Specially useful in Machine Coding interviews, when time is limited (~1 hour) and you can't afford to waste time on boiler plate code.
  • Implementation of Data Access Layer (csv) and Command Line Interface is provided, which are essential components of a demoable project.
  • Compelte code is under 200 line of code, which makes it easy to understand and extend.

Design

The code is designed as three modules.

  1. Command line interface: The module responsible for interaction with the end-user. It can be replaced with any kind of interface without affecting other module. For example: it can be replaced by REST API.
  2. Business Logic: This module contains the core logic of the application.
  3. Data Access Object: This module is responsible for interacting with the storage and provide the data to the application. Currently it reads from csv file, and keeps the data in memory. It can easily be replaced with another DAO which interacts with Database.

Implementation

Implementation is done in python3.6. No external library is used.
Although it implements Group Management System, this code can be used as a started code for any quick project.

Files

All the source code is inside src directory.

  • command_line_interface.py This file represents Command Line Interface module. It interacts directly with GroupManager, but not with data access module.
    It extends Cmd class, and can be started by cmdloop function.

  • group_manager.py This file represents Group Management module. It interacts directly with data access module. It provides functions: check_user_in_group, add_user_to_group and remove_user_from_group.

  • csv_dao.py This file represents CSV Data Access Object module. It interacts with storage(csv files) to provide data access to other modules.

  • models.py This file contains the definition of entities.

  • main.py This file stitch together all the module into an application.

  • exceptions.py This file contains definition of commonly occurring exceptions.

Usage/Execution

The application can be started using command

cd src
python src/main.py

The program load the data from data directory and provides a command prompt for basic functionality.

Commands

  1. help: To know about available commands.
  2. users: To see all users.
  3. groups: To see all groups.
  4. assign <user_id> <group_id>: To assign a user to a group.
  5. remove <user_id> <group_id>: To remove a user from a group.
  6. exit: To exit from command prompt.

kickup's People

Contributors

luckykadam avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

rwik

kickup's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.