Skip to main content

python-sdk

semantic-release Build Status PyPI - Python Version PyPI Documentation Status License: MIT PRs welcome

This module is a connector library for the insanely fast HEXONET Backend API. For further informations visit our homepage and do not hesitate to contact us.

Resources

Features

  • Automatic IDN Domain name conversion to punycode (our API accepts only punycode format in commands)
  • Allows nested associative arrays in API commands to improve for bulk parameters
  • Connecting and communication with our API
  • Several ways to access and deal with response data
  • Getting the command again returned together with the response
  • Sessionless communication
  • Session based communication
  • Possibility to save API session identifier in PHP session
  • Configure a Proxy for API communication
  • Configure a Referer for API communication
  • High Performance Proxy Setup

High Performance Proxy Setup

Long distances to our main data center in Germany may result in high network latencies. If you encounter such problems, we highly recommend to use this setup, as it uses persistent connections to our API server and the overhead for connection establishments is omitted.

Step 1: Required Apache2 packages / modules

At least Apache version 2.2.9 is required.

The following Apache2 modules must be installed and activated:

proxy.conf
proxy.load
proxy_http.load
ssl.conf # for HTTPs connection to our API server
ssl.load # for HTTPs connection to our API server

Step 2: Apache configuration

An example Apache configuration with binding to localhost:

<VirtualHost 127.0.0.1:80>
    ServerAdmin webmaster@localhost
    ServerSignature Off
    SSLProxyEngine on
    ProxyPass /api/call.cgi https://api.ispapi.net/api/call.cgi min=1 max=2
    <Proxy *>
        Order Deny,Allow
        Deny from none
        Allow from all
    </Proxy>
</VirtualHost>

After saving your configuration changes please restart the Apache webserver.

Step 3: Using this setup

from hexonet.apiconnector.apiclient import APIClient as AC

cl = AC()
cl.useOTESystem()
cl.useHighPerformanceConnectionSetup() # Default Connection Setup would be used otherwise by default
cl.setCredentials('test.user', 'test.passw0rd')
r = cl.request({"COMMAND" => "StatusAccount"})

So, what happens in code behind the scenes? We communicate with localhost (so our proxy setup) that passes the requests to the HEXONET API. Of course we can't activate this setup by default as it is based on Steps 1 and 2. Otherwise connecting to our API wouldn't work.

Just in case the above port or ip address can't be used, use function setURL instead to set a different URL / Port. http://127.0.0.1/api/call.cgi is the default URL for the High Performance Proxy Setup. e.g. $cl->setURL("http://127.0.0.1:8765/api/call.cgi"); would change the port. Configure that port also in the Apache Configuration (-> Step 2)!

Don't use https for that setup as it leads to slowing things down as of the https overhead of securing the connection. In this setup we just connect to localhost, so no direct outgoing network traffic using http. The apache configuration finally takes care passing it to https for the final communication to the HEXONET API.

How to use this module in your project

All you need to know, can be found here.

Contributing

Please read our development guide for details on our code of conduct, and the process for submitting pull requests to us.

pip3 install -e .

Authors

List of responsible developers can be found here

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for hexonet.apiconnector 3.4.0

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

Source distribution (sdist)

Source distribution for hexonet.apiconnector 3.4.0
File Size Uploaded Provenance Actions
hexonet.apiconnector-3.4.0.tar.gz 15.0 kB Without provenance Details for hexonet.apiconnector-3.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 32.3 kB

Release files / hexonet.apiconnector-3.4.0.tar.gz

Download URL hexonet.apiconnector-3.4.0.tar.gz
Size 15.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c4304e6d95ad764bc3e90da377e0a0e7ce76bf6f6ceb69086ef996dad27796b7
BLAKE2b-256 checksum
How to use checksums
6d5669553f42c0345b9e225567c3ae06d450daac70c8a44c7778719f8895ca4a
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/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7

Release files / hexonet.apiconnector-3.4.0-py2.py3-none-any.whl

Download URL hexonet.apiconnector-3.4.0-py2.py3-none-any.whl
Size 17.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4cec64edded16c3fdcd75fddb328984350e187e8e940e4e231986e80c3b1f4f2
BLAKE2b-256 checksum
How to use checksums
9f86238dc19414d66f67a9ca2e79a57bcb46afe4cb1df7f460118b1d9f30939f
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/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.7

Security for hexonet.apiconnector 3.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.4.0 This release

2 release files No provenance

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