简单的python包,用于公司根据到公司办公室的距离,从包含json编码的客户坐标的数据文件中生成来宾列表。

guest_list的Python项目详细描述


简介

简单的python包,用于公司根据到公司办公室的距离,从包含json编码的客户坐标的数据文件中生成来宾列表。

示例数据文件在“customers.json”中给出

默认距离为100公里,默认办公地点为:

{"latitude": 53.3381985, 'longitude': -6.2592576}

要求

Python3

安装

pip install guest_list

用法

importguest_list# 'customers.json' must be stored in the same directory as your python scriptguests=guest_list.create("customers.json")forguestinguests:print("{}: {}".format(guest['user_id'],guest['name']))
< >办公室位置和最大距离可以作为参数

传递。
importguest_listoffice_coordinates={'latitude':53.378356,'longitude':-6.588503}max_distance_km=60.0guests=guest_list.create("customers.json",office_coordinates=office_coordinates,max_distance_km=max_distance_km)forguestinguests:print("{}: {}".format(guest['user_id'],guest['name']))

测试

运行测试:

git clone https://github.com/kujosHeist/guest_list.git
cd guest_list

python setup.py test

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

推荐PyPI第三方库


热门话题
java在ArrayList中比较数字   java在Kotlin中使异步调用同步   让“Scala编程”junit示例在IntelliJ中工作的java问题   java Servlet侦听器未在ContextListener中设置属性   将Microsoft SQL Server数据库连接到我的Java项目   加载资源时出现java“需要注册工厂”异常   java如何使用POI检查excel中的重复记录?   java如何更改机器生成的代码   java如何确保重写的方法是同步的   用Spring编写Hibernate时的java XML奥秘   java管理mysql数据库中存储的用户权限   java如何运行。来自Javascript的jar方法   java我想在Web应用程序中进行身份验证&对桌面应用程序使用相同的凭据。我该怎么做?