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 | done |
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
Built Distribution
File details
Details for the file PyCronExpression-1.0.0.tar.gz
.
File metadata
- Download URL: PyCronExpression-1.0.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90e5a9e39102223cab1000aae63e0a5b2d028ada9ae1d0a60f6ee98742043a6f |
|
MD5 | d0c0d6d830712d199f8999b6edbc2df4 |
|
BLAKE2b-256 | 79f5d787dd97ea815bfe3e8293ab7d828da6d9c28cc9cb32e4a8b6a3fd6d2869 |
File details
Details for the file PyCronExpression-1.0.0-py3-none-any.whl
.
File metadata
- Download URL: PyCronExpression-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f560df121e7ba58349bf9201aa32884c532225fc03fa89a104c80b0c401ede0c |
|
MD5 | e1ba931f8e0d1744da376a7e7b45d7ff |
|
BLAKE2b-256 | 33362a0dd8af15a2767a9814e3edcca218a7ed00789cd2dc264a9dcd5e854577 |