Giter VIP home page Giter VIP logo

py-cron-org's Introduction

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.

py-cron-org's People

Contributors

axdjuraev avatar

Stargazers

Safarov Dilboz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.