A simple Python Cron Expression lib
Project description
Python Cron Expression
Introduction
This is a simple library for making cron job expression. User need to pass timestamp or datetime object to create cron job expression.
Quickstart
Installation
Install from pypi:
pip install PyCronExpression
Feature List
Name | status |
---|---|
Timestamp or datetime object | done |
Minute | done |
Hourly | done |
Daily | Done |
Weekly | Comming |
Example
Timestamp or datetime object
from datetime import datetime
from py_cron_expression import CronJobExpression
cron_job = CronJobExpression()
timestamp = int(datetime.now().timestamp())
res = cron_job.cron_expression(time=timestamp)
print(res)
# Output
# 10 55 13 2 5 ? 2020
# If you want to remove second from in your cron job expression.
# Then you need to add cancel='second'
# example
cron_job.cron_expression(time=timestamp, cancel='second')
# Output
# 55 13 2 5 ? 2020
To learn more Documentation.
Changelog
See Changelog
License
MIT
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog. This project adheres to Semantic Versioning.
0.1.0 - 2020-05-28
Fixed
- Tuple comprehension in validations
0.1.1 - 2020-05-28
Fixed
- Fixed broken coverage svg
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
PyCronExpression-0.1.1.tar.gz
(4.9 kB
view hashes)
Built Distribution
Close
Hashes for PyCronExpression-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f362607fb75f47da6819d72d47d2c62e497201c3a7e8bc6a5d2d353e06a0f4a |
|
MD5 | 99504fccb02f3fd952a29c1189cc44d9 |
|
BLAKE2b-256 | 44a1002d14f1527a6b3163c8227df01d1733a2913805a9f94c64ecb2f9fcabf5 |