fastcore 2.2.30__tar.gz → 2.2.32__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.
- {fastcore-2.2.30/fastcore.egg-info → fastcore-2.2.32}/PKG-INFO +1 -1
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/__init__.py +1 -1
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/docments.py +2 -2
- fastcore-2.2.32/fastcore/editskill.py +64 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/xml.py +1 -1
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/xtras.py +2 -2
- {fastcore-2.2.30 → fastcore-2.2.32/fastcore.egg-info}/PKG-INFO +1 -1
- fastcore-2.2.30/fastcore/editskill.py +0 -85
- {fastcore-2.2.30 → fastcore-2.2.32}/CONTRIBUTING.md +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/LICENSE +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/README.md +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/_modidx.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/aio.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/all.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/ansi.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/apisurface.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/basics.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/dispatch.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/docscrape.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/foundation.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/funccall.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/imghdr.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/imports.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/meta.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/nb_imports.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/nbio.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/net.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/parallel.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/py2pyi.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/script.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/shutil.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/style.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/test.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/tools.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/transform.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/utils.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore/xdg.py +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore.egg-info/SOURCES.txt +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore.egg-info/dependency_links.txt +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore.egg-info/entry_points.txt +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore.egg-info/requires.txt +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/fastcore.egg-info/top_level.txt +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/pyproject.toml +0 -0
- {fastcore-2.2.30 → fastcore-2.2.32}/setup.cfg +0 -0
|
@@ -44,7 +44,7 @@ def docstring(sym):
|
|
|
44
44
|
if isinstance(sym, partial): return docstring(sym.func)
|
|
45
45
|
if _callable_instance(sym):
|
|
46
46
|
own = inspect.getattr_static(sym, '__doc__', None)
|
|
47
|
-
if own is not getattr(type(sym), '__doc__', None): return getdoc(sym) or ''
|
|
47
|
+
if isinstance(own, property) or own is not getattr(type(sym), '__doc__', None): return getdoc(sym) or ''
|
|
48
48
|
return getdoc(sym.__call__) or getdoc(sym) or ''
|
|
49
49
|
res = getdoc(sym)
|
|
50
50
|
if not getattr(sym, '__doc__', None) and res == object.__init__.__doc__: res = None
|
|
@@ -183,7 +183,7 @@ def docments(s, full=False, eval_str=False, returns=True, args_kwargs=False):
|
|
|
183
183
|
except (ValueError, TypeError): return AttrDict()
|
|
184
184
|
nps = parse_docstring(s)
|
|
185
185
|
docs = {}
|
|
186
|
-
while s:
|
|
186
|
+
while s is not None:
|
|
187
187
|
p = _param_locs(s, returns=returns, args_kwargs=args_kwargs) or {}
|
|
188
188
|
c = {o.start[0]:_clean_comment(o.string) for o in _tokens(s) if o.type==COMMENT}
|
|
189
189
|
for k,v in p.items():
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""Text, file, cell, and notebook editing from `fastcore.tools` and `fastcore.nbio`, plus the conventions the whole fastai editing toolkit follows. Read this before working with the editing tools in any package that shares them.
|
|
2
|
+
|
|
3
|
+
`from fastcore.editskill import *` loads `fastcore.tools` (text primitives, file tools) and `fastcore.nbio` (notebook I/O, cell editors). Where installed, prefer `exhash` for hash-verified editing, `rgapi` for search, and `aidialog`/`dialoghelper` for dialogs.
|
|
4
|
+
|
|
5
|
+
## Places
|
|
6
|
+
|
|
7
|
+
Targets: strings in memory, files (a path), notebook cells (`path, cell_id`; edits that cell's source), and in-memory `Notebook`/`NbCell`. A Solveit dialog is an `.ipynb` whose cells are notes, runnable code, and prompt/reply pairs; cell tools work with notebook structure whatever produced the file, while `aidialog.dlgskill`/`dialoghelper` read and edit dialog messages. exhash's `open_doc` outlines Markdown, code, and notebooks (`doc(open_doc)`: inputs, navigation, llms.txt workflow); a section is a span of lines or a run of cells, changed with the file and cell tools.
|
|
8
|
+
|
|
9
|
+
Open a `Notebook` with `Notebook.open(path)` and save it with `nb.save()`. Index it by position or cell id (exact or unique prefix): `nb[k]` returns a cell, `nb[k] = src` sets its source, and `del nb[k]` removes it. `nb.add(src, cell_type)` and `nb.md(src)` insert a cell at `idx`, or `after` or `before` a cell id. `nb.move(ids, after=, before=)` reorders cells.
|
|
10
|
+
|
|
11
|
+
## Naming
|
|
12
|
+
|
|
13
|
+
- Operations on files, notebooks, cells, and messages: `verb_target` (`view_file`, `create_file`, `read_nb`, `write_nb`, `view_cell`, `validate_nb`, `view_msg`, `view_dlg`, `lnhashview_cell`). `find_msgs`, `add_msg`, `del_msgs`, `find_cells` need no extra dialog/notebook prefix. `msg` = dialog message; `cell` = notebook cell. `summary_nb` returns rows for notebook cells.
|
|
14
|
+
- Text primitives (`insert_line`, `del_lines`, `replace_lines`, `str_replace`) get `file_`/`cell_`/`msg_` versions (`file_del_lines`, `cell_del_lines`, `msg_del_lines`) that take the primitive's arguments after their address arguments. `str_replace` keeps the name and argument order of Anthropic's text editor tool. `ast_replace` (AST patterns) and `exhash` (hash-verified line addresses) use the same prefixes: `file_ast_replace`, `msg_ast_replace`, `file_exhash`, `cell_exhash`.
|
|
15
|
+
- Converters: `x2y` (`nb2dict`, `cell2xml`, aidialog's `dlg2md`); converter methods: `to_y` (`nb.to_dict()`).
|
|
16
|
+
- Plural names take several items: `view_cell` one cell, `lnhashview_cells` several, `del_msgs` many.
|
|
17
|
+
|
|
18
|
+
## Parameters (one vocabulary wherever it appears)
|
|
19
|
+
|
|
20
|
+
- Order: the place's address (`text`; `path`; `path, cell_id`; a message `id`), then the new text, then ambient context as keyword-only (how message tools name their dialog).
|
|
21
|
+
- `start_line`/`end_line`: 1-based, inclusive, `None` = first/last line; a negative `end_line` counts from the end. `del_lines` has no defaults: state the range.
|
|
22
|
+
- `re_filter`/`invert_filter`: restrict an edit to lines (not) matching a regex, like ex `g//`/`g!//`; combines with the range.
|
|
23
|
+
- Searches read patterns as regex by default; editors read them as literal text unless `use_regex=True`.
|
|
24
|
+
- Views: `nums` (line numbers), `lnhashs` (`lineno|hash|` addresses); `maxlen` caps summary lines; `trunc_out`/`trunc_in` truncate outputs/sources in dialog views.
|
|
25
|
+
- Search tools (`fd`, `ls`, `rg`, `nbrg`): `pattern` first, `root='.'`, one include/exclude/ext/hidden/ignore block; variants differ by defaults, not API (`ls` is `fd` with listing defaults).
|
|
26
|
+
- Boolean filters narrow as `only_*` (`only_err`, `only_exp`, `only_errors`) and widen as `incl_*` (`incl_out`).
|
|
27
|
+
- `context=` counts the place's units: lines (blocks in summary mode) for files, cells for notebooks, messages for dialogs.
|
|
28
|
+
- Editors return a diff, which is the verification: read it rather than re-viewing. No change: fastcore editors and exhash return `none: No changes.`
|
|
29
|
+
|
|
30
|
+
## Functions and methods
|
|
31
|
+
|
|
32
|
+
Functions take a path, save, and return a diff; methods change an object in memory, saved explicitly. Methods drop the address arguments and the object's part of the name: `cell_str_replace(path, cell_id, ...)` -> `c.str_replace(...)` on an `NbCell`; `find_cells(path, pat)` -> `nb.find_cells(pat)` on a `Notebook`. Read functions return snapshot rows (addresses, source, metadata); read methods return the objects. One style per file at a time: save before switching to functions, reopen before returning to methods.
|
|
33
|
+
|
|
34
|
+
## Addresses
|
|
35
|
+
|
|
36
|
+
Edits take plain line numbers or lnhash addresses, got while reading: `nums=True`/`lnhashs=True` views, `rg(lnhashs=True)`. Prefer lnhash addresses where exhash is installed; stale ones are rejected. Plain line numbers are unverified and shift, so re-view after each such edit and apply several bottom-to-top. `exhash.skill` covers address forms and the verified edit loop.
|
|
37
|
+
|
|
38
|
+
Not sure where to edit? Start with a summary: rgapi's `rg(summary=True)` and `nbrg`, aidialog's `summary_dlg`, and exhash's `open_doc` outlines give one addressed row per block, cell, message, or section. A section token such as `1.6.|12|Py|,45|HD|` is the section number plus the lnhash range of the section's first and last lines; that range works as an exhash address.
|
|
39
|
+
|
|
40
|
+
## What's where
|
|
41
|
+
|
|
42
|
+
- `fastcore.tools`: text primitives, file tools, and `line_hash`/`lnhash`/`lnhash_at` for creating addresses without exhash installed.
|
|
43
|
+
- `fastcore.nbio`: notebook read/write/validate/repair, cell construction, cell editors, and the `Notebook`/`NbCell` session objects with their snapshot queries (`find_cells`, `summary_nb`).
|
|
44
|
+
- `exhash.skill`: hash-verified editing for files and cells, plus `open_doc` section outlines for Markdown, code, and notebooks; prefer it for edits where installed.
|
|
45
|
+
- `rgapi.skill`: `rg`/`fd`/`ls`/`nbrg` search with lnhash output, and `rgstr` to search text already in hand.
|
|
46
|
+
- `remold`: structural search and rewrite for Python source (declarative ast-grep rules, LibCST matcher transforms, symbol queries); the engine behind `ast_replace`.
|
|
47
|
+
- `aidialog.dlgskill`, `dialoghelper`: the dialog layer, including its own theory of dialogs and projections.
|
|
48
|
+
|
|
49
|
+
Docs: https://fastcore.fast.ai/tools.html.md and https://fastcore.fast.ai/nbio.html.md
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
from fastcore.tools import (insert_line, str_replace, strs_replace, replace_lines, del_lines, ast_replace,
|
|
53
|
+
file_insert_line, file_str_replace, file_strs_replace, file_replace_lines, file_del_lines, file_ast_replace,
|
|
54
|
+
view_file, create_file, line_hash, lnhash, lnhash_at)
|
|
55
|
+
from fastcore.nbio import (read_nb, write_nb, new_nb, mk_cell, validate_nb, validate_cell, repair_nb, repair_cell,
|
|
56
|
+
view_cell, cell_insert_line, cell_str_replace, cell_strs_replace, cell_replace_lines, cell_del_lines, cell_ast_replace, Notebook, NbCell, find_cells, summary_nb)
|
|
57
|
+
|
|
58
|
+
__all__ = ['insert_line', 'str_replace', 'strs_replace', 'replace_lines', 'del_lines', 'ast_replace',
|
|
59
|
+
'file_insert_line', 'file_str_replace', 'file_strs_replace', 'file_replace_lines', 'file_del_lines', 'file_ast_replace',
|
|
60
|
+
'view_file', 'create_file', 'line_hash', 'lnhash', 'lnhash_at',
|
|
61
|
+
'read_nb', 'write_nb', 'new_nb', 'mk_cell', 'validate_nb', 'validate_cell', 'repair_nb', 'repair_cell',
|
|
62
|
+
'view_cell', 'cell_insert_line', 'cell_str_replace', 'cell_strs_replace', 'cell_replace_lines', 'cell_del_lines', 'cell_ast_replace', 'Notebook', 'NbCell', 'find_cells', 'summary_nb']
|
|
63
|
+
|
|
64
|
+
__pyskill_params__ = {'replace_params': ('start_line', 'end_line', 'n_matches', 're_filter', 'invert_filter', 'use_regex')}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Concise HTML generation and namespace-aware XML construction.
|
|
1
|
+
r"""Concise HTML generation and namespace-aware XML construction.
|
|
2
2
|
|
|
3
3
|
`ft(tag, *children, **attrs)` builds an `FT` tree for HTML generation. `to_xml` renders the tree. [FastHTML](https://fastht.ml) uses these functions to generate HTML.
|
|
4
4
|
|
|
@@ -1000,8 +1000,8 @@ def partial_format(s:str, **kwargs):
|
|
|
1000
1000
|
|
|
1001
1001
|
# %% ../nbs/03_xtras.ipynb #becf7a2d
|
|
1002
1002
|
def truncstr(s:str, maxlen:int, suf='…', space='', sizevar:str=None)->str:
|
|
1003
|
-
"Truncate `s` to length `maxlen
|
|
1004
|
-
if len(s)+len(space)<=maxlen: return s+space
|
|
1003
|
+
"Truncate `s` to length `maxlen` (None: no limit), adding suffix `suf` if truncated; a callable `suf` gets the number of characters cut"
|
|
1004
|
+
if maxlen is None or len(s)+len(space)<=maxlen: return s+space
|
|
1005
1005
|
if sizevar: suf = suf.format_map({sizevar: len(s)})
|
|
1006
1006
|
if callable(suf):
|
|
1007
1007
|
f,n = suf,0
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"""Text, file, cell, and notebook editing from `fastcore.tools` and `fastcore.nbio`, plus the conventions the whole fastai editing toolkit follows. Read this before working with the editing tools in any package that shares them.
|
|
2
|
-
|
|
3
|
-
`from fastcore.editskill import *` loads the fastcore editing layer: the text primitives and file tools of `fastcore.tools`, and the notebook I/O and cell editors of `fastcore.nbio`. When installed, prefer `exhash` for hash-verified editing, `rgapi` for search, and `aidialog` or `dialoghelper` for dialogs.
|
|
4
|
-
|
|
5
|
-
## Places
|
|
6
|
-
|
|
7
|
-
The tools edit strings in memory, files, notebook cells, and notebooks. File tools take a path. Cell tools take `path, cell_id` and edit that cell's source. `Notebook` and `NbCell` hold notebooks and cells in memory.
|
|
8
|
-
|
|
9
|
-
A Solveit dialog is an `.ipynb` whose cells represent notes, runnable code, and prompt/reply pairs. Cell tools work with notebook structure, regardless of which application produced the file. `aidialog.dlgskill` and `dialoghelper` provide tools for reading and editing dialog messages.
|
|
10
|
-
|
|
11
|
-
`open_doc` (in exhash) parses a file (`fname=`, or a `Path` as `src`), URL (an `https?://` str), or text (any other str) into a `Section` tree, with sections taken from Markdown headings, tree-sitter definitions in code, or md-heading cells in a notebook. A section points at a span of lines in a file, or a run of cells in a notebook. To change what a section contains, edit those lines or cells with the file and cell tools.
|
|
12
|
-
|
|
13
|
-
## Naming
|
|
14
|
-
|
|
15
|
-
Function names follow these conventions:
|
|
16
|
-
|
|
17
|
-
- Operations on files, notebooks, cells, and messages use `verb_target`: `view_file`, `create_file`, `read_nb`, `write_nb`, `view_cell`, `validate_nb`, `view_msg`, and `view_dlg`. This includes `lnhashview_cell`. Names such as `find_msgs`, `add_msg`, `del_msgs`, and `find_cells` need no extra dialog or notebook prefix. `msg` identifies a dialog message and `cell` identifies a notebook cell. `summary_nb` returns rows for notebook cells.
|
|
18
|
-
- Text-editing primitives include `insert_line`, `del_lines`, `replace_lines`, and `str_replace`. File, cell, and message versions add a prefix, as in `file_del_lines`, `cell_del_lines`, and `msg_del_lines`. After their address arguments, these versions take the same arguments as the text primitive.
|
|
19
|
-
|
|
20
|
-
`str_replace` keeps the name and argument order established by Anthropic's text editor tool. `ast_replace` uses AST patterns to find edit targets. `exhash` takes commands containing hash-verified line addresses. These operations use the same file, cell, and message prefixes: `file_ast_replace`, `msg_ast_replace`, `file_exhash`, and `cell_exhash`.
|
|
21
|
-
|
|
22
|
-
Converters use `x2y` names, such as `nb2dict` and `cell2xml`. In aidialog, exactly one side is `dlg`. Converter methods use `to_y`, as in `nb.to_dict()`.
|
|
23
|
-
|
|
24
|
-
Plural names take multiple items: `view_cell` takes one cell, `lnhashview_cells` several, and `del_msgs` many.
|
|
25
|
-
|
|
26
|
-
## Parameters
|
|
27
|
-
|
|
28
|
-
One vocabulary, identical wherever it appears:
|
|
29
|
-
|
|
30
|
-
- The place's address comes first (`text`; `path`; `path, cell_id`; a message `id`), the new text next, and ambient context last as keyword-only (message tools name their dialog that way).
|
|
31
|
-
- `start_line`/`end_line`: 1-based, inclusive, `None` for first/last, negative counting from the end. `del_lines` accepts no defaults: state the range.
|
|
32
|
-
- `re_filter`/`invert_filter`: restrict an edit to lines matching (or not matching) a regex, like ex's `g//` and `g!//`; combines with the range.
|
|
33
|
-
- Searches read patterns as regex by default. Editors read them as literal text unless `use_regex=True`.
|
|
34
|
-
- `nums` and `lnhashs` on any view: line numbers, or `lineno|hash|` addresses. `maxlen` caps characters per summary line; `trunc_out`/`trunc_in` truncate outputs and sources in dialog views.
|
|
35
|
-
- Search tools share one filter vocabulary: `pattern` first, `root='.'`, and the same include/exclude/ext/hidden/ignore block across `fd`, `ls`, `rg`, and `nbrg`. Variants differ by defaults, not API: `ls` is `fd` with listing defaults. Boolean filters narrow as `only_*` and widen as `include_*`.
|
|
36
|
-
- `context=` counts whatever units the place has: lines (or blocks in summary mode) for files, cells for notebooks, messages for dialogs. Dialog search defaults to context 1 because the neighbouring note usually explains the match.
|
|
37
|
-
- Every editor returns a diff ("none: No changes." when nothing changed). The diff is the verification: read it instead of re-viewing the target.
|
|
38
|
-
|
|
39
|
-
## Functions and methods
|
|
40
|
-
|
|
41
|
-
Editing functions take a file path, save their changes, and return a diff. Editing methods change an object in memory. Save it explicitly to write the changes.
|
|
42
|
-
|
|
43
|
-
Methods omit the function's address arguments and the part of its name that identifies the object. For example, `cell_str_replace(path, cell_id, ...)` becomes `c.str_replace(...)` on an `NbCell`. `find_cells(path, pat)` becomes `nb.find_cells(pat)` on a `Notebook`.
|
|
44
|
-
|
|
45
|
-
Read functions return snapshot rows containing addresses, source, and metadata. Read methods return the objects themselves. Use one style at a time per file. Save before switching to file functions, then reopen the object before returning to methods.
|
|
46
|
-
|
|
47
|
-
## Addresses
|
|
48
|
-
|
|
49
|
-
Edits accept line numbers, lnhash addresses, or section tokens. Get addresses while reading the target. Views accept `nums=True` or `lnhashs=True`. Searches can include addresses with `rg(lnhashs=True)`.
|
|
50
|
-
|
|
51
|
-
Prefer lnhash addresses when `exhash` is installed. The editor checks the hash against current content and rejects stale addresses. Plain line numbers are unverified and can shift after an edit. Re-view after each plain-line-number edit and apply multiple edits from bottom to top. Read `exhash.skill` for address formats and verified editing.
|
|
52
|
-
|
|
53
|
-
Section tokens identify sections in document outlines. In `1.6.|12|Py|,45|HD|`, `1.6.` is the section number. The rest is the lnhash range for its first and last lines. `d.at(token)` returns the section after checking its hash. `d.view(tok1, tok2)` prints the rendered text of both sections. Use the boundary range to edit the section: `file_exhash(path, ('12|Py|,45|HD|', 'c', new_text))`.
|
|
54
|
-
|
|
55
|
-
Read `exhash.skill` before working through large Markdown, code, or notebook files, or documentation from a URL. It describes `open_doc` tree searches and link following, including the llms.txt workflow.
|
|
56
|
-
|
|
57
|
-
When you don't know where to edit, start with a summary. `rgapi`'s `rg(summary=True)` and `nbrg`, aidialog's `summary_dlg`, and exhash's `open_doc` outlines show rows for blocks, cells, messages, or sections. Each row includes its address.
|
|
58
|
-
|
|
59
|
-
For prose, config, and other text organized into paragraphs, block summaries show the whole matched paragraph and its boundary addresses. Line-mode results show fragments that can require another view for context.
|
|
60
|
-
|
|
61
|
-
## What's where
|
|
62
|
-
|
|
63
|
-
- `fastcore.tools`: text primitives, file tools, and `line_hash`/`lnhash`/`lnhash_at` for creating addresses without exhash installed.
|
|
64
|
-
- `fastcore.nbio`: notebook read/write/validate/repair, cell construction, cell editors, and the `Notebook`/`NbCell` session objects with their snapshot queries (`find_cells`, `summary_nb`).
|
|
65
|
-
- `exhash.skill`: hash-verified editing for files and cells, plus `open_doc` section outlines for Markdown, code, and notebooks; prefer it for edits where installed.
|
|
66
|
-
- `rgapi.skill`: `rg`/`fd`/`ls`/`nbrg` search with lnhash output, and `rgstr` to search text already in hand.
|
|
67
|
-
- `remold`: structural search and rewrite for Python source (declarative ast-grep rules, LibCST matcher transforms, symbol queries); the engine behind `ast_replace`.
|
|
68
|
-
- `aidialog.dlgskill`, `dialoghelper`: the dialog layer, including its own theory of dialogs and projections.
|
|
69
|
-
|
|
70
|
-
Docs: https://fastcore.fast.ai/tools.html.md and https://fastcore.fast.ai/nbio.html.md
|
|
71
|
-
"""
|
|
72
|
-
|
|
73
|
-
from fastcore.tools import (insert_line, str_replace, strs_replace, replace_lines, del_lines, ast_replace,
|
|
74
|
-
file_insert_line, file_str_replace, file_strs_replace, file_replace_lines, file_del_lines, file_ast_replace,
|
|
75
|
-
view_file, create_file, line_hash, lnhash, lnhash_at)
|
|
76
|
-
from fastcore.nbio import (read_nb, write_nb, new_nb, mk_cell, validate_nb, validate_cell, repair_nb, repair_cell,
|
|
77
|
-
view_cell, cell_insert_line, cell_str_replace, cell_strs_replace, cell_replace_lines, cell_del_lines, cell_ast_replace, Notebook, NbCell, find_cells, summary_nb)
|
|
78
|
-
|
|
79
|
-
__all__ = ['insert_line', 'str_replace', 'strs_replace', 'replace_lines', 'del_lines', 'ast_replace',
|
|
80
|
-
'file_insert_line', 'file_str_replace', 'file_strs_replace', 'file_replace_lines', 'file_del_lines', 'file_ast_replace',
|
|
81
|
-
'view_file', 'create_file', 'line_hash', 'lnhash', 'lnhash_at',
|
|
82
|
-
'read_nb', 'write_nb', 'new_nb', 'mk_cell', 'validate_nb', 'validate_cell', 'repair_nb', 'repair_cell',
|
|
83
|
-
'view_cell', 'cell_insert_line', 'cell_str_replace', 'cell_strs_replace', 'cell_replace_lines', 'cell_del_lines', 'cell_ast_replace', 'Notebook', 'NbCell', 'find_cells', 'summary_nb']
|
|
84
|
-
|
|
85
|
-
__pyskill_params__ = {'replace_params': ('start_line', 'end_line', 'n_matches', 're_filter', 'invert_filter', 'use_regex')}
|
|
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
|
|
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
|