randfacts 0.22.1__py3-none-any.whl → 0.23.0__py3-none-any.whl
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.
- randfacts/__init__.py +0 -13
- randfacts/randfacts.py +9 -7
- {randfacts-0.22.1.dist-info → randfacts-0.23.0.dist-info}/METADATA +7 -3
- randfacts-0.23.0.dist-info/RECORD +10 -0
- {randfacts-0.22.1.dist-info → randfacts-0.23.0.dist-info}/WHEEL +1 -1
- randfacts-0.22.1.dist-info/RECORD +0 -10
- {randfacts-0.22.1.dist-info → randfacts-0.23.0.dist-info}/entry_points.txt +0 -0
- {randfacts-0.22.1.dist-info → randfacts-0.23.0.dist-info/licenses}/LICENSE +0 -0
randfacts/__init__.py
CHANGED
|
@@ -40,8 +40,6 @@ CLI Examples:
|
|
|
40
40
|
|
|
41
41
|
"""
|
|
42
42
|
|
|
43
|
-
import warnings as _warnings
|
|
44
|
-
|
|
45
43
|
from randfacts.randfacts import (
|
|
46
44
|
__version__,
|
|
47
45
|
all_facts,
|
|
@@ -57,14 +55,3 @@ __all__ = [
|
|
|
57
55
|
"safe_facts",
|
|
58
56
|
"unsafe_facts",
|
|
59
57
|
]
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
# Deprecated methods
|
|
63
|
-
def getFact(filter_enabled: bool = True, only_unsafe: bool = False) -> str: # noqa: N802
|
|
64
|
-
"""This method is deprecated. Please use get_fact."""
|
|
65
|
-
_warnings.warn(
|
|
66
|
-
"getFact is deprecated. Please use get_fact",
|
|
67
|
-
DeprecationWarning,
|
|
68
|
-
stacklevel=2,
|
|
69
|
-
)
|
|
70
|
-
return get_fact(filter_enabled, only_unsafe) # noqa: DOC201
|
randfacts/randfacts.py
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"""Contains the core functionality of randfacts."""
|
|
2
2
|
|
|
3
3
|
import argparse
|
|
4
|
-
import
|
|
5
|
-
import importlib.metadata
|
|
4
|
+
import sys
|
|
6
5
|
from pathlib import Path
|
|
7
6
|
from random import choice
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
if sys.version_info >= (3, 8): # noqa: UP036
|
|
9
|
+
from importlib import metadata
|
|
10
|
+
else:
|
|
11
|
+
import importlib_metadata as metadata
|
|
12
|
+
|
|
13
|
+
__version__: str = metadata.version("randfacts")
|
|
10
14
|
|
|
11
|
-
|
|
12
|
-
with contextlib.suppress(Exception):
|
|
13
|
-
__version__: str = importlib.metadata.version("randfacts")
|
|
15
|
+
dir_path = Path(__file__).resolve().parent
|
|
14
16
|
|
|
15
17
|
with (dir_path / "safe.txt").open(encoding="utf-8") as f:
|
|
16
18
|
safe_facts = [fact.rstrip("\r\n ") for fact in f if fact.rstrip("\r\n ")]
|
|
@@ -42,7 +44,7 @@ def get_fact(filter_enabled: bool = True, only_unsafe: bool = False) -> str:
|
|
|
42
44
|
"""
|
|
43
45
|
if only_unsafe:
|
|
44
46
|
return choice(unsafe_facts)
|
|
45
|
-
if filter_enabled
|
|
47
|
+
if not filter_enabled:
|
|
46
48
|
return choice(all_facts)
|
|
47
49
|
return choice(safe_facts)
|
|
48
50
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: randfacts
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.23.0
|
|
4
4
|
Summary: Package to generate random facts
|
|
5
|
-
Home-page: https://tabulate.tech/software/randfacts/
|
|
6
5
|
License: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
7
|
Author: TabulateJarl8
|
|
8
8
|
Author-email: tabulatejarl8@gmail.com
|
|
9
9
|
Requires-Python: >=3.6,<4.0
|
|
@@ -21,7 +21,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
25
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
|
+
Requires-Dist: importlib-metadata (>=1.4,<2.0) ; python_version < "3.8"
|
|
27
|
+
Project-URL: Homepage, https://tabulate.tech/software/randfacts/
|
|
25
28
|
Project-URL: Repository, https://github.com/TabulateJarl8/randfacts
|
|
26
29
|
Description-Content-Type: text/markdown
|
|
27
30
|
|
|
@@ -38,6 +41,7 @@ Description-Content-Type: text/markdown
|
|
|
38
41
|
<a href="https://github.com/TabulateJarl8/randfacts/actions/workflows/main.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/TabulateJarl8/randfacts/main.yml?branch=master&label=Duplicate%20Facts%20Test" /></a>
|
|
39
42
|
<a href="https://github.com/TabulateJarl8"><img alt="GitHub followers" src="https://img.shields.io/github/followers/TabulateJarl8?style=social" /></a>
|
|
40
43
|
<a href="https://github.com/TabulateJarl8/randfacts"><img alt="GitHub Repo stars" src="https://img.shields.io/github/stars/TabulateJarl8/randfacts?style=social" /></a>
|
|
44
|
+
<a href="https://codecov.io/gh/TabulateJarl8/randfacts"><img src="https://codecov.io/gh/TabulateJarl8/randfacts/graph/badge.svg?token=HUQJ88VXLQ"/></a>
|
|
41
45
|
<br>
|
|
42
46
|
<a href="https://ko-fi.com/L4L3L7IO2"><img alt="Kofi Badge" src="https://ko-fi.com/img/githubbutton_sm.svg" /></a>
|
|
43
47
|
</p>
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
randfacts/__init__.py,sha256=Kpg3P_cgJcyYAMQhYBdOd5AUEoEm-piAGlx8IQjnt-0,1249
|
|
2
|
+
randfacts/__main__.py,sha256=sH6dc3zI2TSF12PVQTp_mlCPgKrF-7lJd_8kQ8hZ2S0,97
|
|
3
|
+
randfacts/randfacts.py,sha256=63Tx4AiB-ZVihw5DQe5T80DgYKvwOTUP6XebPriQ7e0,2218
|
|
4
|
+
randfacts/safe.txt,sha256=8t2fLQayINFQLnEqIrGoJ57YCJeqL4WQpM2kMWR34eg,634078
|
|
5
|
+
randfacts/unsafe.txt,sha256=6CO4QTQ7YIqkDyyS9cbV1-eqs8B0TYxzDyab4lUGGHQ,10415
|
|
6
|
+
randfacts-0.23.0.dist-info/METADATA,sha256=2vO_gQ6egWrXvPDxvz00pqxaXfkKfFO2bWN-Mj0p5x4,5048
|
|
7
|
+
randfacts-0.23.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
8
|
+
randfacts-0.23.0.dist-info/entry_points.txt,sha256=YPadKZhBZjJaNq_Mfkaj7HJgs63rf3rl_7pj5Tf8WY8,65
|
|
9
|
+
randfacts-0.23.0.dist-info/licenses/LICENSE,sha256=Pw9YWaR5pSAfnfuabUSytyJGj2Wy4G7Zw1EdldX9KGU,1088
|
|
10
|
+
randfacts-0.23.0.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
randfacts/__init__.py,sha256=AIc-PGGpuk2zNraanv5kum3JyWNV2ba3HSzPcX56PYs,1615
|
|
2
|
-
randfacts/__main__.py,sha256=sH6dc3zI2TSF12PVQTp_mlCPgKrF-7lJd_8kQ8hZ2S0,97
|
|
3
|
-
randfacts/randfacts.py,sha256=KvK5BVw4qykbz5X6Lb3YqAXimH-7YtlXA3lWyHJJHcw,2197
|
|
4
|
-
randfacts/safe.txt,sha256=8t2fLQayINFQLnEqIrGoJ57YCJeqL4WQpM2kMWR34eg,634078
|
|
5
|
-
randfacts/unsafe.txt,sha256=6CO4QTQ7YIqkDyyS9cbV1-eqs8B0TYxzDyab4lUGGHQ,10415
|
|
6
|
-
randfacts-0.22.1.dist-info/LICENSE,sha256=Pw9YWaR5pSAfnfuabUSytyJGj2Wy4G7Zw1EdldX9KGU,1088
|
|
7
|
-
randfacts-0.22.1.dist-info/METADATA,sha256=wX25iQvCxHcoJ4gmJlvMjwSZVGkxYNYUCBIAACybzTk,4738
|
|
8
|
-
randfacts-0.22.1.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
9
|
-
randfacts-0.22.1.dist-info/entry_points.txt,sha256=YPadKZhBZjJaNq_Mfkaj7HJgs63rf3rl_7pj5Tf8WY8,65
|
|
10
|
-
randfacts-0.22.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|