Skip to content

Commit 5204c89

Browse files
committed
chore: python sdk release
1 parent 8244524 commit 5204c89

File tree

176 files changed

+179
-808
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

176 files changed

+179
-808
lines changed

README.md

Lines changed: 12 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,9 @@
11
# Hostinger API Python SDK
2-
> [!caution]
3-
> Currently, this API is in beta stage, meaning that breaking changes, while unlikely, might be introduced.
4-
> If you encounter any issues or have any feedback, please create an issue on the [Github Repository](https://github.com/hostinger/api/issues).
5-
# Overview
6-
The Hostinger API provides a comprehensive set of endpoints that allow developers to interact with Hostinger's services programmatically.
7-
This API enables you to manage various aspects of your Hostinger account.
8-
9-
The Hostinger API is a (mostly) RESTful API that uses standard HTTP methods and status codes.
10-
# Authentication
11-
The Hostinger API uses tokens for authentication. To authenticate your requests, you need to include a valid bearer token in the Authorization header of your HTTP requests:
12-
```yaml
13-
Authorization: Bearer YOUR_API_TOKEN
14-
```
15-
API tokens for individual users can be created and managed from the [VPS page](https://hpanel.hostinger.com/vps) of the Hostinger Panel.
16-
Tokens will have same permissions as the owning user. Optionally, tokens can be set to expire after a certain period of time.
17-
# Rate Limiting
18-
To ensure fair usage and prevent abuse, the API enforces rate limits on the number of requests that can be made within a certain time period.
19-
If you exceed the rate limit, you will receive a 429 Too Many Requests response. Rate limit headers are included in the response to help you manage your requests.
20-
Your IP address might get temporarily blocked if you exceed the rate limit multiple times.
21-
# Parameters
22-
All requests sent to API must have the content type `application/json`. `POST`, `PUT`, `PATCH` methods may include a JSON object in the request body. Documentation provides required structure and examples of the object.
23-
Some endpoints require path parameters. These parameters are included in the URL path and are marked with curly braces.
24-
# Pagination
25-
Some endpoints return a large number of items. To make these responses more manageable, the API uses pagination.
26-
By default, the API returns50 items per page.
27-
28-
The page number can be specified using the `page` query parameter, for example: `/api/vps/v1/public-keys?page=2`
29-
# Errors
30-
The Hostinger API uses standard HTTP status codes to indicate the success or failure of a request.
31-
In case of an error, the API will return a JSON response with an `error` field, containing a human-readable error message.
32-
Error responses also contain a `correlation_id` field which can be used to identify the request in case you need to contact support.
33-
# Change log
34-
For information on the latest changes to the API, please refer to the [change log](https://github.com/hostinger/api/blob/main/CHANGELOG.md).
35-
# Support
36-
If you have any questions, feedback or feature requests, please create an [issue](https://github.com/hostinger/api/issues) or [discussion](https://github.com/hostinger/api/discussions) on the repository.
37-
38-
For any support take a look at our [Github Repository](https://github.com/hostinger/api/), dedicated to the Hostinger API.
2+
3+
[![PyPI version](https://badge.fury.io/py/hostinger_api.svg)](https://badge.fury.io/py/hostinger_api)
4+
5+
## About
6+
This is a Python SDK for the [Hostinger API](https://developer.hostinger.com).
397

408
## Requirements.
419

@@ -44,12 +12,16 @@ Python 3.8+
4412
## Installation & Usage
4513
### pip install
4614

47-
If the python package is hosted on a repository, you can install directly using:
15+
Setup new virtual environment (optional but recommended):
16+
```sh
17+
python3 -m venv venv
18+
source venv/bin/activate
19+
```
4820

21+
Install the package via [pip](https://pypi.org/project/pip/):
4922
```sh
50-
pip install hostinger-api
23+
pip install hostinger_api
5124
```
52-
(you may need to run `pip` with root permission: `sudo pip install hostinger-api`)
5325

5426
Then import the package:
5527
```python
@@ -70,10 +42,6 @@ Then import the package:
7042
import hostinger_api
7143
```
7244

73-
### Tests
74-
75-
Execute `pytest` to run the tests.
76-
7745
## Getting Started
7846

7947
Please follow the [installation procedure](#installation--usage) and then run the following:
@@ -84,16 +52,6 @@ import hostinger_api
8452
from hostinger_api.rest import ApiException
8553
from pprint import pprint
8654

87-
# Defining the host is optional and defaults to https://developers.hostinger.com
88-
# See configuration.py for a list of all supported configuration parameters.
89-
configuration = hostinger_api.Configuration(
90-
host = "https://developers.hostinger.com"
91-
)
92-
93-
# The client must configure the authentication and authorization parameters
94-
# in accordance with the API server security policy.
95-
# Examples for each auth method are provided below, use the example that
96-
# satisfies your auth use case.
9755

9856
# Configure Bearer authorization: apiToken
9957
configuration = hostinger_api.Configuration(

docs/BillingCatalogApi.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ from hostinger_api.models.billing_v1_catalog_catalog_item_resource import Billin
2626
from hostinger_api.rest import ApiException
2727
from pprint import pprint
2828

29-
# Defining the host is optional and defaults to https://developers.hostinger.com
30-
# See configuration.py for a list of all supported configuration parameters.
31-
configuration = hostinger_api.Configuration(
32-
host = "https://developers.hostinger.com"
33-
)
34-
35-
# The client must configure the authentication and authorization parameters
36-
# in accordance with the API server security policy.
37-
# Examples for each auth method are provided below, use the example that
38-
# satisfies your auth use case.
3929

4030
# Configure Bearer authorization: apiToken
4131
configuration = hostinger_api.Configuration(

docs/BillingOrdersApi.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,6 @@ from hostinger_api.models.billing_v1_order_store_request import BillingV1OrderSt
3030
from hostinger_api.rest import ApiException
3131
from pprint import pprint
3232

33-
# Defining the host is optional and defaults to https://developers.hostinger.com
34-
# See configuration.py for a list of all supported configuration parameters.
35-
configuration = hostinger_api.Configuration(
36-
host = "https://developers.hostinger.com"
37-
)
38-
39-
# The client must configure the authentication and authorization parameters
40-
# in accordance with the API server security policy.
41-
# Examples for each auth method are provided below, use the example that
42-
# satisfies your auth use case.
4333

4434
# Configure Bearer authorization: apiToken
4535
configuration = hostinger_api.Configuration(

docs/BillingPaymentMethodsApi.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ from hostinger_api.models.common_success_empty_resource import CommonSuccessEmpt
2626
from hostinger_api.rest import ApiException
2727
from pprint import pprint
2828

29-
# Defining the host is optional and defaults to https://developers.hostinger.com
30-
# See configuration.py for a list of all supported configuration parameters.
31-
configuration = hostinger_api.Configuration(
32-
host = "https://developers.hostinger.com"
33-
)
34-
35-
# The client must configure the authentication and authorization parameters
36-
# in accordance with the API server security policy.
37-
# Examples for each auth method are provided below, use the example that
38-
# satisfies your auth use case.
3929

4030
# Configure Bearer authorization: apiToken
4131
configuration = hostinger_api.Configuration(
@@ -108,16 +98,6 @@ from hostinger_api.models.billing_v1_payment_method_payment_method_resource impo
10898
from hostinger_api.rest import ApiException
10999
from pprint import pprint
110100

111-
# Defining the host is optional and defaults to https://developers.hostinger.com
112-
# See configuration.py for a list of all supported configuration parameters.
113-
configuration = hostinger_api.Configuration(
114-
host = "https://developers.hostinger.com"
115-
)
116-
117-
# The client must configure the authentication and authorization parameters
118-
# in accordance with the API server security policy.
119-
# Examples for each auth method are provided below, use the example that
120-
# satisfies your auth use case.
121101

122102
# Configure Bearer authorization: apiToken
123103
configuration = hostinger_api.Configuration(
@@ -184,16 +164,6 @@ from hostinger_api.models.common_success_empty_resource import CommonSuccessEmpt
184164
from hostinger_api.rest import ApiException
185165
from pprint import pprint
186166

187-
# Defining the host is optional and defaults to https://developers.hostinger.com
188-
# See configuration.py for a list of all supported configuration parameters.
189-
configuration = hostinger_api.Configuration(
190-
host = "https://developers.hostinger.com"
191-
)
192-
193-
# The client must configure the authentication and authorization parameters
194-
# in accordance with the API server security policy.
195-
# Examples for each auth method are provided below, use the example that
196-
# satisfies your auth use case.
197167

198168
# Configure Bearer authorization: apiToken
199169
configuration = hostinger_api.Configuration(

docs/BillingSubscriptionsApi.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ from hostinger_api.models.common_success_empty_resource import CommonSuccessEmpt
2626
from hostinger_api.rest import ApiException
2727
from pprint import pprint
2828

29-
# Defining the host is optional and defaults to https://developers.hostinger.com
30-
# See configuration.py for a list of all supported configuration parameters.
31-
configuration = hostinger_api.Configuration(
32-
host = "https://developers.hostinger.com"
33-
)
34-
35-
# The client must configure the authentication and authorization parameters
36-
# in accordance with the API server security policy.
37-
# Examples for each auth method are provided below, use the example that
38-
# satisfies your auth use case.
3929

4030
# Configure Bearer authorization: apiToken
4131
configuration = hostinger_api.Configuration(
@@ -109,16 +99,6 @@ from hostinger_api.models.billing_v1_subscription_subscription_resource import B
10999
from hostinger_api.rest import ApiException
110100
from pprint import pprint
111101

112-
# Defining the host is optional and defaults to https://developers.hostinger.com
113-
# See configuration.py for a list of all supported configuration parameters.
114-
configuration = hostinger_api.Configuration(
115-
host = "https://developers.hostinger.com"
116-
)
117-
118-
# The client must configure the authentication and authorization parameters
119-
# in accordance with the API server security policy.
120-
# Examples for each auth method are provided below, use the example that
121-
# satisfies your auth use case.
122102

123103
# Configure Bearer authorization: apiToken
124104
configuration = hostinger_api.Configuration(

docs/DomainsPortfolioApi.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ from hostinger_api.models.domains_v1_domain_domain_resource import DomainsV1Doma
2424
from hostinger_api.rest import ApiException
2525
from pprint import pprint
2626

27-
# Defining the host is optional and defaults to https://developers.hostinger.com
28-
# See configuration.py for a list of all supported configuration parameters.
29-
configuration = hostinger_api.Configuration(
30-
host = "https://developers.hostinger.com"
31-
)
32-
33-
# The client must configure the authentication and authorization parameters
34-
# in accordance with the API server security policy.
35-
# Examples for each auth method are provided below, use the example that
36-
# satisfies your auth use case.
3727

3828
# Configure Bearer authorization: apiToken
3929
configuration = hostinger_api.Configuration(

docs/VPSActionsApi.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,6 @@ from hostinger_api.models.vps_get_action_list_v1200_response import VPSGetAction
2929
from hostinger_api.rest import ApiException
3030
from pprint import pprint
3131

32-
# Defining the host is optional and defaults to https://developers.hostinger.com
33-
# See configuration.py for a list of all supported configuration parameters.
34-
configuration = hostinger_api.Configuration(
35-
host = "https://developers.hostinger.com"
36-
)
37-
38-
# The client must configure the authentication and authorization parameters
39-
# in accordance with the API server security policy.
40-
# Examples for each auth method are provided below, use the example that
41-
# satisfies your auth use case.
4232

4333
# Configure Bearer authorization: apiToken
4434
configuration = hostinger_api.Configuration(
@@ -113,16 +103,6 @@ from hostinger_api.models.vpsv1_action_action_resource import VPSV1ActionActionR
113103
from hostinger_api.rest import ApiException
114104
from pprint import pprint
115105

116-
# Defining the host is optional and defaults to https://developers.hostinger.com
117-
# See configuration.py for a list of all supported configuration parameters.
118-
configuration = hostinger_api.Configuration(
119-
host = "https://developers.hostinger.com"
120-
)
121-
122-
# The client must configure the authentication and authorization parameters
123-
# in accordance with the API server security policy.
124-
# Examples for each auth method are provided below, use the example that
125-
# satisfies your auth use case.
126106

127107
# Configure Bearer authorization: apiToken
128108
configuration = hostinger_api.Configuration(

docs/VPSBackupsApi.md

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,6 @@ from hostinger_api.models.common_success_empty_resource import CommonSuccessEmpt
2626
from hostinger_api.rest import ApiException
2727
from pprint import pprint
2828

29-
# Defining the host is optional and defaults to https://developers.hostinger.com
30-
# See configuration.py for a list of all supported configuration parameters.
31-
configuration = hostinger_api.Configuration(
32-
host = "https://developers.hostinger.com"
33-
)
34-
35-
# The client must configure the authentication and authorization parameters
36-
# in accordance with the API server security policy.
37-
# Examples for each auth method are provided below, use the example that
38-
# satisfies your auth use case.
3929

4030
# Configure Bearer authorization: apiToken
4131
configuration = hostinger_api.Configuration(
@@ -108,16 +98,6 @@ from hostinger_api.models.vps_get_backup_list_v1200_response import VPSGetBackup
10898
from hostinger_api.rest import ApiException
10999
from pprint import pprint
110100

111-
# Defining the host is optional and defaults to https://developers.hostinger.com
112-
# See configuration.py for a list of all supported configuration parameters.
113-
configuration = hostinger_api.Configuration(
114-
host = "https://developers.hostinger.com"
115-
)
116-
117-
# The client must configure the authentication and authorization parameters
118-
# in accordance with the API server security policy.
119-
# Examples for each auth method are provided below, use the example that
120-
# satisfies your auth use case.
121101

122102
# Configure Bearer authorization: apiToken
123103
configuration = hostinger_api.Configuration(
@@ -194,16 +174,6 @@ from hostinger_api.models.vpsv1_action_action_resource import VPSV1ActionActionR
194174
from hostinger_api.rest import ApiException
195175
from pprint import pprint
196176

197-
# Defining the host is optional and defaults to https://developers.hostinger.com
198-
# See configuration.py for a list of all supported configuration parameters.
199-
configuration = hostinger_api.Configuration(
200-
host = "https://developers.hostinger.com"
201-
)
202-
203-
# The client must configure the authentication and authorization parameters
204-
# in accordance with the API server security policy.
205-
# Examples for each auth method are provided below, use the example that
206-
# satisfies your auth use case.
207177

208178
# Configure Bearer authorization: apiToken
209179
configuration = hostinger_api.Configuration(

docs/VPSDataCentersApi.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,6 @@ from hostinger_api.models.vpsv1_data_center_data_center_resource import VPSV1Dat
2424
from hostinger_api.rest import ApiException
2525
from pprint import pprint
2626

27-
# Defining the host is optional and defaults to https://developers.hostinger.com
28-
# See configuration.py for a list of all supported configuration parameters.
29-
configuration = hostinger_api.Configuration(
30-
host = "https://developers.hostinger.com"
31-
)
32-
33-
# The client must configure the authentication and authorization parameters
34-
# in accordance with the API server security policy.
35-
# Examples for each auth method are provided below, use the example that
36-
# satisfies your auth use case.
3727

3828
# Configure Bearer authorization: apiToken
3929
configuration = hostinger_api.Configuration(

0 commit comments

Comments
 (0)