Next-gen string pattern DSL & compiler
Project description
STRling for Python (Quick Start)
🗺️ Overview
This is the Python binding for STRling, a next-generation production-grade syntax designed as a user interface for writing powerful regular expressions (RegEx).
STRling makes string validation and matching readable, safe, and consistent across environments. Instead of cryptic regex syntax, you build patterns using a clean, object-oriented DSL. Under the hood, STRling compiles to native RegEx engines — but adds instructional error handling and consistent semantics.
🗝️ Key Features
- Beginner Friendly: No regex jargon required.
- Reliable: Built only on standard libraries.
- Instructional Errors: Explains what went wrong and how to fix it.
- Consistent: Works across frameworks and libraries without custom validators.
- Multilingual: Available across popular programming languages (JavaScript, and more coming soon).
💾 Installation
Install STRling via pip:
pip install STRling
✨ STRling in action!
Basic Example: US Phone Number
from STRling import simply as s
import re
# Define parts of a US phone number pattern
separator = s.in_chars(" -")
area_code = s.merge(
s.may("("),
s.group("area_code", s.digit(3)),
s.may(")")
)
central_part = s.group("central_part", s.digit(3))
last_part = s.group("last_part", s.digit(4))
phone_number_pattern = s.merge(
area_code,
s.may(separator),
central_part,
s.may(separator),
last_part
)
# Compile to RegEx
example_text = "(123) 456-7890 and 123-456-7890"
pattern = re.compile(str(phone_number_pattern))
matches = pattern.finditer(example_text)
for match in matches:
print("Full Match:", match.group())
print("Area Code:", match.group("area_code"))
print("Central Part:", match.group("central_part"))
print("Last Part:", match.group("last_part"))
📚 Complete API Documentation
For comprehensive syntax reference and all available features, see the Python API Reference.
📖 Related Documentation
- Python API Reference: Complete API documentation for Python
- Developer Documentation Hub: Architecture, philosophy, and development workflow
- Formal Specification: Grammar and semantics reference
- JavaScript Binding: STRling for JavaScript/Node.js
💖 Support
If you find STRling useful, consider buying me a coffee.
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
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 strling-2.5.9.tar.gz.
File metadata
- Download URL: strling-2.5.9.tar.gz
- Upload date:
- Size: 33.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
784c43b2ede05ac6216ae43bf3b4e210136bad064ae5ae08986dfe1e562923a4
|
|
| MD5 |
636b9c3c26972878dfada4df46888bac
|
|
| BLAKE2b-256 |
123c357b658ded42846359c4493c437b1e1f6a35a5baca35d47ae522c34f4754
|
Provenance
The following attestation bundles were made for strling-2.5.9.tar.gz:
Publisher:
ci.yml on TheCyberLocal/STRling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strling-2.5.9.tar.gz -
Subject digest:
784c43b2ede05ac6216ae43bf3b4e210136bad064ae5ae08986dfe1e562923a4 - Sigstore transparency entry: 702145811
- Sigstore integration time:
-
Permalink:
TheCyberLocal/STRling@59a81413382ca9e7c7052dc2a08afb51f147af27 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TheCyberLocal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@59a81413382ca9e7c7052dc2a08afb51f147af27 -
Trigger Event:
push
-
Statement type:
File details
Details for the file strling-2.5.9-py3-none-any.whl.
File metadata
- Download URL: strling-2.5.9-py3-none-any.whl
- Upload date:
- Size: 38.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73d031a86953ca7cdf143425b0c15f4003c3e78e83eb17c47577809cb8905918
|
|
| MD5 |
d6654eacea3a1961fcf2e35af68a6404
|
|
| BLAKE2b-256 |
6a86709def1e17fe46b559d8fd5ba1f5d9cceaef073a2bbf84694c358d1a044b
|
Provenance
The following attestation bundles were made for strling-2.5.9-py3-none-any.whl:
Publisher:
ci.yml on TheCyberLocal/STRling
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
strling-2.5.9-py3-none-any.whl -
Subject digest:
73d031a86953ca7cdf143425b0c15f4003c3e78e83eb17c47577809cb8905918 - Sigstore transparency entry: 702145813
- Sigstore integration time:
-
Permalink:
TheCyberLocal/STRling@59a81413382ca9e7c7052dc2a08afb51f147af27 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/TheCyberLocal
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@59a81413382ca9e7c7052dc2a08afb51f147af27 -
Trigger Event:
push
-
Statement type: