v1.1.0 - Ability to run arbitrary files, added warnings, added debug logging
Files can now be run without any integration with arguably
. Simply call it like this: python3 -m arguably file_to_run.py
. You'll get a help message with all callable functions. This includes staticmethod
s and classmethod
s for classes in the file. As an example:
# test_script.py
def test(name: str, age: int) -> None:
"""
just a test
:param name: the name
:param age: the age
"""
print(f"name: {name}, age+1: {age + 1}")
class Foo:
def __init__(self, bar: int):
"""
foo!
:param bar: bar!
"""
print(f"{type(self).__name__} initialized with {bar}")
@staticmethod
def sm(name: str) -> None:
"""
staticmethod test func
:param name: the name
"""
print(f"{name}")
@classmethod
def cm(cls, name: str = "testname") -> None:
"""classmethod test func"""
print(f"{cls}, {name}")
def normal(self, foo: int) -> None:
"""a normal method, should not appear"""
print(f"{self}, foo+1: {foo+1}")
Run it like this:
user@machine:~$ python3 -m arguably test_script.py
usage: test_script [-h] command ...
positional arguments:
command
test just a test
foo foo!
foo.sm staticmethod test func
foo.cm classmethod test func
options:
-h, --help show this help message and exit