generated from habedi/template-python-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import argparse | ||
|
||
import mongo_analyser.extractor as data_extractor | ||
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description='Usage: mongo_analyser <command> [<args>]' | ||
'Commands:' | ||
' analyse_schema Analyse MongoDB schema and generate metadata' | ||
' extract_data Extract data from MongoDB and save to JSON file' | ||
) | ||
|
||
parser.add_argument('command', help='Subcommand to run') | ||
|
||
# Parse the arguments | ||
args = parser.parse_args() | ||
|
||
# Dispatch based on the subcommand | ||
if args.command == 'analyse_schema': | ||
data_extractor.main() | ||
elif args.command == 'extract_data': | ||
data_extractor.main() | ||
else: | ||
parser.print_help() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters