File tree Expand file tree Collapse file tree 5 files changed +32
-15
lines changed
Expand file tree Collapse file tree 5 files changed +32
-15
lines changed Original file line number Diff line number Diff line change @@ -49,14 +49,16 @@ schwab2pp --help
4949``` txt
5050 Usage: schwab2pp [OPTIONS] [SCHWAB_CSV] [PP_CSV]
5151
52- Converts a transactions CSV file from Charles Schwab to an
53- equivalent and ready-to-import CSV file for Portfolio
52+ Convert transactions from Charles Schwab for Portfolio
5453 Performance.
5554
55+ Convert a transactions CSV file from Charles Schwab to an
56+ equivalent and ready-to-import CSV file for Portfolio
57+ Performance.
5658
5759╭─ Arguments ─────────────────────────────────────────────────╮
58- │ schwab_csv [SCHWAB_CSV] Input Charles Schwab CSV │
59- │ file │
60+ │ schwab_csv [SCHWAB_CSV] CSV file from Charles │
61+ │ Schwab │
6062│ [default: None] │
6163│ pp_csv [PP_CSV] Resulting CSV file for │
6264│ Portfolio Performance │
@@ -69,8 +71,7 @@ schwab2pp --help
6971│ current shell, to copy it or │
7072│ customize the installation. │
7173│ --help Show this message and exit. │
72- ╰─────────────────────────────────────────────────────────────╯
73- ```
74+ ╰─────────────────────────────────────────────────────────────╯```
7475
7576Example:
7677
Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ line-length = 88
5858select = [
5959 # See: https://docs.astral.sh/ruff/rules/
6060 # Basic list from: https://docs.astral.sh/ruff/linter/#rule-selection
61+ " D" , # https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
6162 " E" , # https://docs.astral.sh/ruff/rules/#error-e
6263 " F" , # https://docs.astral.sh/ruff/rules/#pyflakes-f
6364 " UP" , # https://docs.astral.sh/ruff/rules/#pyupgrade-up
@@ -92,5 +93,8 @@ ignore = [
9293 " ISC002" , # https://docs.astral.sh/ruff/rules/multi-line-implicit-string-concatenation/
9394]
9495
96+ [tool .ruff .lint .pydocstyle ]
97+ convention = " numpy" # https://docs.astral.sh/ruff/faq/#does-ruff-support-numpy-or-google-style-docstrings
98+
9599[tool .ruff .format ]
96- docstring-code-format = true
100+ docstring-code-format = true # https://docs.astral.sh/ruff/formatter/#docstring-formatting
Original file line number Diff line number Diff line change 1+ """schwab2pp package.
2+
3+ This package contains a CLI app.
4+ """
5+
16from importlib .metadata import version
27
38__version__ = version ("schwab2pp" )
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2+ """CLI wrapper for the conversion.
3+
4+ This module creates a CLI app and validates arguments.
5+ """
26
37from pathlib import Path
48from typing import Optional
1418@app .command ()
1519def main (
1620 schwab_csv : Annotated [
17- Optional [Path ], typer .Argument (help = "Input Charles Schwab CSV file " )
21+ Optional [Path ], typer .Argument (help = "CSV file from Charles Schwab " )
1822 ] = None ,
1923 pp_csv : Annotated [
2024 Path ,
2125 typer .Argument (help = "Resulting CSV file for Portfolio Performance" ),
2226 ] = Path ("pp.csv" ),
2327) -> int :
24- """
25- Converts a transactions CSV file from Charles Schwab to an equivalent and
28+ """Convert transactions from Charles Schwab for Portfolio Performance.
29+
30+ Convert a transactions CSV file from Charles Schwab to an equivalent and
2631 ready-to-import CSV file for Portfolio Performance.
2732 """
28-
2933 # Argument validation
3034 if schwab_csv is None :
3135 print ("Missing input Schwab CSV file" )
Original file line number Diff line number Diff line change 11#!/usr/bin/env python3
2+ """Conversion of transactions.
3+
4+ This module converts Schwab transactions to Portfolio Performance ones.
5+ """
26
37import sys
48from pathlib import Path
711
812
913def remove_currency (text : str ) -> str :
10- """Removes currency symbol from string. Works for negative values."""
14+ """Remove currency symbol from string. Work for negative values."""
1115 import locale
1216 import re
1317
@@ -17,12 +21,11 @@ def remove_currency(text: str) -> str:
1721
1822
1923def convert (schwab_csv : Path , pp_csv : Path ) -> int :
20- """Converts transactions from Charles Schwab to Portfolio Performance.
24+ """Convert transactions from Charles Schwab for Portfolio Performance.
2125
22- Converts a transactions CSV file from Charles Schwab to an equivalent and
26+ Convert a transactions CSV file from Charles Schwab to an equivalent and
2327 ready-to-import CSV file for Portfolio Performance.
2428 """
25-
2629 # A Charles Scwab CSV starts with a prefix and a suffix row
2730 # Prefix: "Transactions for account..."
2831 # Suffix: "Transactions Total"
You can’t perform that action at this time.
0 commit comments