Skip to main content

Simple class for replace test with regex. Support scikit-learn transformer interface.

Project description

Regex Replacer

This is simple package for fast replace texts with regex. Support Rust regex syntax: https://docs.rs/regex/latest/regex/#syntax

Installation

pip install regex_replace --upgrade

Usage

from regex_replacer import RegexReplacerTransformer

transformer = RegexReplacerTransformer([
    (r'[0-9]+', " NUMBER "),
    (r"[a-z]+", " WORD ")
])
test_strings = [
    "this is a SIMPLE TEXT 12345 with number"
]
print(transformer.transform(test_strings))

# Output: [' WORD   WORD   WORD  SIMPLE TEXT  NUMBER   WORD   WORD ']

for multithread transform:

transformer = RegexReplacerTransformer([
        (r'[0-9]+', " NUMBER "),
        (r"[a-z]+", " WORD ")
    ], n_jobs=3)

to back to single thread:

transformer.to_single_thread()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

regex_replacer-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13t manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

regex_replacer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

regex_replacer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

File details

Details for the file regex_replacer-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 813fe271a42b7b21853ed1650264563aa3af99adfce7d59bc03b9341837de95e
MD5 d22582a5aecba00bb341df4dd73023ff
BLAKE2b-256 681599dfc0b2128e843e60630077a835ac53926f9566667fb42b92d4a7040a0b

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e33f068a70900947f083922acadb675470e897ca74f9326330b70e895063605b
MD5 f44f4452f11a1b68e606b65d353c30dc
BLAKE2b-256 aff01dca62da4c6f208cb97f6754a06a1bcf7b60ceac683b27ceea48a6b1243e

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f9ead9f3ea846daa772cd13809f49a9bdc46bc23a637fddf83a33d2e686776ec
MD5 64de9922d2c9957dcbcc4b83c598ed77
BLAKE2b-256 0eb26c239ca03f7ab45997709d9fe9c7887ecf182691f0f8b6b7b89852c8f356

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9261f3781d8133fa9e7b981deb19e0f6ac556ccddad2c0c310b77b5cb4a62ed4
MD5 9ef5134fa277cfb736964c2982047b3c
BLAKE2b-256 8901aa21f8b37decd5f5f9b250e459b06b4a2ac507b37d91b95ec99e4dc31d6a

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc8d8c8560634ee016a5ba3ae9e5fca9e5f80d7608d69eb890341a0f1a509270
MD5 80706d648ad9896d9281d3dc38914873
BLAKE2b-256 c0e8d0dc42492e0d1b1c38a243c250bfaffb265c8a53d2bda14a2e5ecc1168a5

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2837d290fb4ae7fdd2a2ef0a5d81beb8bcf6b3f1f401b726c04d81c854d1771e
MD5 30081aa1315ac1c3a19298956c5b15b2
BLAKE2b-256 09c58ed4d5109349a04845a985deae486ac8ca2626c56f7975a2bd2a879dd84e

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fcc368ea3c38046ce3783f0b215fbcd5328c79a2216562d073038567a3b61651
MD5 236b2546cd6657572924eb2e628ff29e
BLAKE2b-256 6f7f584140759c447970f8913d94c37281c5331bf26b53d3ba888b7c4c0bf9e0

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1fb8355e1046c82e05d4fffd9e283df5a470e784f416e9773cba6298caefb29e
MD5 92dba4c412dcf02555fb13f5d865361e
BLAKE2b-256 42b8fcdae37b51210396137bbb2d65bda20182985e2ea14f7971be845990b815

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4727525d219389b2cadea45139e71b5dd952130a4745e983c43398cb211aa5aa
MD5 50b011de4e0deb88d6e1ce87d3cc224d
BLAKE2b-256 02a47339c322b93a3d69a846ce9cbfe88d4fbffa95cd43f2ff8d9de842046ad6

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7df7ab315e5b090768965b53be782e37631fc655775f674d3d5486f5ed6a3178
MD5 99fbe666920cc9b409b270c516b904e1
BLAKE2b-256 95029e60499f04cf144453006774375833b2e9deddea42e0cf190f8c0c0051dc

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2498a0a121260a613d8e16f02adf8024697a40a57c2546758d4826aa22659326
MD5 c01afddc627a122a788ed3006212cf43
BLAKE2b-256 ed4a9da3d6ff9797e7255a3e5f40e549c782d4a351a1416cb177754e87451d50

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7af17d7e8778a861af02e9d4a00c58c79290129de7fab72180cf15ea7caa7c80
MD5 779d74f28fee1bb4dbd1fede857a0ccf
BLAKE2b-256 538f2bd1092abcf06ca1e44448a7a2e01be3b0b9575afaf5585f3cd18f7c638b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page