Skip to main content

A simple Python Cron Expression lib

Project description

Python Cron Expression

PyPI version Coverage GitHub version

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

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

Uploaded Source

Built Distribution

PyCronExpression-0.1.0-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: PyCronExpression-0.1.0.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for PyCronExpression-0.1.0.tar.gz
Algorithm Hash digest
SHA256 166029d4f4f1c8679a6871f37da0e875a826fe2e2fb763b388f811e8eb521868
MD5 7ef9246be9735771db9714e2818b44bf
BLAKE2b-256 0d94d4546569d8b2e4534357dd91607fc784e4c38624e87285a1fe83989a1a18

See more details on using hashes here.

File details

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

File metadata

  • Download URL: PyCronExpression-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.8 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/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.3

File hashes

Hashes for PyCronExpression-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 dbaff488c1eee940710b181100f44af04cd7caf1bfe58b815c0046fce923b0c6
MD5 b569fc8228b69b60c700ef66835f6506
BLAKE2b-256 63221fbb1c68ec44309a5829a412823b5a08f2bb697577729482c741e90eef1a

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