setdoc 1.2.26__tar.gz → 1.3.1__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.
- {setdoc-1.2.26/src/setdoc.egg-info → setdoc-1.3.1}/PKG-INFO +2 -1
- setdoc-1.3.1/docs/v1.3.rst +124 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/pyproject.toml +2 -1
- {setdoc-1.2.26 → setdoc-1.3.1/src/setdoc.egg-info}/PKG-INFO +2 -1
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc.egg-info/SOURCES.txt +1 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/LICENSE.txt +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/MANIFEST.in +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/README.rst +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/docs/v1.0.rst +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/docs/v1.1.rst +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/docs/v1.2.rst +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/setup.cfg +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/__init__.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/_utils/__init__.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/_utils/cfg.toml +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/core/SetDoc.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/core/__init__.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/core/basic.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/core/getbasicdoc.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/py.typed +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/tests/__init__.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc/tests/test_core.py +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc.egg-info/dependency_links.txt +0 -0
- {setdoc-1.2.26 → setdoc-1.3.1}/src/setdoc.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: setdoc
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: This project helps to set the doc string.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,6 +14,7 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Classifier: Programming Language :: Python
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Typing :: Typed
|
|
17
18
|
Requires-Python: >=3.11
|
|
18
19
|
Description-Content-Type: text/x-rst
|
|
19
20
|
License-File: LICENSE.txt
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
Introduction
|
|
2
|
+
------------
|
|
3
|
+
|
|
4
|
+
This project helps to set the doc string.
|
|
5
|
+
|
|
6
|
+
Installation
|
|
7
|
+
------------
|
|
8
|
+
|
|
9
|
+
To install ``setdoc``, you can use ``pip``.
|
|
10
|
+
Open your terminal and run:
|
|
11
|
+
|
|
12
|
+
.. code-block:: shell
|
|
13
|
+
|
|
14
|
+
pip install setdoc
|
|
15
|
+
|
|
16
|
+
Typing
|
|
17
|
+
------
|
|
18
|
+
|
|
19
|
+
The typing conforms (not strictly) to ``mypy``.
|
|
20
|
+
|
|
21
|
+
.. container:: versionadded
|
|
22
|
+
|
|
23
|
+
**Added in version 1.3.**
|
|
24
|
+
|
|
25
|
+
Features
|
|
26
|
+
--------
|
|
27
|
+
|
|
28
|
+
``class setdoc.SetDoc(doc: Any)``
|
|
29
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
30
|
+
|
|
31
|
+
The instances of this ``dataclass`` work as decorators
|
|
32
|
+
that set the docstring of the decorated ``target`` to ``doc``.
|
|
33
|
+
|
|
34
|
+
Usage:
|
|
35
|
+
|
|
36
|
+
.. code-block:: python
|
|
37
|
+
|
|
38
|
+
from typing import *
|
|
39
|
+
from setdoc import SetDoc
|
|
40
|
+
|
|
41
|
+
# Create a setdoc instance with the desired docstring
|
|
42
|
+
doc_updater: SetDoc
|
|
43
|
+
doc_updater = SetDoc("This function adds two numbers.")
|
|
44
|
+
|
|
45
|
+
# Apply it to a target function
|
|
46
|
+
@doc_updater
|
|
47
|
+
def add(a: int, b: int) -> int:
|
|
48
|
+
return a + b
|
|
49
|
+
|
|
50
|
+
# The function now has an updated docstring
|
|
51
|
+
print(add.__doc__)
|
|
52
|
+
# Output: This function adds two numbers.
|
|
53
|
+
|
|
54
|
+
# Apply it directly to another target function
|
|
55
|
+
@SetDoc("This function multiplies two numbers.")
|
|
56
|
+
def mul(a: int, b: int) -> int:
|
|
57
|
+
return a * b
|
|
58
|
+
|
|
59
|
+
# The function now has an updated docstring
|
|
60
|
+
print(mul.__doc__)
|
|
61
|
+
# Output: This function multiplies two numbers.
|
|
62
|
+
|
|
63
|
+
``__call__(target: Any) -> Any``
|
|
64
|
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
65
|
+
|
|
66
|
+
This magic method implements calling the current instance.
|
|
67
|
+
It sets ``target.__doc__`` to ``doc``.
|
|
68
|
+
|
|
69
|
+
``doc: Any``
|
|
70
|
+
^^^^^^^^^^^^
|
|
71
|
+
|
|
72
|
+
This value that is used for ``__doc__``.
|
|
73
|
+
|
|
74
|
+
``setdoc.basic(value: Any) -> Any``
|
|
75
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
76
|
+
|
|
77
|
+
.. container:: versionadded
|
|
78
|
+
|
|
79
|
+
**Added in version 1.1.**
|
|
80
|
+
|
|
81
|
+
``setdoc.getbasicdoc(name: str) -> str``
|
|
82
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
83
|
+
|
|
84
|
+
.. container:: versionadded
|
|
85
|
+
|
|
86
|
+
**Added in version 1.2.**
|
|
87
|
+
|
|
88
|
+
``setdoc.setdoc = setdoc.SetDoc``
|
|
89
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
90
|
+
|
|
91
|
+
This module variable is alias for ``SetDoc`` included for legacy.
|
|
92
|
+
|
|
93
|
+
``setdoc.tests.test() -> unittest.TextTestResult``
|
|
94
|
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
95
|
+
|
|
96
|
+
This project can be tested through its test function.
|
|
97
|
+
|
|
98
|
+
.. code-block:: python
|
|
99
|
+
|
|
100
|
+
import setdoc.tests
|
|
101
|
+
setdoc.tests.test()
|
|
102
|
+
|
|
103
|
+
License
|
|
104
|
+
-------
|
|
105
|
+
|
|
106
|
+
This project is licensed under the MIT License.
|
|
107
|
+
|
|
108
|
+
Links
|
|
109
|
+
-----
|
|
110
|
+
|
|
111
|
+
- Download: https://pypi.org/project/setdoc/#files
|
|
112
|
+
- Index: https://pypi.org/project/setdoc/
|
|
113
|
+
- Source: https://github.com/johannes-programming/setdoc/
|
|
114
|
+
- Website: https://setdoc.johannes-programming.online/
|
|
115
|
+
|
|
116
|
+
Impressum
|
|
117
|
+
---------
|
|
118
|
+
|
|
119
|
+
**Johannes Programming**
|
|
120
|
+
|
|
121
|
+
- Name: Johannes
|
|
122
|
+
- Email: johannes.programming@gmail.com
|
|
123
|
+
- Homepage: https://www.johannes-programming.online/
|
|
124
|
+
- Gravatar: https://www.johannes-programming.fyi/
|
|
@@ -15,6 +15,7 @@ classifiers = [
|
|
|
15
15
|
"Programming Language :: Python",
|
|
16
16
|
"Programming Language :: Python :: 3",
|
|
17
17
|
"Programming Language :: Python :: 3 :: Only",
|
|
18
|
+
"Typing :: Typed",
|
|
18
19
|
]
|
|
19
20
|
dependencies = []
|
|
20
21
|
description = "This project helps to set the doc string."
|
|
@@ -26,7 +27,7 @@ license-files = [
|
|
|
26
27
|
name = "setdoc"
|
|
27
28
|
readme = "README.rst"
|
|
28
29
|
requires-python = ">=3.11"
|
|
29
|
-
version = "1.
|
|
30
|
+
version = "1.3.1"
|
|
30
31
|
|
|
31
32
|
[project.urls]
|
|
32
33
|
Download = "https://pypi.org/project/setdoc/#files"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: setdoc
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: This project helps to set the doc string.
|
|
5
5
|
Author-email: Johannes <johannes.programming@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -14,6 +14,7 @@ Classifier: Operating System :: OS Independent
|
|
|
14
14
|
Classifier: Programming Language :: Python
|
|
15
15
|
Classifier: Programming Language :: Python :: 3
|
|
16
16
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Typing :: Typed
|
|
17
18
|
Requires-Python: >=3.11
|
|
18
19
|
Description-Content-Type: text/x-rst
|
|
19
20
|
License-File: LICENSE.txt
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|