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 details)

Uploaded Source

File details

Details for the file guest_list-0.1.tar.gz.

File metadata

  • Download URL: guest_list-0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for guest_list-0.1.tar.gz
Algorithm Hash digest
SHA256 86ec90739687c22df120df5392f3897ce52368a6a0c87d91212f9819852ec3ec
MD5 d8418ddbfd640ef4e79ac38ea346a7ff
BLAKE2b-256 638ff690a4bc64ada5e624a90895ad27a8967dcf0406d852502200ea16725b10

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