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.1.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.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dtools_si-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 a2f8841028086b57a2f5faaa43d1878b00cc7210b10ddbf0be4148ce9bfa71de
MD5 1bd0e323ced4a919afb839a8c09e073c
BLAKE2b-256 3a059fb65f38f066f6b9a35b9a52e61dfcd6d79ddd4c446eb6fae11a421ec3e2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: dtools_si-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 543a5b5cda88a0440fc4a86dc339e4012d9941a50646514263cf75744ef640a0
MD5 a0ac8de6e9d45eeec2178701c522cf41
BLAKE2b-256 8ea7782270d1799c39441a7e601f3f521369baf55d3d2cc23daf8e51920ad2e1

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