Skip to main content

Replace specific values ​​with custom variables

Project description

revar

PyPI PyPI - License Code style: black

Replace specific values ​​with custom variables

Installation

pip3 install revar

Examples

Input

import revar
text = "Hello, $username$\nNice to meet $who$"
output = revar.replace(text, {"$username$": "decave27", "$who$": "you"})
print(output)

Output

Hello, decave27
Nice to meet you
import revar

r = revar.Revar(prefix="$")
output = r.replace("Hello, $username\nNice to meet $who", username="decave27", who="you")
print(output)

Output

Hello, decave27
Nice to meet you

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

revar-0.3.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

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

revar-0.3-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file revar-0.3.tar.gz.

File metadata

  • Download URL: revar-0.3.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for revar-0.3.tar.gz
Algorithm Hash digest
SHA256 58821826df1955af966c77a4997ec2799aa70b0baaac38aa8348ec3b2eba4c22
MD5 0ec73cc8543478af59c256a03c16a49f
BLAKE2b-256 4fe0a163829c19ea9bc96f6717b177d6776d910be652bcb93fc38c544600ea01

See more details on using hashes here.

File details

Details for the file revar-0.3-py3-none-any.whl.

File metadata

  • Download URL: revar-0.3-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.2

File hashes

Hashes for revar-0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 76a1ea304188a0fd705299c251d35ea4617bbd18847e76c5f1600346cb9c82db
MD5 f1ddc9ffc55ff4f57f925c4e465dd533
BLAKE2b-256 d921bc4c51e91bb23a59206d19e4f3fbe4ddc065a9957ec62fdbb1de70e68e00

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