Skip to content

Instantly share code, notes, and snippets.

@arcanadev
Last active April 28, 2022 21:26
Show Gist options
  • Save arcanadev/56719d3454bc61f6f78ef33190cae21a to your computer and use it in GitHub Desktop.
Save arcanadev/56719d3454bc61f6f78ef33190cae21a to your computer and use it in GitHub Desktop.
Using the adTempus API from Python #adTempus #api #version4

This sample demonstrates how to use the adTempus API from Python.

Background and Requirements

The adTempus API is only available as a .NET assembly, but can be referenced from Python by using Python.NET.

Refer to the Python.NET documentation for installation instructions. Once Python.NET is installed, your Python code can reference the adTempus client assembly as shown below.

import clr
#Add a reference to the adTempus client assembly and import its types
clr.AddReference("C:\\Program Files\\Arcana Development\\adTempus\\4.0\\ArcanaDevelopment.adTempus.Client.dll")
from ArcanaDevelopment.adTempus.Client import *
from ArcanaDevelopment.adTempus.Shared import *
#create a connection to adTempus on the local server
serverName="."
connection = Scheduler.Connect(serverName, LoginAuthenticationType.Windows, "", "")
print("Successful connection to adTempus on " + connection.HostComputer + ", running version " + connection.ServerVersion.ToString())
#start a new context
context=connection.NewDataContext()
#fetch all jobs and list their names
jobs=context.GetJobs("*")
for job in jobs:
print(job.FullyQualifiedName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment