Skip to content

Commit 7daf918

Browse files
committed
tools: Install tools as part of this python package
This makes installing easier as we don't have to checkout the repository and rely on running pip install -r requirements_tools. These scripts will be used by the datastore after running the datagetter and take over from the datatester.
1 parent a1a19ac commit 7daf918

File tree

8 files changed

+26
-216
lines changed

8 files changed

+26
-216
lines changed

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,6 @@ $ ./cove/manage.py runserver
2525

2626
CoVE is based on Django and be deployed using the deployment mechanisms as defined in the [Django docs](https://docs.djangoproject.com/en/3.1/howto/deployment/)
2727

28-
## Tools
29-
30-
The tools directory contains a number of command line tools that can be run on TheeSixtyGiving standard data to generate various reports.
31-
32-
### Installing and running tools
33-
34-
Install the python dependences:
35-
```
36-
$ virtualenv .ve --python python3
37-
$ source .ve/bin/activate
38-
$ pip install -r requirements_tools.txt
39-
```
40-
41-
Running various tools example:
42-
```
43-
python ./tools/cove_checks.py ../a001p00000tuoBKAAY.ods
44-
```
4528

4629
## lib360dataquality
4730

@@ -59,6 +42,15 @@ $ source .ve/bin/activate
5942
$ pip install -e .
6043
```
6144

45+
### Using the tools
46+
47+
The tools directory contains a number of command line tools that can be run on TheeSixtyGiving standard data to generate various reports.
48+
49+
Running various tools example:
50+
```
51+
cove_checks.py ../a001p00000tuoBKAAY.ods
52+
```
53+
6254
### Using the python library
6355

6456
To use the python library import it into your python program, for example to use the additional checks:
@@ -75,4 +67,4 @@ data = '' # Your JSON data
7567
common_checks_360(context, working_dir, data, Schema360())
7668

7769
print(context)
78-
```
70+
```

requirements_tools.in

Lines changed: 0 additions & 3 deletions
This file was deleted.

requirements_tools.txt

Lines changed: 0 additions & 195 deletions
This file was deleted.

setup.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'libcove>=0.18.0',
1515
'python-dateutil',
1616
'rangedict',
17+
'ijson',
1718
],
1819
extras_require={
1920
'perf': [
@@ -26,6 +27,15 @@
2627
'isort',
2728
],
2829
},
30+
scripts=[
31+
"tools/aggregates.py",
32+
"tools/check_grantnav_assumptions.py",
33+
"tools/cove_checks.py",
34+
"tools/coverage.py",
35+
"tools/report.py",
36+
"tools/generate-reports.sh",
37+
"tools/deploy.sh",
38+
],
2939
classifiers=[
3040
'License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)',
3141
'Programming Language :: Python :: 3.6',

tools/aggregates.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import json
23
from lib360dataquality.cove.threesixtygiving import get_grants_aggregates
34

tools/check_grantnav_assumptions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/usr/bin/env python3
12
import ijson
23
import json
34
import os

tools/coverage.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import json
24
from lib360dataquality.cove.schema import Schema360
35
from lib360dataquality.coverage import get_unique_fields_present

tools/report.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#!/usr/bin/env python3
2+
13
import csv
24
import json
35
from collections import defaultdict

0 commit comments

Comments
 (0)