A simple sdk for cron-job.org
pip3 install pycronorg
>>> import os
>>> from dotenv import load_dotenv
>>> from pycronorg.sync import JobsApi
>>>
>>>
>>> assert load_dotenv()
>>> token = os.environ['CRON_ORG_TOKEN']
>>> api = JobsApi(token)
#-------------------------------------create-------------------------------------
>>> job = api.create(
... api.Schema(
... title='hi, cron-job.org',
... url='http://example.com',
... scheldule=api.SchelduleSchema(
... hours=[12],
... minutes=[0],
... ),
... )
... )
#------------------------------------get-job-------------------------------------
>>> assert api.get(job.jobId)
#-------------------------------------update-------------------------------------
>>> api.update(
... api.SchemaUpdate(
... jobId=job.jobId,
... scheldule=api.SchelduleSchema(
... hours=[13],
... minutes=[0],
... )
... )
... )
#--------------------------------retrieve-history--------------------------------
>>> history = api.retrive_history(job.jobId)
#------------------------------------get-all-------------------------------------
>>> jobs = api.all()
#-------------------------------------delete-------------------------------------
>>> api.delete(job.jobId)
>>>
>>>
We welcome contributions from the developer community to improve the pycronorg. If you are interested in contributing to the pycronorg, please follow the steps below:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix.
- Make the necessary changes in your branch.
- Write tests to ensure the changes are working as expected.
- Submit a pull request with your changes.
The pycronorg is licensed under the MIT License.