This is a room allocation software for Andela's Amity campus. It is a command line application that randomly allocates a recently added staff to an office and a recently added fellow to an office and living space if the fellow states that he wants accomodation. The app information is persisted in an SQLite database and must be loaded first before previously saved allocation information can be accessed.
- Clone the repo and navigate to project directory
$ git clone [email protected]:andela-cdike/checkpoint-1.git
- Activate virtual environment for project.
$ workon <env-name>
- Install dependecies
$ pip install -r requirements.txt
- See list of available commands
$ python main.py --help
The features of this app are accessed via the command line. The command line is implemented with docopt while the app infomation is stored in pickle until user gives the command to persist the data. Features of this app include:
- Create room: You could creater multiple rooms at a time.
- Add a person: staff or fellow.
- Get a person's identifier.
- Load people information from a text file and automatically add them to the application.
- Reallocate a person.
- Allocate a person using the same reallocate command.
- Print all allocations either to screen or to a text file.
- Print names of all those who do not have an allocation to screen or a text file.
- Print names of all occupants of a specified room.
- Persist the information on the app to a database. If no database is specified, a default - "app.db" is used.
- Load information from the database into the application.
Usage:
- main.py create_room ( <room_type>)...
- main.py add_person <first_name> <last_name> <employee_type> [--wants_accommodation=ans]
- main.py get_person_identifier <first_name> <last_name>
- main.py reallocate_person <person_identifier> <new_room_name>
- main.py loads_people <text_file>
- main.py print_allocations [-o=file_name]
- main.py print_unallocated [-o=file_name]
- main.py print_room <room_name>
- main.py save_state [--db=sqlite_database]
- main.py load_state <db_file_path>
- main.py (-h | --help)
Options:
- -h --help Show this screen.
- --wants_accommodation= Specifies if person wants accommodation or not [default: N]
- -o=<file_name> Specifies a file to print output [default: screen]
- --db=sqlite_database Specifies a database to persist data [default: app.db]
- Navigate to project directory.
- Then, navigate to tests directory.
- Run
nosetests --with-coverage --cover-package=..
Click here to watch a demonstration of the Amity Room Allocation App.