Skip to content

Commit 4d04c61

Browse files
committed
Update docstrings
1 parent bf86439 commit 4d04c61

File tree

5 files changed

+32
-15
lines changed

5 files changed

+32
-15
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff 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
7576
Example:
7677

pyproject.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ line-length = 88
5858
select = [
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

src/schwab2pp/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
"""schwab2pp package.
2+
3+
This package contains a CLI app.
4+
"""
5+
16
from importlib.metadata import version
27

38
__version__ = version("schwab2pp")

src/schwab2pp/cli.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env python3
2+
"""CLI wrapper for the conversion.
3+
4+
This module creates a CLI app and validates arguments.
5+
"""
26

37
from pathlib import Path
48
from typing import Optional
@@ -14,18 +18,18 @@
1418
@app.command()
1519
def 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")

src/schwab2pp/convert.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
#!/usr/bin/env python3
2+
"""Conversion of transactions.
3+
4+
This module converts Schwab transactions to Portfolio Performance ones.
5+
"""
26

37
import sys
48
from pathlib import Path
@@ -7,7 +11,7 @@
711

812

913
def 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

1923
def 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"

0 commit comments

Comments
 (0)