Skip to main content

Build Status Documentation Status

This library aims to implement the TransIP API in Python.

Quick Start

Prerequisite

  • Make sure you have an account at TransIP

  • Enable the API (https://www.transip.nl/cp/mijn-account/#api)

  • Whitelist your IP.

  • Generate a new key-pair.
    • Copy-paste the private key into a file.

    • Put the private key in a file called decrypted_key beside this README.rst file.

Setup

You can get the library directly from PyPi:

$ pip install transip

Example

The command-line interpreter doesn’t do much yet. By default it does a getDomainNames() call, but with the ‘-u’ option it’s also possible to add or update DNS records. When calling it with ‘-h’, it will show all available options.

$ transip-api
[example.com, example.org, example.net]

$ transip-api -h
usage: transip-api [-h] [-l LOGINNAME] [-s] [-a] [-u] [-d]
                   [--domain-name DOMAIN_NAME] [--entry-name ENTRY_NAME]
                   [--entry-expire ENTRY_EXPIRE] [--entry-type ENTRY_TYPE]
                   [--entry-content ENTRY_CONTENT] [--api-key PRIVATE_KEY_FILE]

optional arguments:
  -h, --help            show this help message and exit
  -l LOGINNAME, --login-name LOGINNAME
                        TransIP username
  -s, --show-dns-entries
                        show all DNS entries for a domain
  -a, --add-dns-entry   add an entry in the DNS
  -u, --update-dns-entry
                        update an entry in the DNS
  -d, --delete-dns-entry
                        delete an entry in the DNS
  --domain-name DOMAIN_NAME
                        domain name to use
  --entry-name ENTRY_NAME
                        name of the DNS entry
  --entry-expire ENTRY_EXPIRE
                        expire time of the DNS entry
  --entry-type ENTRY_TYPE
                        type of the DNS entry
  --entry-content ENTRY_CONTENT
                        content of the DNS entry
  --api-key PRIVATE_KEY_FILE
                        TransIP private key

Example of adding/updating a record:

$ transip-api -l githubuser -u --api-key privatekey --domain-name example.com --entry-name testentry --entry-expire 86400 --entry-type A --entry-content 127.0.0.1
Request finished successfully.

Documentation

Further documentation can be found in the docs directory, or on https://transip-api.readthedocs.io/en/latest/.

FAQ

Question:

When using the library I get SSL errors such as:

urllib2.URLError: <urlopen error [Errno 1] _ssl.c:510: error:14077458:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 unrecognized name>

Answer:

The suds library has fairly limited SSL support which is dependent on the Python version, to work around this the suds_requests library can be used which replaces urllib2 with the requests library. Additionally the requests library automatically pools connections which makes the library slightly faster to use. To install:

pip install suds_requests

Release files for transip 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transip 2.1.2
File Size Uploaded
transip-2.1.2.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for transip 2.1.2
File Interpreter ABI Platform
transip-2.1.2-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 30.6 kB

Release files / transip-2.1.2.tar.gz

Download URL transip-2.1.2.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e8c66ae9803fbdc4555e5b4a7373cd9053017a5952b2890e6e3ca6563775f7b3
BLAKE2b-256 checksum
How to use checksums
4cb202c47f78421d6d2653843d1935c3c6538b0f8a23c013e71f920985d2f7ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.2

Release files / transip-2.1.2-py2.py3-none-any.whl

Download URL transip-2.1.2-py2.py3-none-any.whl
Size 15.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ad49b41316105d1b6cb091a49b6c49421a874ecd4a147f289e07c8fa42028501
BLAKE2b-256 checksum
How to use checksums
9de24c88d462fa2234d8465b49d49de29c7a5c006ac1f9633e2cbe2e6c8e8a9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.44.0 CPython/3.8.2

Release history Release notifications | RSS feed

This release

2.1.2 This release

2 release files

2.1.1

1 release file

2.0.0

1 release file

1.0.1

1 release file

1.0.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page