Metadata-Version: 2.1
Name: schedules
Version: 1.3
Summary: Create non-blocking scheduled tasks.
Home-page: https://github.com/YishaiYosifov/schedules
Author: YishaiYosifov
Author-email: yishai247@gmail.com
License: MIT
Keywords: schedule,task,nonblocking,scheduler,non-blocking,schedules
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Description-Content-Type: text/markdown


# Schedules - Create non-blocking scheduled tasks.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install schedules.

```bash
pip install schedules
```

## Usage

### Timer

Here is a simple timer scheduled task example.

After 3 days, 1 hour, 30 minutes and 10 seconds `task` will execute.

```python
import schedules

# example task

def task(argument):
    print(argument)

# initialize a timer

timer = schedules.timer()

# Start the timer.

# "repeat=True" means the task not execute only once,
# it will execute every 3 days, 1 hour, 30 minutes and 10 seconds infinite times.

timer.day(3).hour(1).minute(30).second(10).start(target=task, args=("Example",), repeat=True)
```

If the task is asynchronous, You can do this:

```python
import schedules

# example task

async def task(argument):
    print(argument)

# initialize a timer

timer = schedules.timer()

# Start the timer.

timer.day(3).hour(1).minute(30).second(10).start(target=task, args=("Example",), asynchronous=True)
```

### Every

If you don't want the task to execute at a certain time, you can use `every`.

Every time the minutes are 0 (every new hour), `task` will execute.

```python
import schedules

# example task

def task(argument):
    print(argument)

# initialize "every"

every = schedules.every()

# Start the timer.

# "repeat=True" means the task not execute only once,
# it will execute every time the minutes are 0 (every new hour) infinite times.

every.minute(0).start(target=task, args=("Example",), repeat=True)

# This code will execute the task at 2:30pm and 10 seconds everyday:

every.hour(14).minute(30).second(10).start(target=task, args=("Example",), repeat=True)
```

If the task is asynchronous, You can do this:

```python
import schedules

# example task

async def task(argument):
    print(argument)

# initialize "every"

every = schedules.every()

# Start the timer.

every.hour(14).minute(30).second(10).start(target=task, args=("Example",), asynchronous=True)
```

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)

