|
1 | | -# python-transip |
| 1 | +[](https://github.com/roaldnefs/python-transip) |
| 2 | + |
| 3 | +[](https://pypi.org/project/python-transip/) |
| 4 | +[](https://pypi.org/project/python-transip/) |
| 5 | +[](https://pypi.org/project/python-transip/) |
| 6 | +[](https://raw.githubusercontent.com/roaldnefs/python-transip/main/COPYING) |
| 7 | +[](https://github.com/roaldnefs/python-transip/actions) |
| 8 | +[](https://github.com/roaldnefs/python-transip/graphs/contributors) |
2 | 9 |
|
3 | 10 | **python-transip** is an Python wrapper for the TransIP REST API. |
4 | 11 |
|
5 | 12 | ```python |
6 | | ->>> from transip import TransIP |
7 | | ->>> client = TransIP(access_token="REDACTED") |
8 | | ->>> domains = client.domains.list() |
9 | | ->>> domain = domains[0] |
10 | | ->>> domain.registrationDate |
11 | | -'2011-04-29' |
| 13 | +>>> import transip |
| 14 | +# Initialize a TransIP API client |
| 15 | +>>> client = transip.TransIP(access_token="TOKEN") |
| 16 | +# Retrieve a list of VPSs |
| 17 | +>>> for vps in client.vpss.list(): |
| 18 | +... print(vps) |
| 19 | +<class 'transip.v6.services.vps.Vps'> => {'name': 'transipdemo-vps', 'productName': 'vps-bladevps-x1', ... } |
| 20 | +# Retrieve a domain and list its DNS-records |
| 21 | +>>> domain = client.domains.get('transipdemo.net') |
| 22 | +>>> for entry in domain.dns.list(): |
| 23 | +... print(entry) |
| 24 | +<class 'transip.v6.services.domain.DnsEntry'> => {'name': '*', 'expire': 300, 'type': 'A', 'content': '95.170.70.223'} |
| 25 | +<class 'transip.v6.services.domain.DnsEntry'> => {'name': '@', 'expire': 300, 'type': 'A', 'content': '95.170.70.223'} |
| 26 | +# Add a new DNS-record |
| 27 | +>>> domain.dns.create({'name': '@', 'expire': 300, 'type': 'TXT', 'content': 'Python'}) |
12 | 28 | ``` |
13 | 29 |
|
14 | | -[](https://github.com/roaldnefs/python-transip/actions) |
15 | | -[](https://pepy.tech/project/python-transip/month) |
16 | | -[](https://pypi.org/project/python-transip) |
17 | | -[](https://github.com/roaldnefs/python-transip/graphs/contributors) |
18 | | - |
19 | 30 | ## Installing python-transip and Supported Versions |
20 | 31 |
|
21 | 32 | **python-transip** is available on PyPI: |
|
0 commit comments