String wrangling for bulk find-and-replace operations
Project description
stringle
String wrangling for bulk find-and-replace operations. Example:
from stringle import Directory, Replacer
replacements = [
('old_text', 'new_text'),
('another_old', 'another_new'),
]
directory = Directory(path='/path/to/directory')
replacer = Replacer(files=directory.selected_files)
replacer(replacements)
Features
- Recursive directory traversal - Process entire directory trees with the Directory class
- Multiple replacements - Apply many find-and-replace operations in one pass
- Case sensitivity control - Case-sensitive or case-insensitive matching
- Regex support - Use regular expressions for complex patterns
- Flexible filtering:
- Ignore specific directories (e.g.,
.git,.venv,node_modules) - Ignore specific files
- Filter by file extension (ignore or include specific extensions)
- Ignore specific directories (e.g.,
Installation
We're on pypi, so uv add stringle.
If working directly on this repo, consider using the simplest-possible virtual environment.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
stringle-0.2.1.tar.gz
(26.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stringle-0.2.1.tar.gz.
File metadata
- Download URL: stringle-0.2.1.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2db86a806056334598437d5b9c15277cb957a627bef5bda12986615c23ea32aa
|
|
| MD5 |
7b345f7008244f9d6b75f00ff2efed65
|
|
| BLAKE2b-256 |
78a6dd2e8165d782296d65dcfc4b7d75284a46d0c4a9b30380ffbdc7f11481fc
|
File details
Details for the file stringle-0.2.1-py3-none-any.whl.
File metadata
- Download URL: stringle-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
615600bb017b313767c3ef0a7569a5cba419abb4660341d58927e7771bb0fd61
|
|
| MD5 |
95ab3bb6d14382bc3329de667daa062b
|
|
| BLAKE2b-256 |
6c3dbb908cdc21424985e7eda1b6ef99b6caced3a67090d168c5d36cca37cd1d
|