You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4af4ce3
Browse filesBrowse the repository at this point in the historyBrowse files
Align repo with the Java and JS SDKs, and make the lint gate pass
The CI lint job could not pass: flake8 reported ~700 violations (mostly
from the generated package) and mypy 2 errors. Generated code is now
excluded from both, and the real issues in hand-written code are fixed:
18 malformed continuation lines, 6 overlong docstrings, and a
cast(Any, ...) in cardinality.py that was the intent behind the unused
cast import.
Packaging had three sources of version truth: pyproject.toml, setup.py,
and the generator-emitted requirements files, which nothing consumes.
pyproject is now the single manifest, matching the Java pom and the JS
package.json. generate-api.sh appended pytest-asyncio to
test-requirements.txt on every run; both files are now generator-ignored.
- publish.yml runs the test suite before building, 2-space indentation
like the other workflows, and spells PyPI correctly
- README: the API overview claimed every method accepts response_format;
analyze operations and determinize() take execution_timeout only. Added
the async notes after each table, as in the Java README, and fixed a
typo
- pinned openapi-generator 7.21.0, as in the Java and JS repos
- .gitignore rewritten in the shared layout, with .env and IDE entries
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -70,7 +70,8 @@ The API can handle terms in two formats:
70
70
-`regex`: a regular expression pattern
71
71
-`fair`: FAIR (Fast Automaton Internal Representation), a stable, signed format used internally by the engine
72
72
73
-
By default, the engine returns whatever the operation produces, with no extra convertion. Override with `response_format`:
73
+
By default, the engine returns whatever the operation produces, with no extra conversion. Override with `response_format`, accepted by the operations that return a term:
74
+
74
75
```python
75
76
from regexsolver import ResponseFormat
76
77
@@ -109,7 +110,7 @@ Timeout is best effort. The exact time is not guaranteed.
109
110
110
111
## API Overview
111
112
112
-
`RegexSolverClient` and `AsyncRegexSolverClient`exposes the following methods. All methods accept optional keyword arguments`response_format`and `execution_timeout`.
113
+
`RegexSolverClient` and `AsyncRegexSolverClient`expose the following methods. Every method accepts optional keyword arguments: operations that return a term take `response_format`, `deterministic`and `execution_timeout`, while analyze operations and `determinize()` take `execution_timeout` only — the response format is not theirs to choose.
113
114
114
115
### Analyze
115
116
@@ -126,6 +127,8 @@ Timeout is best effort. The exact time is not guaranteed.
126
127
|`client.is_deterministic(term, **kwargs)`|`bool`|`True` if the term's automaton is deterministic. Only a deterministic FAIR guarantees consistent string ordering across paginated `generate_strings()` calls; call `determinize()` first if this is `False`. |
127
128
|`client.subset(term1, term2, **kwargs)`|`bool`|`True` if every string matched by `term1` is also matched by `term2`. |
128
129
130
+
*Note: For `AsyncRegexSolverClient`, these methods are coroutines and must be awaited.*
131
+
129
132
### Compute
130
133
131
134
| Method | Return | Description |
@@ -138,12 +141,16 @@ Timeout is best effort. The exact time is not guaranteed.
138
141
|`client.repeat(term, min, max, **kwargs)`|`Term`| Computes the repetition of the term between `min` and `max` times. |
139
142
|`client.union(term1, term2, ..., **kwargs)`|`Term`| Computes the union of the given terms. |
140
143
144
+
*Note: For `AsyncRegexSolverClient`, these methods are coroutines and must be awaited.*
145
+
141
146
### Generate
142
147
143
148
| Method | Return | Description |
144
149
| -------- | ------- | ------- |
145
150
|`client.generate_strings(term, limit, offset, **kwargs)`|`List[str]`| Generates up to `limit` unique strings matched by `term`, skipping the first `offset` strings. |
146
151
152
+
*Note: For `AsyncRegexSolverClient`, this method is a coroutine and must be awaited.*
153
+
147
154
## Cross-Language Support
148
155
149
156
If you want to use this library with other programming languages, we provide:
0 commit comments