https://github.com/kirbs-/text2cron
Use natural language to create a cron expression
https://github.com/kirbs-/text2cron
airflow cron-expression
Last synced: over 1 year ago
JSON representation
Use natural language to create a cron expression
- Host: GitHub
- URL: https://github.com/kirbs-/text2cron
- Owner: kirbs-
- Created: 2019-12-16T17:49:33.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-16T18:07:54.000Z (over 6 years ago)
- Last Synced: 2025-02-28T14:46:27.139Z (over 1 year ago)
- Topics: airflow, cron-expression
- Language: Python
- Homepage:
- Size: 4.88 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# text2cron
Convert a word phrase to a cron schedule expression. Make it easy for non-technical people to use cron expressions to schedule cron tasks.
## Examples
Verbose phrase
```python
>>> from text2cron import CronExp
>>> phrase = 'Tuesdays @1pm'
>>> cron_expression = CronExp(schedule_phrase = phrase)
>>> cron_expression
'Tues @1am CT cron expression "0 1 * * 2"'
>>> str(cron_expression)
'0 1 * * 2'
# Convert to UTC
>>> import pendulum
>>> pendulum.now().tzname()
'EST'
>>> str(cron_expression)
'0 1 * * 2'
>>> cron_expression.utc
'0 7 * * 2'
```
## Installation
`pip install text2cron`
## Enhancements
- convert between timezones.
- convert cron expression to word phrase.