Turn into intallable script package

This commit is contained in:
Marty Oehme 2025-08-12 12:32:00 +02:00
parent 0f3178d9bf
commit 7229ec11a5
Signed by: Marty
GPG key ID: 4E535BC19C61886E
4 changed files with 19 additions and 2 deletions

View file

@ -3,11 +3,21 @@ name = "nj-api"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
authors = [
{ name = "Marty Oehme", email = "contact@martyoeh.me" }
]
requires-python = ">=3.13"
dependencies = [
"requests>=2.32.4",
"typer>=0.16.0",
]
[project.scripts]
nightjet = "nj_api:main"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.pyright]
typeCheckingMode = "basic"

5
src/nj_api/__init__.py Normal file
View file

@ -0,0 +1,5 @@
from nj_api import main as cli
def main() -> None:
cli.app()

View file

@ -278,7 +278,9 @@ app = typer.Typer()
@app.command()
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, help="Departure station number. (default: Berlin Hbf)"
),

2
uv.lock generated
View file

@ -96,7 +96,7 @@ wheels = [
[[package]]
name = "nj-api"
version = "0.1.0"
source = { virtual = "." }
source = { editable = "." }
dependencies = [
{ name = "requests" },
{ name = "typer" },