Compare commits

...

6 Commits

  1. 3
      .gitignore
  2. 15
      .vscode/launch.json
  3. 5
      .vscode/settings.json
  4. 59
      portfolio_manager/scr/cli.py
  5. 3
      pyproject.toml

3
.gitignore vendored

@ -0,0 +1,3 @@
#Pytthon
.venv/
__pycache__

15
.vscode/launch.json vendored

@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: Current File",
"type": "debugpy",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

5
.vscode/settings.json vendored

@ -0,0 +1,5 @@
{
"files.exclude": {
"**/__pycache__": true
}
}

59
portfolio_manager/scr/cli.py

@ -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()

3
pyproject.toml

@ -18,3 +18,6 @@ pytest = "^8.3.2"
[build-system] [build-system]
requires = ["poetry-core"] requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api" build-backend = "poetry.core.masonry.api"
[tool.poetry.scripts]
pm = "portfolio_manager.scr.cli:cli"

Loading…
Cancel
Save