|
|
|
@ -2,4 +2,61 @@ from datetime import datetime |
|
|
|
import click |
|
|
|
import click |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print("Hello") |
|
|
|
@click.group() |
|
|
|
|
|
|
|
def cli(): |
|
|
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command(name='hello') |
|
|
|
|
|
|
|
def print_hello(): |
|
|
|
|
|
|
|
"""Print Hello""" |
|
|
|
|
|
|
|
click.echo('Hello from Portfolio Manager!') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command(name='view-docs') |
|
|
|
|
|
|
|
def view_click_docs(): |
|
|
|
|
|
|
|
"""View Click documentation""" |
|
|
|
|
|
|
|
click.launch('https://click.palletsprojects.com/en/7.x/') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.group() |
|
|
|
|
|
|
|
def nordnet(): |
|
|
|
|
|
|
|
"""Nordnet commands""" |
|
|
|
|
|
|
|
click.echo('Nordnet commands') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.group() |
|
|
|
|
|
|
|
def db(): |
|
|
|
|
|
|
|
"""Database commands""" |
|
|
|
|
|
|
|
click.echo('Database commands') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.group() |
|
|
|
|
|
|
|
def config(): |
|
|
|
|
|
|
|
"""Config App Commands""" |
|
|
|
|
|
|
|
click.echo('Config App Commands') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@nordnet.command(name='pm-view') |
|
|
|
|
|
|
|
def open_nordnet(): |
|
|
|
|
|
|
|
"""Open Nordnet Web App""" |
|
|
|
|
|
|
|
click.echo("Open Nordnet Web App!") |
|
|
|
|
|
|
|
click.launch('https://www.nordnet.no/overview') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@nordnet.command(name='read-trans') |
|
|
|
|
|
|
|
def read_transactions(): |
|
|
|
|
|
|
|
"""Reading and cleaning transaction file from Nordnet""" |
|
|
|
|
|
|
|
click.echo('Reading and cleaning transaction file from Nordnet') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cli.add_command(print_hello) |
|
|
|
|
|
|
|
cli.add_command(view_click_docs) |
|
|
|
|
|
|
|
cli.add_command(nordnet) |
|
|
|
|
|
|
|
cli.add_command(db) |
|
|
|
|
|
|
|
cli.add_command(config) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nordnet.add_command(open_nordnet) |
|
|
|
|
|
|
|
nordnet.add_command(read_transactions) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# if __name__=='__main__': |
|
|
|
|
|
|
|
# main_cli() |
|
|
|
|