ipython-postfix-completion 0.1.0__tar.gz → 0.1.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.
Files changed (17) hide show
  1. ipython_postfix_completion-0.1.1/PKG-INFO +218 -0
  2. ipython_postfix_completion-0.1.1/README.md +190 -0
  3. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/ipython_postfix_completion/__init__.py +2 -0
  4. ipython_postfix_completion-0.1.1/ipython_postfix_completion.egg-info/PKG-INFO +218 -0
  5. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/pyproject.toml +1 -1
  6. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/tests/test_postfix_completion.py +2 -0
  7. ipython_postfix_completion-0.1.0/PKG-INFO +0 -150
  8. ipython_postfix_completion-0.1.0/README.md +0 -122
  9. ipython_postfix_completion-0.1.0/ipython_postfix_completion.egg-info/PKG-INFO +0 -150
  10. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/LICENSE +0 -0
  11. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/MANIFEST.in +0 -0
  12. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/ipython_postfix_completion.egg-info/SOURCES.txt +0 -0
  13. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/ipython_postfix_completion.egg-info/dependency_links.txt +0 -0
  14. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/ipython_postfix_completion.egg-info/requires.txt +0 -0
  15. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/ipython_postfix_completion.egg-info/top_level.txt +0 -0
  16. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/setup.cfg +0 -0
  17. {ipython_postfix_completion-0.1.0 → ipython_postfix_completion-0.1.1}/tests/conftest.py +0 -0
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: ipython-postfix-completion
3
+ Version: 0.1.1
4
+ Summary: Configurable postfix completion extension for IPython.
5
+ Author: IPython Postfix Completion Contributors
6
+ License-Expression: BSD-3-Clause
7
+ Keywords: ipython,completion,postfix,extension
8
+ Classifier: Framework :: IPython
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: ipython>=9.0
20
+ Requires-Dist: traitlets>=5.13
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest>=7; extra == "test"
23
+ Provides-Extra: dev
24
+ Requires-Dist: build; extra == "dev"
25
+ Requires-Dist: twine; extra == "dev"
26
+ Requires-Dist: ipython-postfix-completion[test]; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # IPython Postfix Completion
30
+
31
+ Configurable postfix completion extension for IPython.
32
+
33
+ Package on PyPI: `ipython-postfix-completion`
34
+
35
+ ## Install
36
+
37
+ Install into the current Python environment with `uv`:
38
+
39
+ ```bash
40
+ uvx --with ipython-postfix-completion ipython
41
+ ```
42
+
43
+ Install into the current ipython environment with `uv`:
44
+
45
+ ```bash
46
+ uv tool install ipython --with ipython-postfix-completion
47
+ ```
48
+
49
+ ## Load
50
+
51
+ Inside IPython:
52
+
53
+ ```python
54
+ %load_ext ipython_postfix_completion
55
+ ```
56
+
57
+ To load it automatically, add this to `ipython_config.py`:
58
+
59
+ ```python
60
+ c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
61
+ ```
62
+
63
+ ## Quick Example: Add a `for` Template
64
+
65
+ Add a template for the current IPython session:
66
+
67
+ ```python
68
+ %postfix_template add for "for item in {expr}:\n{indent} "
69
+ ```
70
+
71
+ Use it:
72
+
73
+ ```python
74
+ items.for<Tab>
75
+ ```
76
+
77
+ It expands to:
78
+
79
+ ```python
80
+ for item in items:
81
+
82
+ ```
83
+
84
+ Runtime templates only affect the current IPython session. Put templates in
85
+ `ipython_config.py` if you want them to persist.
86
+
87
+ ## Runtime Magic
88
+
89
+ List effective templates:
90
+
91
+ ```python
92
+ %postfix_template list
93
+ ```
94
+
95
+ Add or override a template for the current session:
96
+
97
+ ```python
98
+ %postfix_template add debug "print({expr}=)"
99
+ %postfix_template add forin "for item in {expr}:\n{indent} "
100
+ ```
101
+
102
+ Disable a template for the current session:
103
+
104
+ ```python
105
+ %postfix_template remove tuple
106
+ ```
107
+
108
+ Reset one runtime change:
109
+
110
+ ```python
111
+ %postfix_template reset forin
112
+ ```
113
+
114
+ Reset all runtime changes:
115
+
116
+ ```python
117
+ %postfix_template reset --all
118
+ ```
119
+
120
+ ## Persistent Config
121
+
122
+ Add persistent templates in `ipython_config.py`:
123
+
124
+ ```python
125
+ c.PostfixCompletionConfig.templates = {
126
+ "debug": "print({expr}=)",
127
+ "forin": "for item in {expr}:\n{indent} ",
128
+ }
129
+
130
+ c.PostfixCompletionConfig.disabled_templates = ["tuple"]
131
+ ```
132
+
133
+ Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
134
+
135
+ Templates must include `{expr}` and may also use `{indent}`. No other template
136
+ fields are allowed.
137
+
138
+ ## Built-in Templates
139
+
140
+ Default templates:
141
+
142
+ | Name | Expansion |
143
+ | --- | --- |
144
+ | `print` | `print({expr})` |
145
+ | `len` | `len({expr})` |
146
+ | `not` | `not {expr}` |
147
+ | `par` | `({expr})` |
148
+ | `var` | `{expr} = ` |
149
+ | `await` | `await {expr}` |
150
+ | `return` | `return {expr}` |
151
+ | `if` | `if {expr}:\n{indent} ` |
152
+ | `while` | `while {expr}:\n{indent} ` |
153
+ | `raise` | `raise {expr}` |
154
+ | `yield` | `yield {expr}` |
155
+ | `str` | `str({expr})` |
156
+ | `list` | `list({expr})` |
157
+ | `set` | `set({expr})` |
158
+ | `dict` | `dict({expr})` |
159
+ | `tuple` | `tuple({expr})` |
160
+
161
+ Use `%postfix_template list` in IPython to see the exact effective set, including
162
+ custom and disabled templates.
163
+
164
+ ## Local Validation
165
+
166
+ Run tests:
167
+
168
+ ```bash
169
+ uv run --extra test pytest -q
170
+ ```
171
+
172
+ Build and check release artifacts:
173
+
174
+ ```bash
175
+ uv run --extra dev python -m build
176
+ uv run --extra dev python -m twine check dist/*
177
+ ```
178
+
179
+ Validate the wheel in a clean local virtual environment:
180
+
181
+ ```bash
182
+ uv venv .venv-check
183
+ uv pip install --python .venv-check/bin/python dist/*.whl
184
+ .venv-check/bin/ipython
185
+ ```
186
+
187
+ Then inside IPython:
188
+
189
+ ```python
190
+ %load_ext ipython_postfix_completion
191
+ %postfix_template add for "for item in {expr}:\n{indent} "
192
+ %postfix_template list
193
+ ```
194
+
195
+ ## Publish
196
+
197
+ Publishing uses GitHub Actions and PyPI Trusted Publishing. Configure the
198
+ existing PyPI project once under **Manage > Publishing > Add a new publisher**:
199
+
200
+ | Setting | Value |
201
+ | --- | --- |
202
+ | Owner | `fishandsheep` |
203
+ | Repository | `ipython-postfix-completion` |
204
+ | Workflow | `publish.yml` |
205
+ | Environment | `pypi` |
206
+
207
+ For each release, update `project.version` in `pyproject.toml`, commit and push
208
+ the change, then create a matching `v` tag. For example, after changing the
209
+ version to `0.1.1`:
210
+
211
+ ```bash
212
+ git tag v0.1.1
213
+ git push origin v0.1.1
214
+ ```
215
+
216
+ The workflow verifies the tag against `project.version`, runs tests, builds and
217
+ checks both distributions, then publishes them to PyPI using a short-lived OIDC
218
+ credential. The already-published `0.1.0` release cannot be uploaded again.
@@ -0,0 +1,190 @@
1
+ # IPython Postfix Completion
2
+
3
+ Configurable postfix completion extension for IPython.
4
+
5
+ Package on PyPI: `ipython-postfix-completion`
6
+
7
+ ## Install
8
+
9
+ Install into the current Python environment with `uv`:
10
+
11
+ ```bash
12
+ uvx --with ipython-postfix-completion ipython
13
+ ```
14
+
15
+ Install into the current ipython environment with `uv`:
16
+
17
+ ```bash
18
+ uv tool install ipython --with ipython-postfix-completion
19
+ ```
20
+
21
+ ## Load
22
+
23
+ Inside IPython:
24
+
25
+ ```python
26
+ %load_ext ipython_postfix_completion
27
+ ```
28
+
29
+ To load it automatically, add this to `ipython_config.py`:
30
+
31
+ ```python
32
+ c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
33
+ ```
34
+
35
+ ## Quick Example: Add a `for` Template
36
+
37
+ Add a template for the current IPython session:
38
+
39
+ ```python
40
+ %postfix_template add for "for item in {expr}:\n{indent} "
41
+ ```
42
+
43
+ Use it:
44
+
45
+ ```python
46
+ items.for<Tab>
47
+ ```
48
+
49
+ It expands to:
50
+
51
+ ```python
52
+ for item in items:
53
+
54
+ ```
55
+
56
+ Runtime templates only affect the current IPython session. Put templates in
57
+ `ipython_config.py` if you want them to persist.
58
+
59
+ ## Runtime Magic
60
+
61
+ List effective templates:
62
+
63
+ ```python
64
+ %postfix_template list
65
+ ```
66
+
67
+ Add or override a template for the current session:
68
+
69
+ ```python
70
+ %postfix_template add debug "print({expr}=)"
71
+ %postfix_template add forin "for item in {expr}:\n{indent} "
72
+ ```
73
+
74
+ Disable a template for the current session:
75
+
76
+ ```python
77
+ %postfix_template remove tuple
78
+ ```
79
+
80
+ Reset one runtime change:
81
+
82
+ ```python
83
+ %postfix_template reset forin
84
+ ```
85
+
86
+ Reset all runtime changes:
87
+
88
+ ```python
89
+ %postfix_template reset --all
90
+ ```
91
+
92
+ ## Persistent Config
93
+
94
+ Add persistent templates in `ipython_config.py`:
95
+
96
+ ```python
97
+ c.PostfixCompletionConfig.templates = {
98
+ "debug": "print({expr}=)",
99
+ "forin": "for item in {expr}:\n{indent} ",
100
+ }
101
+
102
+ c.PostfixCompletionConfig.disabled_templates = ["tuple"]
103
+ ```
104
+
105
+ Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
106
+
107
+ Templates must include `{expr}` and may also use `{indent}`. No other template
108
+ fields are allowed.
109
+
110
+ ## Built-in Templates
111
+
112
+ Default templates:
113
+
114
+ | Name | Expansion |
115
+ | --- | --- |
116
+ | `print` | `print({expr})` |
117
+ | `len` | `len({expr})` |
118
+ | `not` | `not {expr}` |
119
+ | `par` | `({expr})` |
120
+ | `var` | `{expr} = ` |
121
+ | `await` | `await {expr}` |
122
+ | `return` | `return {expr}` |
123
+ | `if` | `if {expr}:\n{indent} ` |
124
+ | `while` | `while {expr}:\n{indent} ` |
125
+ | `raise` | `raise {expr}` |
126
+ | `yield` | `yield {expr}` |
127
+ | `str` | `str({expr})` |
128
+ | `list` | `list({expr})` |
129
+ | `set` | `set({expr})` |
130
+ | `dict` | `dict({expr})` |
131
+ | `tuple` | `tuple({expr})` |
132
+
133
+ Use `%postfix_template list` in IPython to see the exact effective set, including
134
+ custom and disabled templates.
135
+
136
+ ## Local Validation
137
+
138
+ Run tests:
139
+
140
+ ```bash
141
+ uv run --extra test pytest -q
142
+ ```
143
+
144
+ Build and check release artifacts:
145
+
146
+ ```bash
147
+ uv run --extra dev python -m build
148
+ uv run --extra dev python -m twine check dist/*
149
+ ```
150
+
151
+ Validate the wheel in a clean local virtual environment:
152
+
153
+ ```bash
154
+ uv venv .venv-check
155
+ uv pip install --python .venv-check/bin/python dist/*.whl
156
+ .venv-check/bin/ipython
157
+ ```
158
+
159
+ Then inside IPython:
160
+
161
+ ```python
162
+ %load_ext ipython_postfix_completion
163
+ %postfix_template add for "for item in {expr}:\n{indent} "
164
+ %postfix_template list
165
+ ```
166
+
167
+ ## Publish
168
+
169
+ Publishing uses GitHub Actions and PyPI Trusted Publishing. Configure the
170
+ existing PyPI project once under **Manage > Publishing > Add a new publisher**:
171
+
172
+ | Setting | Value |
173
+ | --- | --- |
174
+ | Owner | `fishandsheep` |
175
+ | Repository | `ipython-postfix-completion` |
176
+ | Workflow | `publish.yml` |
177
+ | Environment | `pypi` |
178
+
179
+ For each release, update `project.version` in `pyproject.toml`, commit and push
180
+ the change, then create a matching `v` tag. For example, after changing the
181
+ version to `0.1.1`:
182
+
183
+ ```bash
184
+ git tag v0.1.1
185
+ git push origin v0.1.1
186
+ ```
187
+
188
+ The workflow verifies the tag against `project.version`, runs tests, builds and
189
+ checks both distributions, then publishes them to PyPI using a short-lived OIDC
190
+ credential. The already-published `0.1.0` release cannot be uploaded again.
@@ -53,6 +53,8 @@ DEFAULT_TEMPLATES: dict[str, str] = {
53
53
  "len": "len({expr})",
54
54
  "not": "not {expr}",
55
55
  "par": "({expr})",
56
+ "var": "{expr} = ",
57
+ "await": "await {expr}",
56
58
  "return": "return {expr}",
57
59
  "if": "if {expr}:\n{indent} ",
58
60
  "while": "while {expr}:\n{indent} ",
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: ipython-postfix-completion
3
+ Version: 0.1.1
4
+ Summary: Configurable postfix completion extension for IPython.
5
+ Author: IPython Postfix Completion Contributors
6
+ License-Expression: BSD-3-Clause
7
+ Keywords: ipython,completion,postfix,extension
8
+ Classifier: Framework :: IPython
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: Programming Language :: Python :: 3 :: Only
12
+ Classifier: Programming Language :: Python :: 3.11
13
+ Classifier: Programming Language :: Python :: 3.12
14
+ Classifier: Programming Language :: Python :: 3.13
15
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: ipython>=9.0
20
+ Requires-Dist: traitlets>=5.13
21
+ Provides-Extra: test
22
+ Requires-Dist: pytest>=7; extra == "test"
23
+ Provides-Extra: dev
24
+ Requires-Dist: build; extra == "dev"
25
+ Requires-Dist: twine; extra == "dev"
26
+ Requires-Dist: ipython-postfix-completion[test]; extra == "dev"
27
+ Dynamic: license-file
28
+
29
+ # IPython Postfix Completion
30
+
31
+ Configurable postfix completion extension for IPython.
32
+
33
+ Package on PyPI: `ipython-postfix-completion`
34
+
35
+ ## Install
36
+
37
+ Install into the current Python environment with `uv`:
38
+
39
+ ```bash
40
+ uvx --with ipython-postfix-completion ipython
41
+ ```
42
+
43
+ Install into the current ipython environment with `uv`:
44
+
45
+ ```bash
46
+ uv tool install ipython --with ipython-postfix-completion
47
+ ```
48
+
49
+ ## Load
50
+
51
+ Inside IPython:
52
+
53
+ ```python
54
+ %load_ext ipython_postfix_completion
55
+ ```
56
+
57
+ To load it automatically, add this to `ipython_config.py`:
58
+
59
+ ```python
60
+ c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
61
+ ```
62
+
63
+ ## Quick Example: Add a `for` Template
64
+
65
+ Add a template for the current IPython session:
66
+
67
+ ```python
68
+ %postfix_template add for "for item in {expr}:\n{indent} "
69
+ ```
70
+
71
+ Use it:
72
+
73
+ ```python
74
+ items.for<Tab>
75
+ ```
76
+
77
+ It expands to:
78
+
79
+ ```python
80
+ for item in items:
81
+
82
+ ```
83
+
84
+ Runtime templates only affect the current IPython session. Put templates in
85
+ `ipython_config.py` if you want them to persist.
86
+
87
+ ## Runtime Magic
88
+
89
+ List effective templates:
90
+
91
+ ```python
92
+ %postfix_template list
93
+ ```
94
+
95
+ Add or override a template for the current session:
96
+
97
+ ```python
98
+ %postfix_template add debug "print({expr}=)"
99
+ %postfix_template add forin "for item in {expr}:\n{indent} "
100
+ ```
101
+
102
+ Disable a template for the current session:
103
+
104
+ ```python
105
+ %postfix_template remove tuple
106
+ ```
107
+
108
+ Reset one runtime change:
109
+
110
+ ```python
111
+ %postfix_template reset forin
112
+ ```
113
+
114
+ Reset all runtime changes:
115
+
116
+ ```python
117
+ %postfix_template reset --all
118
+ ```
119
+
120
+ ## Persistent Config
121
+
122
+ Add persistent templates in `ipython_config.py`:
123
+
124
+ ```python
125
+ c.PostfixCompletionConfig.templates = {
126
+ "debug": "print({expr}=)",
127
+ "forin": "for item in {expr}:\n{indent} ",
128
+ }
129
+
130
+ c.PostfixCompletionConfig.disabled_templates = ["tuple"]
131
+ ```
132
+
133
+ Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
134
+
135
+ Templates must include `{expr}` and may also use `{indent}`. No other template
136
+ fields are allowed.
137
+
138
+ ## Built-in Templates
139
+
140
+ Default templates:
141
+
142
+ | Name | Expansion |
143
+ | --- | --- |
144
+ | `print` | `print({expr})` |
145
+ | `len` | `len({expr})` |
146
+ | `not` | `not {expr}` |
147
+ | `par` | `({expr})` |
148
+ | `var` | `{expr} = ` |
149
+ | `await` | `await {expr}` |
150
+ | `return` | `return {expr}` |
151
+ | `if` | `if {expr}:\n{indent} ` |
152
+ | `while` | `while {expr}:\n{indent} ` |
153
+ | `raise` | `raise {expr}` |
154
+ | `yield` | `yield {expr}` |
155
+ | `str` | `str({expr})` |
156
+ | `list` | `list({expr})` |
157
+ | `set` | `set({expr})` |
158
+ | `dict` | `dict({expr})` |
159
+ | `tuple` | `tuple({expr})` |
160
+
161
+ Use `%postfix_template list` in IPython to see the exact effective set, including
162
+ custom and disabled templates.
163
+
164
+ ## Local Validation
165
+
166
+ Run tests:
167
+
168
+ ```bash
169
+ uv run --extra test pytest -q
170
+ ```
171
+
172
+ Build and check release artifacts:
173
+
174
+ ```bash
175
+ uv run --extra dev python -m build
176
+ uv run --extra dev python -m twine check dist/*
177
+ ```
178
+
179
+ Validate the wheel in a clean local virtual environment:
180
+
181
+ ```bash
182
+ uv venv .venv-check
183
+ uv pip install --python .venv-check/bin/python dist/*.whl
184
+ .venv-check/bin/ipython
185
+ ```
186
+
187
+ Then inside IPython:
188
+
189
+ ```python
190
+ %load_ext ipython_postfix_completion
191
+ %postfix_template add for "for item in {expr}:\n{indent} "
192
+ %postfix_template list
193
+ ```
194
+
195
+ ## Publish
196
+
197
+ Publishing uses GitHub Actions and PyPI Trusted Publishing. Configure the
198
+ existing PyPI project once under **Manage > Publishing > Add a new publisher**:
199
+
200
+ | Setting | Value |
201
+ | --- | --- |
202
+ | Owner | `fishandsheep` |
203
+ | Repository | `ipython-postfix-completion` |
204
+ | Workflow | `publish.yml` |
205
+ | Environment | `pypi` |
206
+
207
+ For each release, update `project.version` in `pyproject.toml`, commit and push
208
+ the change, then create a matching `v` tag. For example, after changing the
209
+ version to `0.1.1`:
210
+
211
+ ```bash
212
+ git tag v0.1.1
213
+ git push origin v0.1.1
214
+ ```
215
+
216
+ The workflow verifies the tag against `project.version`, runs tests, builds and
217
+ checks both distributions, then publishes them to PyPI using a short-lived OIDC
218
+ credential. The already-published `0.1.0` release cannot be uploaded again.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ipython-postfix-completion"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "Configurable postfix completion extension for IPython."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.11"
@@ -66,6 +66,8 @@ def test_postfix_matcher_expands_basic_templates():
66
66
  [
67
67
  ("not", "x.not", "not x"),
68
68
  ("par", "x.par", "(x)"),
69
+ ("var", "result.var", "result = "),
70
+ ("await", "task.await", "await task"),
69
71
  ("return", "x.return", "return x"),
70
72
  ("if", "x.if", "if x:\n "),
71
73
  ("while", "x.while", "while x:\n "),
@@ -1,150 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ipython-postfix-completion
3
- Version: 0.1.0
4
- Summary: Configurable postfix completion extension for IPython.
5
- Author: IPython Postfix Completion Contributors
6
- License-Expression: BSD-3-Clause
7
- Keywords: ipython,completion,postfix,extension
8
- Classifier: Framework :: IPython
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3 :: Only
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Programming Language :: Python :: 3.13
15
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
- Requires-Python: >=3.11
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Requires-Dist: ipython>=9.0
20
- Requires-Dist: traitlets>=5.13
21
- Provides-Extra: test
22
- Requires-Dist: pytest>=7; extra == "test"
23
- Provides-Extra: dev
24
- Requires-Dist: build; extra == "dev"
25
- Requires-Dist: twine; extra == "dev"
26
- Requires-Dist: ipython-postfix-completion[test]; extra == "dev"
27
- Dynamic: license-file
28
-
29
- # IPython Postfix Completion
30
-
31
- Configurable postfix completion extension for IPython.
32
-
33
- ## Install
34
-
35
- From a local checkout:
36
-
37
- ```bash
38
- python -m pip install -e .
39
- ```
40
-
41
- From PyPI after publishing:
42
-
43
- ```bash
44
- python -m pip install ipython-postfix-completion
45
- ```
46
-
47
- ## Load
48
-
49
- Inside IPython:
50
-
51
- ```python
52
- %load_ext ipython_postfix_completion
53
- ```
54
-
55
- To load it automatically, add this to `ipython_config.py`:
56
-
57
- ```python
58
- c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
59
- ```
60
-
61
- ## Runtime Templates
62
-
63
- Add a template for the current session:
64
-
65
- ```python
66
- %postfix_template add forin "for item in {expr}:\n{indent} "
67
- ```
68
-
69
- Use it:
70
-
71
- ```python
72
- items.forin<Tab>
73
- ```
74
-
75
- This expands to:
76
-
77
- ```python
78
- for item in items:
79
-
80
- ```
81
-
82
- List effective templates:
83
-
84
- ```python
85
- %postfix_template list
86
- ```
87
-
88
- Disable a template for the current session:
89
-
90
- ```python
91
- %postfix_template remove tuple
92
- ```
93
-
94
- Reset one runtime change:
95
-
96
- ```python
97
- %postfix_template reset forin
98
- ```
99
-
100
- Reset all runtime changes:
101
-
102
- ```python
103
- %postfix_template reset --all
104
- ```
105
-
106
- ## Persistent Config
107
-
108
- Add persistent templates in `ipython_config.py`:
109
-
110
- ```python
111
- c.PostfixCompletionConfig.templates = {
112
- "debug": "print({expr}=)",
113
- "forin": "for item in {expr}:\n{indent} ",
114
- }
115
-
116
- c.PostfixCompletionConfig.disabled_templates = ["tuple"]
117
- ```
118
-
119
- Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
120
-
121
- Templates must include `{expr}` and may also use `{indent}`. No other template fields are allowed.
122
-
123
- ## Development
124
-
125
- Run tests:
126
-
127
- ```bash
128
- python -m pip install -e ".[test]"
129
- python -m pytest
130
- ```
131
-
132
- Build release artifacts:
133
-
134
- ```bash
135
- python -m pip install build twine
136
- python -m build
137
- python -m twine check dist/*
138
- ```
139
-
140
- Publish to TestPyPI:
141
-
142
- ```bash
143
- python -m twine upload --repository testpypi dist/*
144
- ```
145
-
146
- Publish to PyPI:
147
-
148
- ```bash
149
- python -m twine upload dist/*
150
- ```
@@ -1,122 +0,0 @@
1
- # IPython Postfix Completion
2
-
3
- Configurable postfix completion extension for IPython.
4
-
5
- ## Install
6
-
7
- From a local checkout:
8
-
9
- ```bash
10
- python -m pip install -e .
11
- ```
12
-
13
- From PyPI after publishing:
14
-
15
- ```bash
16
- python -m pip install ipython-postfix-completion
17
- ```
18
-
19
- ## Load
20
-
21
- Inside IPython:
22
-
23
- ```python
24
- %load_ext ipython_postfix_completion
25
- ```
26
-
27
- To load it automatically, add this to `ipython_config.py`:
28
-
29
- ```python
30
- c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
31
- ```
32
-
33
- ## Runtime Templates
34
-
35
- Add a template for the current session:
36
-
37
- ```python
38
- %postfix_template add forin "for item in {expr}:\n{indent} "
39
- ```
40
-
41
- Use it:
42
-
43
- ```python
44
- items.forin<Tab>
45
- ```
46
-
47
- This expands to:
48
-
49
- ```python
50
- for item in items:
51
-
52
- ```
53
-
54
- List effective templates:
55
-
56
- ```python
57
- %postfix_template list
58
- ```
59
-
60
- Disable a template for the current session:
61
-
62
- ```python
63
- %postfix_template remove tuple
64
- ```
65
-
66
- Reset one runtime change:
67
-
68
- ```python
69
- %postfix_template reset forin
70
- ```
71
-
72
- Reset all runtime changes:
73
-
74
- ```python
75
- %postfix_template reset --all
76
- ```
77
-
78
- ## Persistent Config
79
-
80
- Add persistent templates in `ipython_config.py`:
81
-
82
- ```python
83
- c.PostfixCompletionConfig.templates = {
84
- "debug": "print({expr}=)",
85
- "forin": "for item in {expr}:\n{indent} ",
86
- }
87
-
88
- c.PostfixCompletionConfig.disabled_templates = ["tuple"]
89
- ```
90
-
91
- Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
92
-
93
- Templates must include `{expr}` and may also use `{indent}`. No other template fields are allowed.
94
-
95
- ## Development
96
-
97
- Run tests:
98
-
99
- ```bash
100
- python -m pip install -e ".[test]"
101
- python -m pytest
102
- ```
103
-
104
- Build release artifacts:
105
-
106
- ```bash
107
- python -m pip install build twine
108
- python -m build
109
- python -m twine check dist/*
110
- ```
111
-
112
- Publish to TestPyPI:
113
-
114
- ```bash
115
- python -m twine upload --repository testpypi dist/*
116
- ```
117
-
118
- Publish to PyPI:
119
-
120
- ```bash
121
- python -m twine upload dist/*
122
- ```
@@ -1,150 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: ipython-postfix-completion
3
- Version: 0.1.0
4
- Summary: Configurable postfix completion extension for IPython.
5
- Author: IPython Postfix Completion Contributors
6
- License-Expression: BSD-3-Clause
7
- Keywords: ipython,completion,postfix,extension
8
- Classifier: Framework :: IPython
9
- Classifier: Intended Audience :: Developers
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: Programming Language :: Python :: 3 :: Only
12
- Classifier: Programming Language :: Python :: 3.11
13
- Classifier: Programming Language :: Python :: 3.12
14
- Classifier: Programming Language :: Python :: 3.13
15
- Classifier: Topic :: Software Development :: Libraries :: Python Modules
16
- Requires-Python: >=3.11
17
- Description-Content-Type: text/markdown
18
- License-File: LICENSE
19
- Requires-Dist: ipython>=9.0
20
- Requires-Dist: traitlets>=5.13
21
- Provides-Extra: test
22
- Requires-Dist: pytest>=7; extra == "test"
23
- Provides-Extra: dev
24
- Requires-Dist: build; extra == "dev"
25
- Requires-Dist: twine; extra == "dev"
26
- Requires-Dist: ipython-postfix-completion[test]; extra == "dev"
27
- Dynamic: license-file
28
-
29
- # IPython Postfix Completion
30
-
31
- Configurable postfix completion extension for IPython.
32
-
33
- ## Install
34
-
35
- From a local checkout:
36
-
37
- ```bash
38
- python -m pip install -e .
39
- ```
40
-
41
- From PyPI after publishing:
42
-
43
- ```bash
44
- python -m pip install ipython-postfix-completion
45
- ```
46
-
47
- ## Load
48
-
49
- Inside IPython:
50
-
51
- ```python
52
- %load_ext ipython_postfix_completion
53
- ```
54
-
55
- To load it automatically, add this to `ipython_config.py`:
56
-
57
- ```python
58
- c.InteractiveShellApp.extensions = ["ipython_postfix_completion"]
59
- ```
60
-
61
- ## Runtime Templates
62
-
63
- Add a template for the current session:
64
-
65
- ```python
66
- %postfix_template add forin "for item in {expr}:\n{indent} "
67
- ```
68
-
69
- Use it:
70
-
71
- ```python
72
- items.forin<Tab>
73
- ```
74
-
75
- This expands to:
76
-
77
- ```python
78
- for item in items:
79
-
80
- ```
81
-
82
- List effective templates:
83
-
84
- ```python
85
- %postfix_template list
86
- ```
87
-
88
- Disable a template for the current session:
89
-
90
- ```python
91
- %postfix_template remove tuple
92
- ```
93
-
94
- Reset one runtime change:
95
-
96
- ```python
97
- %postfix_template reset forin
98
- ```
99
-
100
- Reset all runtime changes:
101
-
102
- ```python
103
- %postfix_template reset --all
104
- ```
105
-
106
- ## Persistent Config
107
-
108
- Add persistent templates in `ipython_config.py`:
109
-
110
- ```python
111
- c.PostfixCompletionConfig.templates = {
112
- "debug": "print({expr}=)",
113
- "forin": "for item in {expr}:\n{indent} ",
114
- }
115
-
116
- c.PostfixCompletionConfig.disabled_templates = ["tuple"]
117
- ```
118
-
119
- Template names must match `[A-Za-z_][A-Za-z0-9_]*`.
120
-
121
- Templates must include `{expr}` and may also use `{indent}`. No other template fields are allowed.
122
-
123
- ## Development
124
-
125
- Run tests:
126
-
127
- ```bash
128
- python -m pip install -e ".[test]"
129
- python -m pytest
130
- ```
131
-
132
- Build release artifacts:
133
-
134
- ```bash
135
- python -m pip install build twine
136
- python -m build
137
- python -m twine check dist/*
138
- ```
139
-
140
- Publish to TestPyPI:
141
-
142
- ```bash
143
- python -m twine upload --repository testpypi dist/*
144
- ```
145
-
146
- Publish to PyPI:
147
-
148
- ```bash
149
- python -m twine upload dist/*
150
- ```