diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..daf49e8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,8 @@ + +2022-12-11 +========== + +Added +----- + +- The first version of the package diff --git a/README.md b/README.md index e69de29..a170c5b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,28 @@ + +A simple package to make retry loops easier + +### Usage: + +```python +from retimer import Timer +import time + +timer = Timer(10) +while timer.not_expired: + # do something for 10 seconds + + if retry_doing_something: + time.sleep(.5) # good if something is a request to a server or cpu intensive + continue + if something_bad: + timer.explode() + + # all good so we break before timer expires + break + +if timer.expired: + print("Could not do something after tried for 10 seconds") +else: + print("Successfully did something after 10 seconds") + +``` diff --git a/pyproject.toml b/pyproject.toml index 848a3de..e3a6c6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,3 +15,6 @@ pytest = "^7.2.0" [build-system] requires = ["poetry-core"] build-backend = "poetry.core.masonry.api" + +[scriv] +format="md" \ No newline at end of file