Skip to main content

Simple python package for a company to generate a guest list from a data file containing json encoded customer coordinates, based on their distance to the companies office.

Project description

Introduction

Simple python package for a company to generate a guest list from a data file containing json encoded customer coordinates, based on their distance to the companies office.

Example data file is given in ‘customers.json’

The default distance is 100km and the default office location is:

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

Requirements

python3

pip

Install

pip install guest_list

Usage

import guest_list

# 'customers.json' must be stored in the same directory as your python script
guests = guest_list.create("customers.json")

for guest in guests:
    print("{}: {}".format(guest['user_id'], guest['name']))

The office location and maximum distance can be passed as arguments

import guest_list

office_coordinates = {'latitude': 53.378356, 'longitude': -6.588503}
max_distance_km = 60.0

guests = guest_list.create("customers.json", office_coordinates=office_coordinates, max_distance_km=max_distance_km)

for guest in guests:
    print("{}: {}".format(guest['user_id'], guest['name']))

Tests

To run the tests:

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

python setup.py test

Project details


Release history Release notifications

This version

0.1

Download files

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

Files for guest_list, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size guest_list-0.1.tar.gz (4.5 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page