Skip to content

A Smart, Automatic, Fast and Lightweight Web Scraper for Python

feat: add forall and unique methods

cthulhu-irl241e48f574f8
diff --git a/autoscraper/utils.py b/autoscraper/utils.py
new file mode 100644
index 0000000..f3bde54
--- /dev/null
+++ b/autoscraper/utils.py
@@ -0,0 +1,14 @@
+def unique(lst):
+ unique_lst = []
+ for item in lst:
+ if item not in unique_lst:
+ unique_lst.append(item)
+
+ return unique_lst
+
+def forall(fn, lst):
+ for item in lst:
+ if not fn(lst):
+ return False
+
+ return True