A table allocator that (roughly) randomises the people on tables.
-
Install Python 3. Download link here if you need to do this.
This version was developed on
Python 3.5.2
. If future versions break something, try installing this. -
Open a terminal in the same directory as
seatAllocator.py
and run the line:$ python3 seatAllocator.py
-
As per the prompt, enter the location of your list of names. My csv files are formatted as in the example
example.csv
, that is, (lastName, firstName, tableNumber) (Guests with table numbers already given will be ignored), but you can edit the code to fit yours if you need. -
As per the prompt, enter the name of the file you want to save the new lists in. By default, the program will create an output folder called "TableForm/", * and save into a file called "Tables.csv" if no file is entered.
-
As per the prompt, enter the number of seats to be on each table. This defaults to 8 people.
-
As per the prompt, enter some text as a seed for the allocation algorithm. The same seed should reproduce the same table allocation every time.
- Open a terminal in the same directory as
seatAllocator.py
and run the line:
$ python3 linearise.py
-
As per the prompt, enter the path and name of the file you gave in step 3. of seatAllocator.py (ie the list of names and tables).
-
As per the prompt, enter the path and name of the file created by seatAllocator.py (ie the one in "TableForm/")
-
Enter a file to write to. By default, creates a folder called "LinearForm/", and writes to "Linear.csv"
-
Any names the program can't find for whatever reason will be on table number 0. This is a good indicator that something went wrong.
* (If no folder is given. Use ./<name>
to specify the current directory)
Feel free to modify and reuse this code however you need. Potentially useful changes to be pointed out here in a future update,
This algorithm effectively uses a probing hash table to allocate all the seats. The hash is generated using a combination of MD5 hash and a random integer salt that starts with the user's input salt.
Released under the Apache License 2.0:
Copyright 2017 Luke Hedt (PhalanxHead)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.