macadmins / macadmins/jamf-pro-sdk-python

[Feedback] src/jamf_pro_sdk/clients/pro_api/__init__.py may get unwieldy

Open
#30 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feedback
Dominant language
Python
Stars
69
Forks
16
PR merge metrics
No merged PRs in 30d

Description

Current

The current behaviour is to put all the functions for all the pro endpoints into the __init__.py file. I realise this allows calls like

ifrom jamf_pro_sdk import JamfProClient, BasicAuthProvider

client = JamfProClient(
    server="dummy.jamfcloud.com",
    credentials=BasicAuthProvider("username", "password")
)

all_computers = client.pro_api.get_computer_inventory_v1()

but when the number of endpoints gets high this file will grow to be difficult to deal with.

Proposed

I would propose that in the directory there could be a file computer_v1 which contains (among others) the function get_inventory then the call would be:

from jamf_pro_sdk import JamfProClient, BasicAuthProvider

client = JamfProClient(
    server="dummy.jamfcloud.com",
    credentials=BasicAuthProvider("username", "password")
)

all_computers = client.pro_api.computer_v1.get_inventory()
System Information

SDK version 4.0a

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/jamf_pro_sdk/clients/pro_api/init.py and trace how the existing endpoint functions are exposed through client.pro_api. Define the module structure and compatibility expectations for grouping endpoints such as computer_v1, then verify that the resulting client API matches the agreed design.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.