python-disposable 0.0.4__tar.gz → 0.0.12__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-disposable
3
- Version: 0.0.4
3
+ Version: 0.0.12
4
4
  Summary: Check if an email address or domain belongs to a disposable/temporary email service. Bundles 72k+ domains from disposable/disposable-email-domains.
5
5
  Project-URL: Homepage, https://github.com/pescheckit/python-disposable
6
6
  Project-URL: Source, https://github.com/pescheckit/python-disposable
@@ -7,17 +7,23 @@ _domains: Optional[frozenset[str]] = None
7
7
  _domains_strict: Optional[frozenset[str]] = None
8
8
 
9
9
 
10
+ def _load_custom() -> frozenset[str]:
11
+ data = files("disposable_email").joinpath("domains_custom.txt").read_text(encoding="utf-8")
12
+ return frozenset(line.strip().lower() for line in data.splitlines() if line.strip())
13
+
14
+
10
15
  def _load(strict: bool = False) -> frozenset[str]:
11
16
  global _domains, _domains_strict
17
+ custom = _load_custom()
12
18
  if strict:
13
19
  if _domains_strict is None:
14
20
  data = files("disposable_email").joinpath("domains_strict.txt").read_text(encoding="utf-8")
15
- _domains_strict = frozenset(line.strip().lower() for line in data.splitlines() if line.strip())
21
+ _domains_strict = frozenset(line.strip().lower() for line in data.splitlines() if line.strip()) | custom
16
22
  return _domains_strict
17
23
  else:
18
24
  if _domains is None:
19
25
  data = files("disposable_email").joinpath("domains.txt").read_text(encoding="utf-8")
20
- _domains = frozenset(line.strip().lower() for line in data.splitlines() if line.strip())
26
+ _domains = frozenset(line.strip().lower() for line in data.splitlines() if line.strip()) | custom
21
27
  return _domains
22
28
 
23
29
 
@@ -0,0 +1,24 @@
1
+ # file generated by vcs-versioning
2
+ # don't change, don't track in version control
3
+ from __future__ import annotations
4
+
5
+ __all__ = [
6
+ "__version__",
7
+ "__version_tuple__",
8
+ "version",
9
+ "version_tuple",
10
+ "__commit_id__",
11
+ "commit_id",
12
+ ]
13
+
14
+ version: str
15
+ __version__: str
16
+ __version_tuple__: tuple[int | str, ...]
17
+ version_tuple: tuple[int | str, ...]
18
+ commit_id: str | None
19
+ __commit_id__: str | None
20
+
21
+ __version__ = version = '0.0.12'
22
+ __version_tuple__ = version_tuple = (0, 0, 12)
23
+
24
+ __commit_id__ = commit_id = None