Skip to main content

Creates a regex_as_re_globally.pth to replace stdlib "re" module with "regex" module globally before any code runs.

Project description

regex_as_re_globally

This package does very unusual things, and you normally don't need it. It helps you use the "regex" package which is a backwards-compatible replacement for re, with additional features and better performance in some situations (and worse performance in others). Normally you can put import regex as re in your .py files and that's all you need.

However, if you want to use regex instead of re across your whole environment, even within 3rd-party libraries, then this package is for you.

Run pip install regex_as_re_globally to install this package. It will create a .pth file in site-packages which modifies sys.modules so that regex is used everywhere instead of re. This changes behavior within the whole python environment.

The wheel files generated are platform and python specific due to the limitations of wheel files, where the relative directory for site-packages needs to be determined at wheel building time, not install time. The directory is dependent on the version of python and the platform you are on.

The site-packages .pth technique is heavily inspired by https://github.com/dougn/coverage_pth and https://nedbatchelder.com/blog/201001/running_code_at_python_startup.html Thanks!

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

regex_as_re_globally-0.0.1.tar.gz (4.0 kB view details)

Uploaded Source

File details

Details for the file regex_as_re_globally-0.0.1.tar.gz.

File metadata

  • Download URL: regex_as_re_globally-0.0.1.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.26.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.7.8

File hashes

Hashes for regex_as_re_globally-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a7969f8c4e00612d2248585bfa9b35b36f0663d511398e77d68a40ac3e947773
MD5 0f3aa7774f4076c482f41efb41b0b570
BLAKE2b-256 213013b2dc7398ac824b075bb2a9ae3792d49997875c4ccbf91abad0871badc4

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