项目作者: ttungl

项目描述 :
As a data engineer working for political consultants whose clients are cash-strapped political candidates. They've asked for help analyzing loyalty trends in campaign contributions, namely identifying areas of repeat donors and calculating how much they're spending. Identify areas (zip codes) that could be sources of repeat campaign contributions.
高级语言: Python
项目地址: git://github.com/ttungl/donation-analytics.git
创建时间: 2018-02-13T06:42:19Z
项目社区:https://github.com/ttungl/donation-analytics

开源协议:MIT License

下载


Donation Analytics


InsightDataScience

1. Files Location

In this challenge, our program will do the following steps:

  • Read input files: itcont.txt and percentile.txt, which are stored in the input folder (\donation-analytics\input\)

  • Write output file: repeat_donors.txt, which is stored in the output folder (\donation-analytics\output\)

  • Source codes in \donation-analytics\src\ contain the following files:

    • donation-analytics.py: this is the main file to run the program.

    • donation_info.py: to manage methods usage.

    • checkInputValid.py: to check the inputs validation.

    • read_dataset.py and write_dataset.py: to read from files and write to file.

2. Run the program

To run the program, using ./run.sh under the donation-analytics directory.

The expected result will be written in the repeat_donors.txt as follows.

  1. C00384516|02895|2018|333|333|1
  2. C00384516|02895|2018|333|717|2

3. Testing

To run the tests, go to the insight_testsuite directory, then using ./run_tests.sh.

  1. Tungs-MBP:insight_testsuite tungthanhle$ ./run_tests.sh

The expected result will be displayed on the terminal as follows.

  1. [PASS]: my-own-test repeat_donors.txt
  2. [PASS]: test_1 repeat_donors.txt
  3. [Tue Feb 13 00:47:29 CST 2018] 2 of 2 tests passed

Beside the default test_1 testcase, I also created my-own-test testcase.

Note, the log of the tests is saved in the results.txt in insight_testsuite directory.