Skip to main content

a simple cron-job.org sdk

Project description

py-cron-org

A simple sdk for cron-job.org

Installation

pip3 install pycronorg

Usage

>>> 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)
>>> 
>>> 

Contributing

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:

  1. Fork the repository on GitHub.
  2. Create a new branch for your feature or bug fix.
  3. Make the necessary changes in your branch.
  4. Write tests to ensure the changes are working as expected.
  5. Submit a pull request with your changes.

License

The pycronorg is licensed under the MIT License.

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

pycronorg-0.0.10.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

pycronorg-0.0.10-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file pycronorg-0.0.10.tar.gz.

File metadata

  • Download URL: pycronorg-0.0.10.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pycronorg-0.0.10.tar.gz
Algorithm Hash digest
SHA256 780661ae6bcd59677e6f0a6a481e37c275c0d5124f8728c4dca501431b3f0e14
MD5 4e1ecb67b3eb813b3fa02d76759e44c6
BLAKE2b-256 d69974c38a2e9cc1e3afa05927f1479beb2e3828fff8ffa650d0c9bdba02e4c8

See more details on using hashes here.

File details

Details for the file pycronorg-0.0.10-py3-none-any.whl.

File metadata

  • Download URL: pycronorg-0.0.10-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pycronorg-0.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 3b6112477bb814bbf8e8972e1ecd358917244ce068689c9734b0f5895dbbff66
MD5 951d45d527eb7483e08f87924a0c03a3
BLAKE2b-256 df5d5a6f4072918fe70149af2be90c9ac7378ab0d9a3128bd19ea8073ffe5f37

See more details on using hashes here.

Supported by

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