Skip to content

Commit b5ef4fe

Browse files
authored
Merge pull request #35 from OpenDataAlex/process_tracker_python-14
Process tracker python 14
2 parents b36cdfa + 55c458c commit b5ef4fe

25 files changed

+1820
-809
lines changed

.idea/watcherTasks.xml

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ verify_ssl = true
55

66
[dev-packages]
77
coverage="*"
8+
coveralls="*"
89
moto="*"
910
python-coveralls="*"
10-
coveralls="*"
1111

1212
[packages]
1313
boto3="*"

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Data integration process management made easy!
44

55
[![Coverage Status](https://coveralls.io/repos/github/OpenDataAlex/process_tracker_python/badge.svg?branch=master)](https://coveralls.io/github/OpenDataAlex/process_tracker_python?branch=master)
66
[![Build Status](https://travis-ci.org/OpenDataAlex/process_tracker_python.svg?branch=master)](https://travis-ci.org/OpenDataAlex/process_tracker_python)
7+
[![Downloads](https://pepy.tech/badge/processtracker)](https://pepy.tech/project/processtracker)
8+
[![PyPI version](https://badge.fury.io/py/processtracker.svg)](https://badge.fury.io/py/processtracker)
9+
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
10+
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
711

812
This is the Python implementation of the ProcessTracker framework. ProcessTracker builds a standard framework that is
913
tool agnostic. If you are working with data integration/cleansing processes within Python (i.e. using PySpark, Pandas, etc.)

dbscripts/mysql_process_tracker.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,18 @@ create index extract_status_id
7676
create index location_type
7777
on location_lkup (location_type);
7878

79+
create table process_tracker.extract_dependency
80+
(
81+
parent_extract_id int not null,
82+
child_extract_id int not null,
83+
primary key (parent_extract_id, child_extract_id),
84+
constraint extract_dependency_fk01
85+
foreign key (parent_extract_id) references process_tracker.extract_tracking (extract_id),
86+
constraint extract_dependency_fk02
87+
foreign key (child_extract_id) references process_tracker.extract_tracking (extract_id)
88+
)
89+
comment 'Table tracking interdependencies between extract files.';
90+
7991
create table process_status_lkup
8092
(
8193
process_status_id int auto_increment

dbscripts/postgresql_process_tracker.sql

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,9 @@ comment on table location_type_lkup is 'Listing of location types';
258258

259259
alter table location_type_lkup owner to pt_admin;
260260

261+
create unique index location_type_lkup_udx01
262+
on location_type_lkup (location_type_name);
263+
261264
create table location_lkup
262265
(
263266
location_id serial not null
@@ -332,9 +335,6 @@ comment on table extract_process_tracking is 'Showing which processes have impac
332335

333336
alter table extract_process_tracking owner to pt_admin;
334337

335-
create unique index location_type_lkup_udx01
336-
on location_type_lkup (location_type_name);
337-
338338
create table process_source
339339
(
340340
source_id integer not null
@@ -382,3 +382,20 @@ alter table system_lkup owner to pt_admin;
382382

383383
create unique index system_lkup_system_key_uindex
384384
on system_lkup (system_key);
385+
386+
create table extract_dependency
387+
(
388+
parent_extract_id integer not null
389+
constraint extract_dependency_fk01
390+
references extract_tracking,
391+
child_extract_id integer not null
392+
constraint extract_dependency_fk02
393+
references extract_tracking,
394+
constraint extract_dependency_pk
395+
primary key (parent_extract_id, child_extract_id)
396+
);
397+
398+
comment on table extract_dependency is 'Table tracking interdependencies between extract files.';
399+
400+
alter table extract_dependency owner to pt_admin;
401+

process_tracker/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from process_tracker.extract_tracker import ExtractTracker
22
from process_tracker.process_tracker import ProcessTracker
33

4-
__version__ = '0.2.0'
4+
__version__ = "0.2.0"

process_tracker/cli.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from process_tracker.utilities.logging import console
99

1010
data_store = DataStore()
11-
logger = logging.getLogger('Process Tracker')
11+
logger = logging.getLogger("Process Tracker")
1212
logger.addHandler(console)
1313

1414

@@ -42,8 +42,8 @@ def main():
4242

4343

4444
@main.command()
45-
@click.option('-t', '--topic', help='The topic being created')
46-
@click.option('-n', '--name', help='The name for the topic.')
45+
@click.option("-t", "--topic", help="The topic being created")
46+
@click.option("-n", "--name", help="The name for the topic.")
4747
def create(topic, name):
4848
"""
4949
Create an item that is within the valid topics list.
@@ -52,13 +52,13 @@ def create(topic, name):
5252
:param name: The name of the topic item to be added.
5353
:type name: string
5454
"""
55-
click.echo('Attempting to create %s with name %s' % (topic, name))
55+
click.echo("Attempting to create %s with name %s" % (topic, name))
5656
data_store.topic_creator(topic=topic, name=name)
5757

5858

5959
@main.command()
60-
@click.option('-t', '--topic', help='The topic being created')
61-
@click.option('-n', '--name', help='The name for the topic.')
60+
@click.option("-t", "--topic", help="The topic being created")
61+
@click.option("-n", "--name", help="The name for the topic.")
6262
def delete(topic, name):
6363
"""
6464
Delete an item that is within the valid topics list and not a pre-loaded item.
@@ -67,15 +67,17 @@ def delete(topic, name):
6767
:param name: The name of the topic item to be deleted.
6868
:type name: string
6969
"""
70-
click.echo('Attempting to delete %s with name %s' % (topic, name))
70+
click.echo("Attempting to delete %s with name %s" % (topic, name))
7171
data_store.topic_deleter(topic=topic, name=name)
7272

7373

7474
@main.command()
75-
@click.option('-t', '--topic', help='The topic being created')
76-
@click.option('-i', '--initial-name', help='The name that needs to be changed.')
77-
@click.option('-n', '--name', help='The new name for the topic.')
75+
@click.option("-t", "--topic", help="The topic being created")
76+
@click.option("-i", "--initial-name", help="The name that needs to be changed.")
77+
@click.option("-n", "--name", help="The new name for the topic.")
7878
def update(topic, initial_name, name):
7979

80-
click.echo('Attempting to update %s with name %s to %s' % (topic, initial_name, name))
80+
click.echo(
81+
"Attempting to update %s with name %s to %s" % (topic, initial_name, name)
82+
)
8183
data_store.topic_updater(topic=topic, initial_name=initial_name, name=name)

0 commit comments

Comments
 (0)