nber-cli 0.1.3__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,6 +6,8 @@ dist/
6
6
  wheels/
7
7
  *.egg-info
8
8
 
9
+ release/
10
+
9
11
  # Virtual environments
10
12
  .venv
11
13
 
@@ -17,3 +19,6 @@ wheels/
17
19
 
18
20
  # OS X
19
21
  *.DS_Store
22
+
23
+ # local files
24
+ *.local.*
@@ -0,0 +1,37 @@
1
+ # Changelog (Auto Generated by Claude Code)
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [0.1.4] - 2025-08-09
9
+
10
+ ### Added
11
+ - Added `--version` / `-v` flag to display current version
12
+ - Added comprehensive help message with examples
13
+ - Added `__main__.py` file to support `python -m nber_cli` usage
14
+ - Added argument grouping for better CLI organization
15
+ - Added automatic help display when no arguments are provided
16
+
17
+ ### Changed
18
+ - Improved CLI argument parsing with better error handling
19
+ - Enhanced help text formatting with examples
20
+ - Updated argument structure to use argument groups
21
+
22
+ ### Fixed
23
+ - Fixed CLI behavior when no arguments are provided (now shows help instead of error)
24
+
25
+ ## [0.1.3] - Previous
26
+
27
+ ### Added
28
+ - Initial release with basic NBER paper downloading functionality
29
+ - Support for downloading multiple papers by ID
30
+ - Configurable save path for downloaded papers
31
+ - Command-line interface with download functionality
32
+ - Web UI support via `nber-cli-web` command
33
+
34
+ ### Features
35
+ - Async downloading for better performance
36
+ - Support for NBER paper IDs (e.g., w1234, w5678)
37
+ - Default save path: ~/Documents/nber_paper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nber-cli
3
- Version: 0.1.3
3
+ Version: 0.1.4
4
4
  Summary: A command-line tool to download NBER papers.
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -14,6 +14,13 @@ Requires-Dist: orjson
14
14
  Description-Content-Type: text/markdown
15
15
 
16
16
  # NBER-CLI
