Skip to main content

D-Tools System Integrator API Python interface

Project description

dtools-si

Python interface for the D-Tools System Integrator (SI) API.

Overview

dtools-si provides a lightweight client for working with the D-Tools SI endpoints, including subscribe APIs for:

  • Projects
  • Service Orders
  • Service Plans
  • Time Sheets
  • Tasks

The package is built around a shared base client that handles authentication, request headers, and common query parameters.

Requirements

  • Python 3.11+
  • python-dotenv==1.2.1
  • requests==2.32.5

Installation

Install from source or from a package repository if available:

pip install dtools-si

For editable development installs:

pip install -e dtools-si

Configuration

The client requires a valid D-Tools SI API key.

Create a .env file in your project root:

DTOOLS_API_KEY=your_api_key_here

Then load it in your application or tests using python-dotenv.

Quick Start

from dtools_si.subscribe.projects import SubscribeProjectsAPI
from dotenv import load_dotenv
from os import getenv

load_dotenv()
api_key = getenv("DTOOLS_API_KEY")

client = SubscribeProjectsAPI(api_key=api_key)
response = client.get_projects(include_archived=True)
print(response.status_code)
print(response.json())

API Summary

DToolsSI

Base client for the D-Tools SI API.

from dtools_si import DToolsSI
client = DToolsSI(api_key="YOUR_API_KEY")

The client exposes internal helpers used by derived subscribe APIs:

  • _request(method, path, params)
  • _get_resource(resource, ...)
  • _get_resource_id(resource, id, ...)
  • _mark_as_imported(resource, id, ...)

SubscribeProjectsAPI

Use this class to access project-related subscribe endpoints.

  • get_projects(...)
  • get_project(project_id, co_number=None, aggregate_by=None, get_adjustments_by_item=None)
  • get_project_comments(project_id, page_number=1, page_size=50)
  • mark_project_as_imported(project_id, co_number=None)

SubscribeServiceOrdersAPI

Service order subscribe endpoints.

  • get_service_orders(...)
  • get_service_order(service_order_id)
  • get_mobile_install_site_notes(service_order_id)
  • mark_service_order_as_imported(service_order_id)

SubscribeServicePlansAPI

Service plan subscribe endpoints.

  • get_service_plans(...)
  • get_service_plan(service_plan_id)
  • mark_service_plan_as_imported(service_plan_id)

SubscribeTimeSheetsAPI

Time sheet subscribe endpoints.

  • get_timesheets(...)
  • get_timesheet(timesheet_id)
  • mark_timesheet_as_imported(timesheet_id)

SubscribeTasksAPI

Task subscribe endpoints.

  • get_tasks(...)
  • get_task(task_id)
  • get_mobile_install_site_notes(task_id)
  • get_tasks_by_project(project_id)
  • mark_task_as_imported(task_id)

utils.remove_none_values

Utility helper that removes None values from request parameter dictionaries.

Running Tests

The project includes basic initialization and API integration tests.

pytest

Tests use environment variables defined in .env:

  • DTOOLS_API_KEY
  • DTOOLS_TEST_PROJECT_ID
  • DTOOLS_TEST_PROJECT_CO_NUMBER
  • DTOOLS_TEST_SERVICE_ORDER_ID
  • DTOOLS_TEST_SERVICE_PLAN_ID
  • DTOOLS_TEST_TIMESHEET_ID
  • DTOOLS_TEST_TASKS_ID

Notes

  • All request methods return a requests.Response object.
  • The package communicates with the D-Tools SI API at https://api.d-tools.com/SI.
  • Authentication is handled via the X-DTSI-ApiKey request header.

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

dtools_si-0.1.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dtools_si-0.1.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file dtools_si-0.1.2.tar.gz.

File metadata

  • Download URL: dtools_si-0.1.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dtools_si-0.1.2.tar.gz
Algorithm Hash digest
SHA256 759abf6aa798caaec0a6a4044c47d504118055e6622e713cef7cfc914512f034
MD5 3b94ba5b6ec193c889292122b6b7068e
BLAKE2b-256 36a80ded14de559960e2243225ad2762d753078e5fd4c0211b7233d6c868ab45

See more details on using hashes here.

File details

Details for the file dtools_si-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: dtools_si-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.20 {"installer":{"name":"uv","version":"0.11.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for dtools_si-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e3bd2011a34e2f6e3ad957506bae9dbf8e62fb8419134ce88eeb53cab3f79ace
MD5 f5b5dd5013b14b4fbafc6a4bed91d2da
BLAKE2b-256 114012f1bf9fd218914723d53034f8bee0588a7343b4241df860838d6e2c60ce

See more details on using hashes here.

Supported by

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