<commit_before># schedulord (Scheduler as a Service.)
**DISCLAIMER:** This is **just an implementation of a concept** not a product ready package.

Scheduler as a service over REST API. Basic workflow implemented here is as below
- write a job in python file
- send it to server
- scheduler takes care of the REST

Sounds like a lot of work!
KK then lets copy paste below examples to get started.

# Installation:
There is no package available in pypi as of yet.
```
$ # Make a virtual env 
$ mkvirtualenv testing
$ workon testing


$ git clone https://github.com/mayuroks/schedulord
$ cd schedulord
$ pip install -r requirements.txt
```

# Usage:
## Start the webserver

```
$ python server.py
```

## Start the scheduler
```
$ python scheduler.py
```
## Write a job
**main function** is what the scheduler will execute
```
$ cat dummy_job_files/great.py

from datetime import datetime

def main():
    print datetime.now()
```
Now we are ready to send our functions over REST API.

## CREATE a job
```python
$ ipython

from utils import task_sender

task_sender(file_path='dummy_job_files/great.py', interval=5, name='great task')

great.py has been uploaded

```

## Get all jobs
```python
$ ipython

from requests import get
HEADERS = {'Accept': 'application/json', 'Content-Type': 'application/json'}

r = get("http://1172.16.17.32:5000/jobs",headers=HEADERS)
r.json()
{u'jobs': {u'great task': {u'id': 1, u'interval': 5, u'name': u'great task'}}}

```
## DELETE a job
```python
$ ipython

from requests import delete
HEADERS = {'Accept': 'application/json', 'Content-Type': 'application/json'}

res = delete("http://127.0.0.1:5000/jobs/1",headers=HEADERS)
```

# Limitations

- This is **just an implementation of a concept** not a product ready package.

- The scheduling is not as exclusive as cron.

- Interval can only be specified in seconds. Hours, minutes, days are not handled.

- BUGS WILL show up.

# LICENSE
MIT
<commit_msg>some README updates<commit_after># schedulord (Scheduler as a Service.)
**DISCLAIMER:** This is **just an implementation of a concept** not a product ready package.

Scheduler as a service over REST API.I have written a [blog post](http://mayurrokade.com/blog/scheduler-as-a-service/) which explains the idea behind scheduler as a service.

Basic workflow implemented here is as below
- write a job in python file
- send it to server
- scheduler takes care of the REST

Sounds like a lot of work!
KK then lets copy paste below examples to get started.

# Installation:
There is no package available in pypi as of yet.
```
$ # Make a virtual env 
$ mkvirtualenv testing
$ workon testing


$ git clone https://github.com/mayuroks/schedulord
$ cd schedulord
$ pip install -r requirements.txt
```

# Usage:
## Start the webserver

```
$ python server.py
```

## Start the scheduler
```
$ python scheduler.py
```
## Write a job
**main function** is what the scheduler will execute
```
$ cat dummy_job_files/great.py

from datetime import datetime

def main():
    print datetime.now()
```
Now we are ready to send our functions over REST API.

## CREATE a job
```python
$ ipython

from utils import task_sender

task_sender(file_path='dummy_job_files/great.py', interval=5, name='great task')

great.py has been uploaded

```

## Get all jobs
```python
$ ipython

from requests import get
HEADERS = {'Accept': 'application/json', 'Content-Type': 'application/json'}

r = get("http://127.0.0.1:5000/jobs",headers=HEADERS)
r.json()
{u'jobs': {u'great task': {u'id': 1, u'interval': 5, u'name': u'great task'}}}

```
## DELETE a job
```python
$ ipython

from requests import delete
HEADERS = {'Accept': 'application/json', 'Content-Type': 'application/json'}

res = delete("http://127.0.0.1:5000/jobs/1",headers=HEADERS)
```

# Limitations

- This is **just an implementation of a concept** not a product ready package.

- The scheduling is not as exclusive as cron.

- Interval can only be specified in seconds. Hours, minutes, days are not handled.

- BUGS WILL show up.

# LICENSE
MIT

{'fraction_non_alphanumeric': 0.12409848296443671, 'fraction_numerical': 0.012932106441183784, 'mean_word_length': 4.2643979057591626, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3966711', 'n_tokens_mistral': 1349, 'n_tokens_neox': 1246, 'n_words': 492}