Servicetitan API Package tool
Project description
Titanpy
Test to practice creating classes as packages in Pypi
Python class for interacting with all Servicetitan's api endpoints
Windows install: py -m pip install --upgrade Titanpy
Tutorials:
Adding get endpoints
First add an endpoint to an endpoint group. This is accomplished by either adding to an existing group or creating a new one. For example, I want to add an exports endpoint for activity-codes. First I would go to the Payroll endpoint group, pick whether I want to add an ID/category endpoint or a normal endpoint. Since the export endpoint does not require an ID, I would add it to the latter. The naming scheme goes as follow:
{first part of url}-{second part of url}{/ if id, no / if not id}
For the example: 'export/activity-codes' For an id endpoint from activity-codes: 'activity-codes/'
This was done this way because for more complicated endpoints, they must has specific url formats that can be generated in the handlers/endpoint tests section. However, simple endpoints such as export activity-codes can simply be the format they would be in the url. The slash is added for simple id endpoints because they can simply be in the format {endpoint}/{id}.
Next the endpoint must be added to the available endpoints group list, most of the endpoint groups are already added but if a new group is made feel free to add it. Endpoint group names can be found at Servicetitan Developer Apis and are based entirely off servicetitan's naming scheme.
The last step before creating a handler/endpoint test is adding the general url if it hasn't already. Please use the following structure when adding to this dictionary:
"{endpoint group name}_url{_tenant if tenant included}": f"{url(with tenant inserted in the f-string if needed)}",
For more guidance use context clues with the previous general urls.
Finally, you can add the handler/endpoint test.
This section is split up based on endpoint groups with comments designating each endpoint group. You will find most have a handler for id endpoints and standard groups, with id groups being split between simple first then complicated following. Most of these can be copy pasted and then have specific parts replaced based on the current endpoint you are trying to integrate. Please study the general formatting and follow according, they are mostly the same.
And you're done! You've added a get endpoint. Send a pull request to the main branch and it'll be added after a short review.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file Titanpy-0.0.5.tar.gz
.
File metadata
- Download URL: Titanpy-0.0.5.tar.gz
- Upload date:
- Size: 10.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d9844f1d8f5019d9e66e1429bf134634f42d4dac7dfad10f720a5ac5dbc3c1 |
|
MD5 | 392d0aabbb21702bf9b6c2fb20b0981f |
|
BLAKE2b-256 | 6741e78b6929ece40a9c878732fd70ef0736bdc33da398359ae779a2f3e52c8e |
File details
Details for the file Titanpy-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: Titanpy-0.0.5-py3-none-any.whl
- Upload date:
- Size: 10.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c100f4dc720719f4dee30b0fbd4b1c6b6adacbf4b2b216165fc91ff9572f118 |
|
MD5 | cb8b78c7fd731f751e22111d03426523 |
|
BLAKE2b-256 | 302a58c7a448a47a4194680f5b85a03d656778f0da460d95b6f601ff0fc84cba |