Package: cronyx-client
CronyxClient.pyAPI|Code of Conduct|Contributing|ChangelogA Python HTTP client wrapper forCronyxServer, seamlessly integrating the power ofCronyxacross platforms using a familiar API interface.🌟 FeaturesCronyxClient.py bridges the capabilities of Cronyx and CronyxServer, offering a way to schedule and manage tasks without losing the feel of the originalCronyx API.Why CronyxClient.py?🌐Unified Experience: Retain the simplicity and power of the Cronyx API while benefiting from the language-agnostic capabilities of CronyxServer.🔌Plug & Play: With just a URL configuration, connect to any running instance of CronyxServer and harness its capabilities without changing your existing Cronyx codebase.🚀Familiar API with Async/Await: Use the same API calls you're familiar with from Cronyx, with the added advantage of Python'sasyncandawaitsyntax for handling asynchronous operations.🚀 Getting StartedInstallationInstall the CronyxClient.py package using pip:$pipinstallcronyx-client# or# $ poetry add cronyx-clientBasic Usage1. Manually Handling Job Execution:CronyxClient.py mirrors the usage of Cronyx, with the additional specification of the CronyxServer URL:fromcronyx_clientimportCronyxClientcronyx=CronyxClient(url="http://localhost:3000/")job=awaitcronyx.request_job_start(job_name="hourly-job",job_interval="0 * * * *",)# Check if the job is due to runifjob:try:print(job.interval_started_at)print(job.interval_ended_at)awaitjob.finish()exceptExceptionase:awaitjob.interrupt()2. Using the Shorthand Callback:fromcronyx_clientimportCronyxClientasyncdeftask(job):print(job.interval_started_at)print(job.interval_ended_at)cronyx=CronyxClient(url="http://localhost:3000/")awaitcronyx.request_job_exec(job_name="hourly-job",job_interval="0 * * * *",task=task)Integrations and CompatibilitiesCronyxClient.py is built on top of the Cronyx foundation, ensuring compatibility and integration with:Cronyx: Maintain the same API functions and structures, ensuring a seamless transition to CronyxClient.py.CronyxServer: Directly communicates with the server using its RESTful endpoints, translating your Cronyx API calls to HTTP requests.💻 DevelopmentUsing Visual Studio Code and theDev Containersextension, you can simplify the development environment setup process. The extension allows you to develop inside a Docker container and automatically sets up the development environment for you.Install theDev Containersextension in Visual Studio Code.Clone the repository:gitclonehttps://github.com/yujiosaka/CronyxClient.py.gitOpen the cloned repository in Visual Studio Code.When prompted by Visual Studio Code, click "Reopen in Container" to open the project inside the Docker container.The extension will build the Docker container and set up the development environment for you. This may take a few minutes.Build and run the Docker container with Docker Compose:$docker-composeup--buildThis will start testing in watch mode.🧑‍💻️ API referenceSeeherefor the API reference.🐞 Debugging tipsEnable debug loggingConfigure the log level using theLOG_LEVELenvironment variable.envLOG_LEVEL="DEBUG"pythonscript.pyCronyxClient.py utilizes Python'sloggingmodule for logging debug messages. Ensure that you have the logger configured in your application to capture these logs.💳 LicenseThis project is licensed under the MIT License. SeeLICENSEfor details.