Skip to content

Commit 76e7127

Browse files
authored
Merge pull request #43 from OpenDataAlex/process_tracker_python-21
process_tracker_python-21 Add or Delete Process Dependencies From CLI
2 parents 5898dde + 990a763 commit 76e7127

File tree

4 files changed

+302
-122
lines changed

4 files changed

+302
-122
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Data integration process management made easy!
88
[![PyPI version](https://badge.fury.io/py/processtracker.svg)](https://badge.fury.io/py/processtracker)
99
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
1010
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
11+
[![Documentation Status](https://readthedocs.org/projects/process-tracker/badge/?version=latest)](https://process-tracker.readthedocs.io/en/latest/?badge=latest)
1112

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

process_tracker/cli.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,31 +44,51 @@ def main():
4444
@main.command()
4545
@click.option("-t", "--topic", help="The topic being created")
4646
@click.option("-n", "--name", help="The name for the topic.")
47-
def create(topic, name):
47+
@click.option(
48+
"-p", "--parent", help="The parent process' name, if creating a process dependency"
49+
)
50+
@click.option(
51+
"-c", "--child", help="The child process' name, if creating a process dependency"
52+
)
53+
def create(topic, name, parent=None, child=None):
4854
"""
4955
Create an item that is within the valid topics list.
5056
:param topic: The name of the topic.
5157
:type topic: string
5258
:param name: The name of the topic item to be added.
5359
:type name: string
60+
:param parent: The parent process' name, if creating a process dependency
61+
:type parent: string
62+
:param child: The child process' name, if creating a process dependency
63+
:type child: string
5464
"""
5565
click.echo("Attempting to create %s with name %s" % (topic, name))
56-
data_store.topic_creator(topic=topic, name=name)
66+
data_store.topic_creator(topic=topic, name=name, parent=parent, child=child)
5767

5868

5969
@main.command()
6070
@click.option("-t", "--topic", help="The topic being created")
6171
@click.option("-n", "--name", help="The name for the topic.")
62-
def delete(topic, name):
72+
@click.option(
73+
"-p", "--parent", help="The parent process' name, if deleting a process dependency"
74+
)
75+
@click.option(
76+
"-c", "--child", help="The child process' name, if deleting a process dependency"
77+
)
78+
def delete(topic, name, parent=None, child=None):
6379
"""
6480
Delete an item that is within the valid topics list and not a pre-loaded item.
6581
:param topic: The name of the topic.
6682
:type topic: string
6783
:param name: The name of the topic item to be deleted.
6884
:type name: string
85+
:param parent: The parent process' name, if deleting a process dependency
86+
:type parent: string
87+
:param child: The child process' name, if deleting a process dependency
88+
:type child: string
6989
"""
7090
click.echo("Attempting to delete %s with name %s" % (topic, name))
71-
data_store.topic_deleter(topic=topic, name=name)
91+
data_store.topic_deleter(topic=topic, name=name, parent=parent, child=child)
7292

7393

7494
@main.command()

0 commit comments

Comments
 (0)