Skip to main content

Lavos: A Pythonic Cron Expression Serializer with Fluent Syntax.

Project description

Lavos: A Pythonic Cron Expression Serializer with Fluent Syntax

Lavos is an innovative Python library that simplifies working with cron expressions. It replaces the cryptic syntax of traditional cron expressions with a fluent, human-readable API. Lavos allows you to define cron schedules for your tasks intuitively, making schedule management in Python applications easier than ever.

Features

  • Fluent Syntax: Enjoy a fluent and expressive syntax for defining cron schedules, making your code more readable and maintainable.
  • AWS Cron Support: Compatible with traditional Unix and AWS cron expressions, providing versatility for different environments.
  • Syntax Sugars: Includes convenient syntax sugars for common scheduling patterns, allowing for more concise code.

Installation

Install Lavos using pip:

pip install lavos

Usage

Lavos offers a range of functionalities for scheduling tasks. Below are examples demonstrating its versatility:

Basic Usage

from lavos import Lavos, MON, JAN, FEB, MAR, WEEKDAYS

cron = Lavos()
  • Every 5 Minutes:
    # Cron: */5 * * * *
    cron.every(5).minutes
    
  • Every Hour:
    # Cron: 0 * * * *
    cron.every(1).hours
    
  • Daily at Specific Time:
    # Cron: 0 14 * * *
    cron.at("14:00").daily
    
  • Specific Weekday at Time:
    # Cron: 0 12 * * 5
    cron.at("12:00").on(THU)
    
  • First Day of Every Month:
    # Cron: 0 0 1 * *
    cron.on(1).monthly
    
  • Specific Days of Specific Months:
    # Cron: 0 0 15 1,2 *
    cron.on(15).of(JAN, FEB)
    
  • Every Weekday at Multiple Times:
    # Cron: 0 9,17 * * 1-5
    cron.at("09:00", "17:00").on(WEEKDAYS)
    
  • First Day of Spring:
    # Cron: 0 0 20 3 *
    cron.on(20).of(MAR).annually()
    

Using AWS Format

You can also create schedules using the AWS cron format:

cron = Lavos(format="aws")

# Every 5 minutes in AWS format
# */5 * * * ? *
cron.every(5).minutes

# Every weekday at 09:00 in AWS format
# 0 9 * * ? *
cron.at("09:00").on(WEEKDAYS)

Advanced Features

Contributing

We welcome contributions to Lavos! Whether it's adding new features, improving documentation, or fixing bugs, your input is valuable.

License

Lavos is released under MIT. See the LICENSE file for more details.

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

lavos-0.1.0.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lavos-0.1.0-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lavos-0.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Darwin/22.3.0

File hashes

Hashes for lavos-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b589e7d1e2d6a8c4be433e87ce3e520398b6d975db96bd0b96d2924d330952a2
MD5 7d36c0f665ba31346deda3cebf47e6ca
BLAKE2b-256 c6088c8f046b775fd4854464d6940de0d13fe0f9f902851072bc7dff5a9d6dd1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lavos-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.9.13 Darwin/22.3.0

File hashes

Hashes for lavos-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5dc1d9f9043554635eb621d9740fd482c25a7c754bf670fa7720308f529e58fb
MD5 53c7607d4aa07b7536315012461bab26
BLAKE2b-256 592a7eae595d784cff62c12f8855eca0f00a59ab6a144402a00d6248093ab085

See more details on using hashes here.

Supported by

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