File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,24 @@ def next(self) -> datetime: ...
2323
2424
2525class CronStr (str ):
26- """A cron expression validated via [`cron-converter`](https://pypi.org/project/cron-converter/)."""
26+ """A cron expression validated via [`cron-converter`](https://pypi.org/project/cron-converter/).
27+ ## Examples
28+ ```python
29+ from pydantic import BaseModel
30+ from pydantic_extra_types.cron import CronStr
31+
32+ class Schedule(BaseModel):
33+ cron: CronStr
34+
35+ schedule = Schedule(cron="*/5 * * * *")
36+ print(schedule.cron)
37+ >> */5 * * * *
38+ print(schedule.cron.minute)
39+ >> */5
40+ print(schedule.cron.next_run)
41+ >> 2025-10-07T22:40:00+00:00
42+ ```
43+ """
2744
2845 strip_whitespace : ClassVar [bool ] = True
2946 """Whether to strip surrounding whitespace from the input value."""
You can’t perform that action at this time.
0 commit comments