用于速度友好活动的匹配软件。

speed-friending-matcher的Python项目详细描述


快速交友和约会活动的匹配软件

Build StatusLicense: MITCode style: black

此应用程序旨在使您的生活作为快速交友或快速约会活动的组织者更容易。我为一个local speed friending event in Vienna, Austria创建了这个软件,以将价值回馈给活动组织者。对我来说,这个项目还可以作为软件工程最佳实践的游乐场。应用程序是在一个敏捷的、测试驱动的开发过程中实现的,应用了迄今为止我所知道的所有开发最佳实践。

安装应用程序

要安装实时编码环境,请运行:

python setup.py install

或通过PIP安装

pip install speed-friending-matcher

如何使用

从命令行运行速度友好匹配程序:

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.

例如:

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

导入程序插件

  • csv:<;filename>;.csv:导入包含分区数据的csv文件

导出器插件

[]表示可选

  • TOdo-导出TOdo文件
todo:<filename>.txt:[<template_filename>.txt]
  • onexlsx-导出包含匹配信息的单个excel工作表
onexlsx:<filename>.xlsx
  • clique-导出包含所有已找到的团的文件,以便与团媒人一起使用
clique:<filename>.txt:[<header_filename>.txt]:[<template_filename.txt]
  • graph-导出匹配图的图形表示,支持GraphViz支持的任何导出格式
graph:<filename>.<png, dot, ...>

媒人

  • simple:简单我喜欢你,你喜欢我做媒
  • clique:查找彼此喜欢的人的集团

在服务器上运行

应用程序可以在服务器模式下使用可选的命令行参数-s启动。 但是,请注意,这将启动不推荐使用的开发服务器 用于生产。

如果要在Web服务器上运行应用程序,请参阅 WSGI Guide for Flask.或 使用gunicorn

例如:

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

使用apache或其他web服务器.htaccess转发端口。

详细说明

以下说明是在具有根访问权限的服务器上测试的。

如果要在生产环境中运行这些步骤,请确保已准备好备份。任何损坏或损失我概不负责。

如果你有一个网站管理员,让你的网站管理员做这项工作。

确保安装了python和pip
  1. 在服务器上打开根终端
  2. 检查是否安装了python
which python

应该返回

/usr/bin/python

如果没有,请参阅您的web主机手册以安装python。

  1. 检查是否安装了PIP
which pip

应返回

/usr/bin/pip

如果没有,可以使用get-pip.py脚本安装pip。

wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
rm get-pip.py
  1. 安装python依赖项
pip install gunicorn aenum flask

设置脚本
  1. 使用您的用户帐户登录

通过根shell su - <username>或通过webhosts登录shell。

  1. 下载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. 设置crontab以启动脚本
crontab -e

插入

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

现在等一分钟,你的服务器应该已经启动并运行了。

配置apache

使用网站的.htaccess创建一个RewriteRule到正在运行的gunicorn实例。

在本例中,我们将速度友好脚本放在路由/script/*上,其他所有路由都重定向到/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>

停止所有操作

首先,需要从crontabcrontab -e中删除启动脚本。

然后杀死所有正在运行的gunicorn实例killall gunicorn

扩展软件

您可以通过添加新的导入和导出插件来扩展软件。看看默认插件 csvimportertodoexporter了解更多详细信息。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java字符串。替换(regex,string)以替换XML中的内容   java Spring SOAP Web服务请求日志中XML请求有效负载的元素   java在一个类中保存作业对象并在另一个类中使用(初学者)   java无法定位com。西蒙图夫斯。奥内贾尔。在web启动中启动   java可以将Spring DAO合并到服务层吗?   使用互相关的声音文件的java时间延迟   java理解C中声明的数组指针算法   regex如何在Java中找到第一个未替换的引号?   当存在插入Spring数据JPA时进行java数据库轮询   java Axis客户端调用引发classcast异常   JavaFX ControlFX对话框中的java动作按钮css样式   使用iText Java获取空页计数   返回随机文本字段输入的java   java从spring boot stomp连接到外部activemq   java控制台错误无法找到或加载主类   java NoClassDefFoundError在尝试使用JarSigner对apk文件进行签名时出错。exe   GuavaJava:对象列表到字符串列表的可能转换   java PropertyPlaceHolderConfiguration和ResourceBundleMessageSource   java无法在回调中赋值   用于旋转变换的java简洁类(减少冗余)