papertrail 0.1.0__py3-none-any.whl → 0.1.1__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.
@@ -111,11 +111,77 @@ def example(fn: Callable, *args: tuple[Any, ...], **kwargs: dict[str, Any]) -> E
111
111
 
112
112
  Papertrail examples:
113
113
 
114
- >>> func_b(3, 4) == -1
114
+ >>> func_b(2, 2) == 0
115
+ True
116
+
117
+ >>> func_b(2, b=3) == -1
115
118
  True
116
119
  ::
117
120
  \"\"\"
118
121
  return a - b
122
+
123
+ For more exciting inputs and arguments the docstrings code will be formatted with black:
124
+
125
+ .. code-block:: python
126
+
127
+ def enum_keys(enum_dict: dict[int, str]) -> list[str]:
128
+ \"\"\"Multiply the values by the key amount.\"\"\"
129
+ return [i * a for i, a in enum_dict.items()]
130
+
131
+
132
+ Imagine this test:
133
+
134
+ .. code-block:: python
135
+
136
+ import string
137
+
138
+ import pytest
139
+ from mock_src.mod_b import enum_keys
140
+
141
+ from papertrail import example
142
+
143
+
144
+ @pytest.mark.parametrize(
145
+ ("args", "kwargs", "expected_result"),
146
+ [
147
+ pytest.param(
148
+ (dict(enumerate(string.ascii_lowercase[:5])),),
149
+ {},
150
+ [
151
+ "",
152
+ "b",
153
+ "cc",
154
+ "ddd",
155
+ "eeee",
156
+ ],
157
+ ),
158
+ ],
159
+ )
160
+ def test_enum_keys(args, kwargs, expected_result):
161
+ assert example(enum_keys, *args, **kwargs) == expected_result
162
+
163
+
164
+ This is the result (Hopefully it clearly suggests what the function should do):
165
+
166
+ .. code-block:: python
167
+
168
+ def enum_keys(enum_dict: dict[int, str]) -> list[str]:
169
+ \"\"\"Multiply the values by the key amount.
170
+
171
+ Papertrail examples:
172
+
173
+ >>> enum_keys({0: "a", 1: "b", 2: "c", 3: "d", 4: "e"}) == [
174
+ ... "",
175
+ ... "b",
176
+ ... "cc",
177
+ ... "ddd",
178
+ ... "eeee",
179
+ ... ]
180
+ True
181
+ ::.
182
+ \"\"\"
183
+ return [i * a for i, a in enum_dict.items()]
184
+
119
185
  """
120
186
  value = fn(*args, **kwargs)
121
187
  return Example(fn, args, kwargs, value, recorder=_RECORDER)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: papertrail
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Add your description here
5
5
  Author: ed cuss
6
6
  Author-email: ed cuss <edcussmusic@gmail.com>
@@ -13,6 +13,11 @@ Requires-Python: >=3.11
13
13
  Description-Content-Type: text/markdown
14
14
 
15
15
  # papertrail
16
+ [![PyPI Downloads](https://static.pepy.tech/personalized-badge/papertrail?period=total&units=INTERNATIONAL_SYSTEM&left_color=BLACK&right_color=BLUE&left_text=downloads)](https://pepy.tech/projects/danom)
17
+
18
+ ## API Reference
19
+
20
+ [papertrail API docs](https://second-ed.github.io/papertrail/)
16
21
 
17
22
  ### Motivation
18
23
  - Documentation can get out of date quickly
@@ -86,7 +91,10 @@ def func_b(a: float, b: float) -> float:
86
91
 
87
92
  Papertrail examples:
88
93
 
89
- >>> func_b(3, 4) == -1
94
+ >>> func_b(2, 2) == 0
95
+ True
96
+
97
+ >>> func_b(2, b=3) == -1
90
98
  True
91
99
  ::
92
100
  """
@@ -99,9 +107,6 @@ def func_b(a: float, b: float) -> float:
99
107
  │ └── workflows
100
108
  │ ├── ci_tests.yaml
101
109
  │ └── publish.yaml
102
- ├── docs
103
- │ └── source
104
- │ └── conf.py
105
110
  ├── src
106
111
  │ └── papertrail
107
112
  │ ├── adapters
@@ -4,7 +4,7 @@ papertrail/adapters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
4
4
  papertrail/adapters/io_funcs.py,sha256=nDS7EcodP7gEpR5Yse3apvowP45DZG6_95145vroO5s,1089
5
5
  papertrail/core/__init__.py,sha256=gO2KeYEZQwE2_YbBuY7IFAILMz7g-FgI8S5avT0ZlIQ,146
6
6
  papertrail/core/collection/__init__.py,sha256=U9jT8Gpk7dqnCJbwbvezYFfyxIam04zLKa9n_ortqh8,244
7
- papertrail/core/collection/example.py,sha256=FbgKDCCODO7eKqTpo86n9M7qtFSSUF1ym7eS3585oqE,3137
7
+ papertrail/core/collection/example.py,sha256=EpzLyi4W2MMTUFG5OBNDs83xuR0eKhXc5QblW_7lIZY,4917
8
8
  papertrail/core/collection/record.py,sha256=7cbq9I9AvmtOAONL3hL4SKIccG_Jo1rZ00ugQ2MKX5I,348
9
9
  papertrail/core/collection/recorder.py,sha256=O9ZMm5hUi7G1vmjCjTwgs5M7FxtjoMVGJCtS_lWWpQE,1204
10
10
  papertrail/core/logger.py,sha256=GdyteNTrz_ywmtHpTqGwX6ATDH92kl-do_0wZGNAQTE,985
@@ -12,6 +12,6 @@ papertrail/core/transformation/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
12
12
  papertrail/core/transformation/ast_editing.py,sha256=QK9VKR8wQCgWDvfA-DJrMvoQQrSP_0Ay7ZT83CIObmA,2373
13
13
  papertrail/core/transformation/format_examples.py,sha256=0vHPihq5dpOrmwE3bywQrwZWr1HwKnGSqvq7YmEFwdg,1398
14
14
  papertrail/core/transformation/transform.py,sha256=qlcoiRH5WGW22qetdPfslKTOKn4wYa_msXIr4kmwAXU,956
15
- papertrail-0.1.0.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
16
- papertrail-0.1.0.dist-info/METADATA,sha256=DgdHqApDYmcGiu1cWA0Ns3n5vNFrkIkpIsR801Sedmo,4717
17
- papertrail-0.1.0.dist-info/RECORD,,
15
+ papertrail-0.1.1.dist-info/WHEEL,sha256=eh7sammvW2TypMMMGKgsM83HyA_3qQ5Lgg3ynoecH3M,79
16
+ papertrail-0.1.1.dist-info/METADATA,sha256=P68uA2YsewYZHBPJqRmHhuwZ_jffG6OJrMEv6EDijtw,4983
17
+ papertrail-0.1.1.dist-info/RECORD,,