Skip to content

Commit

Permalink
add cli command for generating datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishokamp committed Apr 15, 2024
1 parent 0244b45 commit ef1e7cf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.5.0
0.6.0
14 changes: 14 additions & 0 deletions news_signals/cli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys
import subprocess
import logging

from news_signals.log import create_logger


logger = create_logger(__name__, level=logging.INFO)


def generate_dataset():
logger.info("Generating dataset via cli command `generate-dataset`")
print(f"Args: {sys.argv[1:]}")
sys.exit(subprocess.call([sys.executable, 'bin/generate_dataset.py'] + sys.argv[1:]))
6 changes: 5 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@
install_requires=INSTALL_REQUIRES,
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
readme="README.md",
packages=["news_signals"],
data_files=["LICENSE", "VERSION", "README.md"],
entry_points={
'console_scripts': [
'generate-dataset=news_signals.cli:generate_dataset'
]
},
include_package_data=True
)

0 comments on commit ef1e7cf

Please sign in to comment.