this post was submitted on 23 Aug 2023
6 points (100.0% liked)

Python Dev

1 readers
1 users here now

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Traitlets

Click is a library to make a CLI - e.g.

"""echo.py"""

@click.command()
@click.arg("foo")
def echo(foo):
  print(foo)

if __main__: 
  echo()
python ./echo.py "Hello World"

vs Traitlets looks like a (really cool) type validation library? Pydantic is similar

[โ€“] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Traitlets also supports subcommands, command line arguments, etc. At its heart though, it's more of a configuration library.

(I'm very much still a novice coder so definitely take that into account lol!)

https://traitlets.readthedocs.io/en/stable/config.html#command-line-arguments