Turn into intallable script package
This commit is contained in:
parent
0f3178d9bf
commit
7229ec11a5
4 changed files with 19 additions and 2 deletions
|
|
@ -3,11 +3,21 @@ name = "nj-api"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "Add your description here"
|
description = "Add your description here"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
authors = [
|
||||||
|
{ name = "Marty Oehme", email = "contact@martyoeh.me" }
|
||||||
|
]
|
||||||
requires-python = ">=3.13"
|
requires-python = ">=3.13"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"requests>=2.32.4",
|
"requests>=2.32.4",
|
||||||
"typer>=0.16.0",
|
"typer>=0.16.0",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[project.scripts]
|
||||||
|
nightjet = "nj_api:main"
|
||||||
|
|
||||||
|
[build-system]
|
||||||
|
requires = ["hatchling"]
|
||||||
|
build-backend = "hatchling.build"
|
||||||
|
|
||||||
[tool.pyright]
|
[tool.pyright]
|
||||||
typeCheckingMode = "basic"
|
typeCheckingMode = "basic"
|
||||||
|
|
|
||||||
5
src/nj_api/__init__.py
Normal file
5
src/nj_api/__init__.py
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
from nj_api import main as cli
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
|
cli.app()
|
||||||
|
|
@ -278,7 +278,9 @@ app = typer.Typer()
|
||||||
|
|
||||||
@app.command()
|
@app.command()
|
||||||
def main(
|
def main(
|
||||||
travel_date: Annotated[str, typer.Argument(help="Travel day to search from. (YYYY-MM-DD)")],
|
travel_date: Annotated[
|
||||||
|
str, typer.Argument(help="Travel day to search from. (YYYY-MM-DD)")
|
||||||
|
],
|
||||||
start_station: int = typer.Option(
|
start_station: int = typer.Option(
|
||||||
START_STATION, help="Departure station number. (default: Berlin Hbf)"
|
START_STATION, help="Departure station number. (default: Berlin Hbf)"
|
||||||
),
|
),
|
||||||
2
uv.lock
generated
2
uv.lock
generated
|
|
@ -96,7 +96,7 @@ wheels = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nj-api"
|
name = "nj-api"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = { virtual = "." }
|
source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "requests" },
|
{ name = "requests" },
|
||||||
{ name = "typer" },
|
{ name = "typer" },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue