Skip to content

Commit dabf746

Browse files
committed
#18 Add version command
1 parent 18326f6 commit dabf746

2 files changed

Lines changed: 15 additions & 3 deletions

File tree

deshima_rawdata/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__all__ = ["cli", "download", "list"]
1+
__all__ = ["cli", "download", "list", "version"]
22
__version__ = "2023.11.4"
33

44

deshima_rawdata/cli.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__all__ = ["download", "list"]
1+
__all__ = ["download", "list", "version"]
22

33

44
# standard library
@@ -10,6 +10,7 @@
1010
# dependencies
1111
import pandas as pd
1212
from fire import Fire
13+
from packaging.version import Version
1314
from requests import get
1415
from tqdm import tqdm
1516
from . import __version__
@@ -103,6 +104,17 @@ def list(format: str = DEFAULT_LIST_FORMAT) -> Any:
103104
return getattr(DATA_LIST, f"to_{format}")()
104105

105106

107+
def version() -> Version:
108+
"""Show the version of the package."""
109+
return Version(__version__)
110+
111+
106112
def main() -> None:
107113
"""Entry point of the deshima-rawdata command."""
108-
Fire({"download": download, "list": list})
114+
Fire(
115+
{
116+
"download": download,
117+
"list": list,
118+
"version": version,
119+
}
120+
)

0 commit comments

Comments
 (0)