From b0ca6e525f72b12f2bb3c484b60682dcaa41474d Mon Sep 17 00:00:00 2001 From: Nikita Reznikov Date: Tue, 11 Jun 2024 23:57:25 +0300 Subject: [PATCH] Add digits method in module rand --- eventum_plugins/event/jinja_modules/rand.py | 7 +++++++ pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/eventum_plugins/event/jinja_modules/rand.py b/eventum_plugins/event/jinja_modules/rand.py index e221c75..85649d2 100644 --- a/eventum_plugins/event/jinja_modules/rand.py +++ b/eventum_plugins/event/jinja_modules/rand.py @@ -79,6 +79,13 @@ def letters(size: int) -> str: """ return ''.join(random.choices(ascii_letters, k=size)) + @staticmethod + def digits(size: int) -> str: + """Return string of specified `size` that contains random digits + characters. + """ + return ''.join(random.choices(digits, k=size)) + @staticmethod def punctuation(size: int) -> str: """Return string of specified `size` that contains random ASCII diff --git a/pyproject.toml b/pyproject.toml index 5028762..bb4bdd9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "eventum-plugins" -version = "1.0.6" +version = "1.0.7" description = "Plugins for Eventum" license = "Apache-2.0" authors = ["Nikita Reznikov "]