This is a library based on the ex command.
Project description
Yet Another EX command library
This is a library based on the ex command. So, it works the same way :)
Usage
from yaex import *
result = yaex(
append("Hello"),
append("World"),
)
print(result)
# >Hello
# >World
# >
result = yaex(
append("first line"),
append("second line"),
append("third line"),
go_to(2),
delete(),
)
print(result)
# >first line
# >third line
# >
result = yaex(
append("first line"),
append("second line"),
append("third line"),
move(-1),
delete(),
)
print(result)
# >first line
# >third line
# >
result = yaex(
append("first line"),
append("second line"),
append("third line"),
search("second"),
delete(),
)
print(result)
# >first line
# >third line
# >
result = yaex(
append("# yaex\n\nThis is a library based on the ex command.\n"),
go_to_first_line(),
delete(),
insert("# Yet Another EX command library"),
)
print(result)
# ># Yet Another EX command library
# >
# >This is a library based on the ex command.
# >
result = yaex(
append("first line\nsecond line\nthird line\nfourth line\nfifth line\nsixth line\n"),
delete().from_range(search("second"), search("fifth")),
)
print(result)
# >first line
# >sixth line
# >
result = yaex(
append("first line\nsecond line\nthird line\nfourth line\nfifth line\nsixth line\n"),
substitute("line", "LINE").from_range(go_to_first_line(), go_to_last_line()),
)
print(result)
# >first LINE
# >second LINE
# >third LINE
# >fourth LINE
# >fifth LINE
# >sixth LINE
# >
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yaex-1.0.0.tar.gz
(4.8 kB
view details)
Built Distribution
yaex-1.0.0-py3-none-any.whl
(4.5 kB
view details)
File details
Details for the file yaex-1.0.0.tar.gz
.
File metadata
- Download URL: yaex-1.0.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.15.57.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be0ed5c39556ae7255d70cb9e65d066c7db26284f9de87dd64cb7b119f7786de |
|
MD5 | c70c796eecf902fd51e7d49157621218 |
|
BLAKE2b-256 | c3e4f48043405e87b165cd5ea6290f44e1fd847d5b960aba2c42e51d73625840 |
File details
Details for the file yaex-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: yaex-1.0.0-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.14 CPython/3.10.5 Linux/5.15.57.1-microsoft-standard-WSL2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be49f42f221abb340647cb4d808a6c7c48da0f67519f8748da2338bef430b1d |
|
MD5 | 58e8d8f0140ab3243ba23284055d58b7 |
|
BLAKE2b-256 | 986ab63f2a49158b30d9b07a4db7aa21eac21f1b5b8a6c0908254005e3ceadac |