Skip to main content

Matching software for speed friending events.

Project description

Matching Software for Speed Friending and Dating Events

Build Status License: MIT Code style: black

This application is designed to make your life as organizer of speed friending or speed dating events easier. I created this software for a local speed friending event in Vienna, Austria to give back value to the event organizers. For me, the project additionally serves as a playground for software engineering best practices. The application was implemented in an agile, test-driven development process applying all development best practices so far known to me.

Installing the application

To install the live coding environment run:

python setup.py install

or install it via pip

pip install speed-friending-matcher

How to use it

Run the speed-friending-matcher from the command line:

usage: speed_friending_matcher [-h] -i INPUT -o OUTPUT [-m MATCHMAKER] [-s]

Matchmaking application for speed friending events

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        Input plugin and parameters e.g. csv:somefile.csv
  -o OUTPUT, --output OUTPUT
                        Output plugins and parameters e.g. todo:mytodo.txt
  -m MATCHMAKER, --matchmaker MATCHMAKER
                        Matchmaker, simple or clique
  -s, --server          Starts a local webserver with a web GUI.

For example:

speed_friending_matcher -i csv:example/sample.csv -o todo:test.txt

Importer Plugins

  • csv:.csv: imports a CSV file with partipants data

Exporter Plugins

[] means optional

  • todo - exports a TODO file
todo:<filename>.txt:[<template_filename>.txt]
  • onexlsx - exports a single Excel sheet containing matching information
onexlsx:<filename>.xlsx
  • clique - exports a file containing all found cliques, to be used with the clique matchmaker
clique:<filename>.txt:[<header_filename>.txt]:[<template_filename.txt]
  • graph - exports a graphical representation of the match graph, supports any export formats supported by GraphViz
graph:<filename>.<png, dot, ...>

Matchmakers

  • simple: Simple I liked you, you liked me matchmaking
  • clique: Finds cliques of people liking each other

Run on your Server

The application can be started in server mode with the optional command line argument -s. However, please be aware that this starts a development server which is not recommended to be used for production.

If you want to run the application on your webserver please refer to the WSGI Guide for Flask. or use gunicorn.

For example:

pip3 install gunicorn --user
gunicorn -w 4 wsgi:application

Use your Apache or other webservers .htaccess to forward the port.

Detailed instructions

The following instructions were tested on a server with root access.

If you are running these steps in a production environment, make sure you have a back-up in place. I'm not responsible for any damages or losses.

If you have a webmaster, let your webmaster do the job.

Ensure Python and pip are installed

  1. Open a root terminal on your server
  2. Check if Python is installed
which python

Should return something along the lines of

/usr/bin/python

If not please refer to your web hosts manual for installing Python.

  1. Check if pip is installed
which pip

Should return

/usr/bin/pip

If not you can install pip with the get-pip.py script.

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
rm get-pip.py
  1. Install the Python dependencies
pip install gunicorn aenum flask

Set-up the Script

  1. Log in with your user account

Either via the root shell su - <username> or via your webhosts login shell.

  1. Download the speed-friending matcher
cd ~
mdkir repos
cd repos
git clone https://github.com/machinekoder/speed-friending-and-dating-matcher.git
``

3. Create a start script

```bash
cd ~
mkdir scripts
cd scripts
nano start-speed-friending-matcher.sh

#!/bin/bash
pgrep -x gunicorn
if [ $? -ne 0 ]; then
cd ~/repos/speed-friending-and-dating-matcher
gunicorn -w 4 wsgi:application -b localhost:5000
fi
chmod +x start-speed-friending-matcher.sh
  1. Set up crontab to start the script
crontab -e

Insert

* * * * * ~/scripts/start-speed-friending-matcher.sh

Now wait one minute and your server should be up and running.

Configure Apache

Use the .htaccess of your website to create a RewriteRule to the running gunicorn instance.

In this example we place the speed-friending script on the route /script/*, every other route is redirected to /index.php.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^script/(.*)$ http://localhost:5000/$1 [P,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.*$ /index.php [L]
</IfModule>

Stopping everything

First, you need to remove the start script from crontab crontab -e.

Then kill all running gunicorn instances killall gunicorn.

Extending the software

You can extend the software by adding new import and export plugins. Take a look the default plugins csvimporter and todoexporter for more details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

speed-friending-matcher-0.1.1.dev0.zip (39.8 kB view details)

Uploaded Source

File details

Details for the file speed-friending-matcher-0.1.1.dev0.zip.

File metadata

  • Download URL: speed-friending-matcher-0.1.1.dev0.zip
  • Upload date:
  • Size: 39.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.20.1 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.7

File hashes

Hashes for speed-friending-matcher-0.1.1.dev0.zip
Algorithm Hash digest
SHA256 f441c6e285db009ad990bc6cd9c471d5c90930dd4d518640a680aad5b0b3e8a3
MD5 3a18b0efa5b423eab243aa85e610136c
BLAKE2b-256 b1cf6364bf393d760ab4b0ec78833cc576e6c80d911e4e47aeeedd8fce55a38a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page