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 | RSS feed

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.

Source Distribution

guest_list-0.1.tar.gz (4.5 kB view hashes)

Uploaded Source

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