diff --git a/CHANGELOG.md b/CHANGELOG.md index e31ab99..bf94ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ Changelog =================================== +0.1.4 (2022-09-11) +------------------- + +- Improvement in output string. +- Documentation. + + 0.1.3 (2022-09-11) ------------------- diff --git a/README.md b/README.md index 0b6c327..b052158 100644 --- a/README.md +++ b/README.md @@ -70,11 +70,7 @@ log = MongoLog.get(uuid=UUID("")) assert log.status == "SUCCESS" ``` - -Settings ----------- - -There are some possible ways to pass settings to the updater. +There are some possible ways to pass backend settings to the updater. This is the priority. 1. Passing settings as parameters when creating a `ProgressUpdater` object. @@ -101,6 +97,14 @@ export PU__SQL_DSN=postgresql+psycopg2://user:pass@postgres:5432/db export PU__SQL_TABLE=logs ``` +And then when creating a `ProgressUpdater` object, the backend will be +automatically configured. +```python +from progress_updater import ProgressUpdater + +with ProgressUpdater(task_name="My Task") as updater: + pass +``` Documentation -------------- diff --git a/docs/index.rst b/docs/index.rst index e3874d5..1b242e2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,6 @@ Welcome to progress-updater' documentation! ============================================= - Writing the progress of a task to a backend! Installation @@ -61,7 +60,7 @@ a backend. There are three backends available to save our logs. 2. Redis. 3. SQL. -In you console:: +In you console, for example:: from progress_updater.backends import MongoLog from uuid import UUID @@ -70,10 +69,7 @@ In you console:: assert log.status == "SUCCESS" -Settings ----------- - -There are some possible ways to pass settings to the updater. +There are some possible ways to pass backend settings to the updater. This is the priority. 1. Passing settings as parameters when creating a `ProgressUpdater` object:: @@ -96,6 +92,14 @@ The `PU__` prefix indicates that it belongs to `ProgressUpdater`:: export PU__SQL_DSN=postgresql+psycopg2://user:pass@postgres:5432/db export PU__SQL_TABLE=logs +And then when creating a `ProgressUpdater` object, the backend will be +automatically configured:: + + from progress_updater import ProgressUpdater + + with ProgressUpdater(task_name="My Task") as updater: + pass + .. toctree:: :maxdepth: 2 diff --git a/pyproject.toml b/pyproject.toml index 0431983..33c9dcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "progress_updater" -version = "0.1.3" +version = "0.1.4" description = "Progress Updater" readme = "README.md" license = "LICENSE"