17
+
18
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19
+ [![PyPI version](https://img.shields.io/pypi/v/nber-cli.svg)](https://pypi.org/project/nber-cli/)
20
+ [![PyPI Downloads](https://static.pepy.tech/badge/nber-cli)](https://pepy.tech/projects/nber-cli)
21
+ [![Issue](https://img.shields.io/badge/Issue-report-green.svg)](https://github.com/sepinetam/nber-cli/issues/new)
22
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/SepineTam/nber-cli)
23
+
17
24
  NBER-CLI is a command line interface for the National Bureau of Economic Research (NBER) paper data.
18
25
 
19
26
 
@@ -1,4 +1,11 @@
1
1
  # NBER-CLI
2
+
3
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4
+ [![PyPI version](https://img.shields.io/pypi/v/nber-cli.svg)](https://pypi.org/project/nber-cli/)
5
+ [![PyPI Downloads](https://static.pepy.tech/badge/nber-cli)](https://pepy.tech/projects/nber-cli)
6
+ [![Issue](https://img.shields.io/badge/Issue-report-green.svg)](https://github.com/sepinetam/nber-cli/issues/new)
7
+ [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/SepineTam/nber-cli)
8
+
2
9
  NBER-CLI is a command line interface for the National Bureau of Economic Research (NBER) paper data.
3
10
 
4
11
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "nber-cli"
3
- version = "0.1.3"
3
+ version = "0.1.4"
4
4
  description = "A command-line tool to download NBER papers."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
@@ -0,0 +1,67 @@
1
+ import argparse
2
+ import asyncio
3
+ import os
4
+ import sys
5
+ from importlib.metadata import version as get_version
6
+
7
+ from .core.download.downloader import main_download_multiple
8
+
9
+
10
+ def get_version_info() -> str:
11
+ """Get the version information of the package."""
12
+ try:
13
+ return get_version("nber-cli")
14
+ except Exception:
15
+ return "0.1.3" # Fallback version
16
+
17
+
18
+ def main():
19
+ parser = argparse.ArgumentParser(
20
+ description="NBER CLI - A command-line tool to download NBER papers.",
21
+ formatter_class=argparse.RawDescriptionHelpFormatter,
22
+ epilog="""
23
+ Examples:
24
+ nber-cli -d w1234 w5678
25
+ nber-cli --download w1234 --save_path ./papers
26
+ nber-cli --version
27
+ nber-cli --help
28
+ """
29
+ )
30
+
31
+ # 添加版本参数
32
+ parser.add_argument(
33
+ "-v",
34
+ "--version",
35
+ action="version",
36
+ version=f"NBER CLI v{get_version_info()}"
37
+ )
38
+
39
+ # 添加下载参数组
40
+ download_group = parser.add_argument_group("Download Options")
41
+ download_group.add_argument(
42
+ "-d",
43
+ "-D",
44
+ "--download",
45
+ dest="paper_ids",
46
+ nargs='+',
47
+ type=str,
48
+ help="One or more NBER paper IDs (e.g., w1234 w5678).")
49
+ download_group.add_argument(
50
+ "--save_path",
51
+ type=str,
52
+ default=os.path.expanduser("~/Documents/nber_paper"),
53
+ help="The directory to save the downloaded paper. Defaults to ~/Documents/nber_paper.")
54
+
55
+ args = parser.parse_args()
56
+
57
+ # 如果没有提供任何参数,显示帮助信息
58
+ if not any(vars(args).values()):
59
+ parser.print_help()
60
+ sys.exit(0)
61
+
62
+ # 如果提供了paper_ids参数,执行下载
63
+ if args.paper_ids:
64
+ asyncio.run(main_download_multiple(args.paper_ids, args.save_path))
65
+ else:
66
+ parser.print_help()
67
+ sys.exit(1)
@@ -0,0 +1,6 @@
1
+ """Entry point for the nber-cli package."""
2
+
3
+ from . import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
@@ -1,5 +1,5 @@
1
1
  version = 1
2
- revision = 2
2
+ revision = 3
3
3
  requires-python = ">=3.11"
4
4
 
5
5
  [[package]]
@@ -135,11 +135,11 @@ wheels = [
135
135
 
136
136
  [[package]]
137
137
  name = "certifi"
138
- version = "2025.6.15"
138
+ version = "2025.8.3"
139
139
  source = { registry = "https://pypi.org/simple" }
140
- sdist = { url = "https://files.pythonhosted.org/packages/73/f7/f14b46d4bcd21092d7d3ccef689615220d8a08fb25e564b65d20738e672e/certifi-2025.6.15.tar.gz", hash = "sha256:d747aa5a8b9bbbb1bb8c22bb13e22bd1f18e9796defa16bab421f7f7a317323b", size = 158753, upload-time = "2025-06-15T02:45:51.329Z" }
140
+ sdist = { url = "https://files.pythonhosted.org/packages/dc/67/960ebe6bf230a96cda2e0abcf73af550ec4f090005363542f0765df162e0/certifi-2025.8.3.tar.gz", hash = "sha256:e564105f78ded564e3ae7c923924435e1daa7463faeab5bb932bc53ffae63407", size = 162386, upload-time = "2025-08-03T03:07:47.08Z" }
141
141
  wheels = [
142
- { url = "https://files.pythonhosted.org/packages/84/ae/320161bd181fc06471eed047ecce67b693fd7515b16d495d8932db763426/certifi-2025.6.15-py3-none-any.whl", hash = "sha256:2e0c7ce7cb5d8f8634ca55d2ba7e6ec2689a2fd6537d8dec1296a477a4910057", size = 157650, upload-time = "2025-06-15T02:45:49.977Z" },
142
+ { url = "https://files.pythonhosted.org/packages/e5/48/1549795ba7742c948d2ad169c1c8cdbae65bc450d6cd753d124b17c8cd32/certifi-2025.8.3-py3-none-any.whl", hash = "sha256:f6c12493cfb1b06ba2ff328595af9350c65d6644968e5d3a2ffd78699af217a5", size = 161216, upload-time = "2025-08-03T03:07:45.777Z" },
143
143
  ]
144
144
 
145
145
  [[package]]
@@ -427,7 +427,7 @@ wheels = [
427
427
 
428
428
  [[package]]
429
429
  name = "nber-cli"
430
- version = "0.1.3"
430
+ version = "0.1.4"
431
431
  source = { editable = "." }
432
432
  dependencies = [
433
433
  { name = "aiohttp" },
@@ -1,27 +0,0 @@
1
- import argparse
2
- import asyncio
3
- import os
4
-
5
- from .core.download.downloader import main_download_multiple
6
-
7
-
8
- def main():
9
- parser = argparse.ArgumentParser(description="Download NBER papers.")
10
- parser.add_argument(
11
- "-d",
12
- "-D",
13
- "--download",
14
- dest="paper_ids",
15
- required=True,
16
- nargs='+',
17
- type=str,
18
- help="One or more NBER paper IDs (e.g., w1234 w5678).")
19
- parser.add_argument(
20
- "--save_path",
21
- type=str,
22
- default=os.path.expanduser("~/Documents/nber_paper"),
23
- help="The directory to save the downloaded paper. Defaults to ~/Documents/nber_paper.")
24
-
25
- args = parser.parse_args()
26
-
27
- asyncio.run(main_download_multiple(args.paper_ids, args.save_path))
File without changes
File without changes