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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded CPython 3.13tmanylinux: glibc 2.28+ x86-64

regex_replacer-0.1.4-cp313-cp313-win_amd64.whl (751.3 kB view details)

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.4-cp312-cp312-win_amd64.whl (751.3 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.4-cp311-cp311-win_amd64.whl (751.2 kB view details)

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.4-cp310-cp310-win_amd64.whl (751.2 kB view details)

Uploaded CPython 3.10Windows x86-64

regex_replacer-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.4-cp39-cp39-win_amd64.whl (751.2 kB view details)

Uploaded CPython 3.9Windows x86-64

regex_replacer-0.1.4-cp39-cp39-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

regex_replacer-0.1.4-cp38-cp38-win_amd64.whl (751.2 kB view details)

Uploaded CPython 3.8Windows x86-64

regex_replacer-0.1.4-cp38-cp38-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.28+ x86-64

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp313-cp313t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0238ea9177ce14bae6aa8da9478c94c439d8a4d38e58a814b49b7ddbc8115050
MD5 1ad4f48baa76e839c6b1c1b296a701a7
BLAKE2b-256 9ef4d36b03421568e909fd5dcc7cdeb2b0aa09715a5e9161b980aa7221033b85

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.4-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 1e6a3e1207eee8131df96424e153cb10cae854d1d88bf953e324093f4622c982
MD5 76dc901b6e1ccf1a7333ddf010043ce2
BLAKE2b-256 3557fd2722234795779c270df117a8b3bf52485c4e3553fbb2c7d56ae7123a32

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d076c6eb38203f0e0665d64570d14b09166f3102503f4be2ab04808b498c68e7
MD5 84771223e95a70ef185e53ae47b6800e
BLAKE2b-256 32f0b0d54ee8d00706170474a4a2fa85fac663fd52211b0adb1d66026feb1cf3

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.4-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0e7687e63f124f028c326a0987bc002820921c8f0cbbe50fd7ead64ddef2f360
MD5 c7c5921d83cd90acad23f145f9419ce9
BLAKE2b-256 81e22b32ffebd04f7ff65d6a100137a32c05497752162f53b2159c2230386148

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2fb5ca2cfe84a51da215b179b3dc92a71f469a312691517cffa25ccd472db074
MD5 0ba133e84ec85d5f4f3da29c3992d5d1
BLAKE2b-256 2176bfe8f873056a9f8ab7ec7b20d8b32025f01d79b3cc902eac45d2e20ff30c

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.4-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 1d23c793019ab028f6fc67a27b30649df2725a5b1869c3969121cd354c4dec1e
MD5 64b648d533478c74206538320bf72fc1
BLAKE2b-256 8f4dc615b3dcd70e3eb5f051bc405a9f2bbd43ae0c2d917e27ba5dc6698ce46c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30189880a298ffe2f0cd6d819513a3562ea9eccbc0d4a03e0f1bfc95d27806fd
MD5 5fa0362c560c1522e30a49d2da03cea2
BLAKE2b-256 0934091b7a04868d963cdc0e8dc5ddc81fde4700ffc347752ced95711e9f0d0f

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.4-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c00fccc4513b5d5777fff2dfffc3a8f7dc9f9f45f18f2cc97fca8fa9d2a98548
MD5 8c7b53a210862c0c7e59dc17b9c1070d
BLAKE2b-256 714ec161847104db0008192710b6c018c279faf158d0972da474d17f89f6a350

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 638403607487dfa3465230a6c72e89b7b38ae4e8da499f48c155dc0a612f4b4c
MD5 f0a1e9f91e93ba8f2d9eac79661c2cf5
BLAKE2b-256 9ecd787f8d768c1b932e3edf8df20e7964f71989159a3113fa2e408718ecc553

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.4-cp39-cp39-win_amd64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 e3c4e348e9b956e5fca58e56cefdbb41605d43c2048c240e3e3d2b6d21906c41
MD5 73e9749a6c268cdba0415d924c6b6526
BLAKE2b-256 e8be385980cecec70d56226b936e8ad621fdebe738f1f8dae3be9f9cc25b91b7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 edfe7846400f65bf25cca35f007c570d0d11f9301dc1e6fc19a310dbaa73e492
MD5 9d528b5646e644e6a54caf97045f5e0c
BLAKE2b-256 527115cc81408bd5cc70cb3aa702e0debb27a4ae0badbab0562c83d669903b1e

See more details on using hashes here.

File details

Details for the file regex_replacer-0.1.4-cp38-cp38-win_amd64.whl.

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 8e3dbf88c3de9fa40c2ce4366513a0653814345c5829a60d74efe00b1780bd17
MD5 3c024476685616a48abe0ef44b4c4464
BLAKE2b-256 74321c45afa0a15becafe075c8832b26f070b76e2c682e21e2208bf31fcf566d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for regex_replacer-0.1.4-cp38-cp38-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 25b1870417cf6bb43feec6c2cf925635dbe880f77e472699921301cbbbf346bf
MD5 4bac8ed833b7c122dc339a14a32b3210
BLAKE2b-256 0b93af063eb259da2ea7e0c2bfe8bb127b484c7bfa6587f5ba42c16f51888ae8

See more details on using hashes here.

Supported by

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