Skip to main content

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.

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


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.0.1.tar.gz (2.6 kB view details)

Uploaded Source

Built Distribution

PyCronExpression-0.0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file PyCronExpression-0.0.1.tar.gz.

File metadata

  • Download URL: PyCronExpression-0.0.1.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

Hashes for PyCronExpression-0.0.1.tar.gz
Algorithm Hash digest
SHA256 95d1444b64f4234838452fc7bd5b87f4087a5e4839fe7e78180b9cbb90efbe53
MD5 5ec2e3c1d30943cfa38b7ce9de3e4442
BLAKE2b-256 55545b09fb690c22ef631fc9e242c5856a934b42c4c2a7c7775122bc09f75095

See more details on using hashes here.

File details

Details for the file PyCronExpression-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: PyCronExpression-0.0.1-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

Hashes for PyCronExpression-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9ab9dc45b61abbf2b62e9642c454030f19e3823df5f48351baadd23e00ade1f8
MD5 c05d9ab677301a4af18268f70d4be6d4
BLAKE2b-256 2668a607d0e9dc8d8bdac9dcc190ba7cb0153fbced71bb640ecd851b83def887

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page