{"id":33231752,"url":"https://github.com/tsikov/clerk","last_synced_at":"2025-11-16T19:01:20.243Z","repository":{"id":46792130,"uuid":"81020315","full_name":"tsikov/clerk","owner":"tsikov","description":"A cron-like scheduler with sane DSL","archived":false,"fork":false,"pushed_at":"2021-10-05T15:39:03.000Z","size":19,"stargazers_count":19,"open_issues_count":2,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-02T22:12:27.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Common Lisp","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsikov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-05T20:35:46.000Z","updated_at":"2023-07-05T07:29:46.000Z","dependencies_parsed_at":"2022-09-14T00:11:31.199Z","dependency_job_id":null,"html_url":"https://github.com/tsikov/clerk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsikov/clerk","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsikov%2Fclerk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsikov%2Fclerk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsikov%2Fclerk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsikov%2Fclerk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsikov","download_url":"https://codeload.github.com/tsikov/clerk/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsikov%2Fclerk/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":284759739,"owners_count":27058842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-16T02:00:05.974Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-11-16T18:00:20.905Z","updated_at":"2025-11-16T19:01:20.238Z","avatar_url":"https://github.com/tsikov.png","language":"Common Lisp","readme":"# Clerk\n\nA cron-like scheduler with sane DSL\n\n## Example usage\n\n### Job MACRO\n\n```\n(job \"Say 'Hi' all the time\" every 5.seconds (print \"Hi\"))\n\n(job \"Compose and send monthly report\"\n     every 1.month (send-report (compose-monthly-report)))\n```\n\nIf you want to see it with your eyes, make sure to load the following code:\n\n```\n(defun write-to-file (msg file)\n  (with-open-file (log file\n                       :direction :output\n                       :if-exists :append\n                       :if-does-not-exist :create)\n    (format log \"~A~%\" msg)))\n\n(job \"Print farbe\" every 3.seconds (write-to-file \"Farbe\" \"log.txt\"))\n(job \"Print colour\" every 2.seconds (write-to-file \"Colour\" \"log.txt\"))\n(job \"Print @@@@ 1 min @@@@@\" every 1.minute\n       (write-to-file \"@@@@@@ 1 min @@@@@@\" \"log.txt\"))\n```\nNow, after `(clerk:start)`, tailing `log.txt` should give you something like this:\n\n```\nColour\nFarbe\nColour\nColour\nFarbe\nColour\nFarbe\nColour\nColour\nFarbe\nColour\n/one minute later.../\n@@@@@@ 1 min @@@@@@\n/etc.../\n```\n\n### Job FUNCTION\n\nThe original idea was for users to use the library to execute some sort of execution of a configuration file. However you can use the job creation process programatically with the underlying function `job-fn`. E.g.:\n\n```\n(defparameter *query-interval* 5)\n(job-fn (format nil \"Query the API every ~A seconds\" *query-interval*)\n        'every\n        `(,*query-interval* seconds)\n        #'query-api-fn)\n```\n\nAs you can see, you have to provide a function (either anonimous function or a function symbol) as the last argument.\n\n## Instalation and usage\n\nClone the repo inside `quicklisp/local-projects` and do `(ql:quicklisp :clerk)` in your REPL.\n\nMake sure your jobs are loaded before executing `(clerk:start)`. The jobs reside inside `clerk:*jobs*`, but you can also type `(clerk:calendar)` to see a list of all scheduled and running jobs. \n\n### Job types\n\nThere are two types of jobs - `continuous` and `one-time`. If a job has the keyword `every` after the job description - the job will be countinuous. This means that when an event is fired, a new event will be pushed in the event queue for firing exactly `interval` time from now. The jobs above are an example for `continuous` jobs.\n\nA `one-time` job is fired once and then it is removed from the jobs' queue. An example for a one-time job can be:\n\n```\n(job \"Extraordinary event\" in 5.days (send-mail \"Don't forget X\"))\n```\n\nYou can use any word instead of `in`.\n\n### Intervals\n\nRight now (more are coming soon) there are 2 type of intervals:\n\n1) **Numbered intervals**\n\n```\n[number].[interval-type]\n```\n\nwhere the number is a positive integer and the `interval-type` if one of the following: `second`, `minute`, `hour`, `day`, `week`, `month`, `year`. Also you can use the plural form of all these words. For example `1.second` and `2.seconds` are both valid.\n\n2) **Days of the week**\n\n```\n(job \"Weekly report\" every monday (create-report))\n```\n\nPretty self-explanatory. The idea is that if you type the day of the week, clerk will calculate when it is and add an event to the queue.\n\n## Issues / Contribution\n\nIf you have issues - open a github issue or contact me at `(reverse \"moc.liamg@vokist\")`. If you want to contribute - open an issue or make a PR. Thanks!\n","funding_links":[],"categories":["Python ##","Interfaces to other package managers"],"sub_categories":["Third-party APIs"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsikov%2Fclerk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsikov%2Fclerk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsikov%2Fclerk/lists"}