A simple Python Cron Expression lib
Project description
Python Cron Expression
This is a simple library for making cron job expression. User need to pass timestamp or datetime object to create cron job expression.
Installation
pip install PyCronExpression
Example
from datetime import datetime
from py_cron_expression.py_cron 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
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
File details
Details for the file PyCronExpression-0.0.2.tar.gz
.
File metadata
- Download URL: PyCronExpression-0.0.2.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e46a98856af77539ef63a7e2a735f43226342d93e1f8efc04c5e65c55787bfe5 |
|
MD5 | 3de03aba6bfe50fdc48b292a04ebff8b |
|
BLAKE2b-256 | 6a4bd039887f6d60fd92515ef5d3475ccc65357cd1b06a49d6e5d10e511ce7ae |
File details
Details for the file PyCronExpression-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: PyCronExpression-0.0.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7c5e1d7094cc8cb443591c0fa9d18b5535ba9b11339ad4e2f8d36c0eb043477 |
|
MD5 | d5ce58fa38e45576b5b7a59d04a1c982 |
|
BLAKE2b-256 | 33a22428df615ecedaf4205a92af6c72be863bf472a89c23c258714fd31eb911 |