Skip to main content

dinahosting-cli

dinahosting-cli

Python 3.14 client and command-line interface for the Dinahosting API

PyPI Version Python Versions License GitHub Stars GitHub Issues Buy Me a Coffee


Overview

dinahosting-cli is a Python library and CLI for the Dinahosting API. It exposes the 485 documented API commands, validates their documented parameters, sends form-encoded requests through HTTPS, and returns typed responses.

Key Features

Feature Description
Complete command catalogue Access all 485 documented Dinahosting API commands
CLI + library Automate from dinacli or use DinaClient in Python
Parameter validation Required and optional parameters are checked before requests are sent
JSON output Commands, descriptions, responses, and optional errors are machine-readable
Configuration sources Credentials and connection settings from flags, environment variables, or TOML
Secure transport HTTPS is required for remote endpoints; HTTP is limited to loopback integration tests
Typed failures Configuration, connection, protocol, and API errors have distinct exception types

Supported Interfaces

CLI              commands, describe, call
Configuration    command-line flags, DINA_* environment variables, TOML
Response data    JSON output and DinaResponse objects
Python access    exact API names and hierarchical namespaces

Installation

From PyPI

After publication, install the package with:

python -m pip install dinahosting-cli

From Source

git clone https://github.com/seifreed/dinacli.git
cd dinacli
python3 -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate
python -m pip install -e .

Development tooling is declared in pyproject.toml alongside the package metadata.


Quick Start

# List every documented API command
dinacli commands

# Inspect parameters before executing a command
dinacli describe Domain_Zone_AddTypeA

# Execute a simulated request
dinacli --user mi_usuario --password mi_contrasena \
  call Domain_Zone_AddTypeA \
  --param domain=example.com \
  --param hostname=www \
  --param ip=192.0.2.10 \
  --simulate

Usage

Command Line Interface

# List commands as JSON
dinacli --output json commands

# Display required and optional parameters
dinacli describe Vps_PowerStatus_Restart

# Pass strings, numbers, booleans, arrays, or objects with --param
dinacli --user mi_usuario --password mi_contrasena \
  call Domain_Zone_AddTypeA \
  --param domain=example.com \
  --param hostname=www \
  --param ip=192.0.2.10 \
  --simulate

Commands

Command Description
dinacli commands List the 485 documented API command names
dinacli describe COMANDO Show a command's required and optional parameters
dinacli call COMANDO Validate and execute a documented API command

Global Options

Option Description
--config ARCHIVO TOML file with a [dina] section
--user USUARIO Dinahosting API user
--password CLAVE Dinahosting API password
--endpoint URL Override the default API endpoint
--timeout SEGUNDOS Request timeout; defaults to 20 seconds
--output json JSON array for commands and JSON errors on stderr
--version Print the installed package version

Global options must precede the subcommand. call accepts --param NOMBRE=VALOR repeatedly. Valid JSON values are decoded before sending; other values are sent as text. --simulate sends the API SIMULATE parameter.

Configuration

DINA_USER and DINA_PASSWORD are required when creating a client from the environment. The optional variables are DINA_ENDPOINT and DINA_TIMEOUT.

[dina]
user = "mi_usuario"
password = "mi_contrasena"
endpoint = "https://dinahosting.com/special/api.php"
timeout = 20

Command-line flags take precedence over DINA_* variables, which take precedence over TOML values. Prefer environment variables or a protected TOML file over passing a password directly on the command line.


Python Library

Basic Usage

from dinacli import DinaClient

client = DinaClient.from_environment()
domains = client.call("Services_GetDomains").data

Documented Commands

from dinacli import DinaClient

client = DinaClient("mi_usuario", "mi_contrasena")

client.api.domain.zone.add_type_a(
    domain="example.com",
    hostname="www",
    ip="192.0.2.10",
)

client.api["Vps_PowerStatus_Restart"](serverName="vps.example.com")

Every documented command validates its required and optional parameters. Successful calls return DinaResponse; non-success API codes raise DinaApiError.


Requirements

  • Python 3.14+
  • No runtime dependencies

See pyproject.toml for package metadata and development tooling.


Releases

CI runs the full quality and security gate on the latest Linux, Windows, and macOS runners using Python 3.14. Push a version tag that matches the package version to publish a release:

git tag v0.1.0
git push origin v0.1.0

PyPI publishing uses GitHub Actions OIDC Trusted Publishing and does not use a stored PyPI token. Before the first release, register a pending publisher in PyPI with the following values:

Project:     dinahosting-cli
Owner:       seifreed
Repository:  dinacli
Workflow:    release.yml
Environment: pypi

Configure the optional pypi GitHub environment with required reviewers when manual release approval is desired.


Contributing

  1. Fork the repository.
  2. Create a feature branch.
  3. Run the quality and security gates from AGENTS.md.
  4. Commit and push the change.
  5. Open a pull request.

Support the Project

Buy Me A Coffee

License

This project is licensed under the MIT License.

Repository: github.com/seifreed/dinacli


Built for reliable Dinahosting API automation

Metadata

Release files for dinahosting-cli 0.1.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 dinahosting-cli 0.1.0
File Size Uploaded
dinahosting_cli-0.1.0.tar.gz 24.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dinahosting-cli 0.1.0
File Interpreter ABI Platform
dinahosting_cli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.7 kB

Release files / dinahosting_cli-0.1.0.tar.gz

Download URL dinahosting_cli-0.1.0.tar.gz
Size 24.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d78b4ea379add479805873343a74414405caf7de033dae295ec666f5f6bc5af5
BLAKE2b-256 checksum
How to use checksums
f0e3ed8465b1d4ff86fa05c1e89fa0abca59845b89e61f9e9c12ce081b0bdb01
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release files / dinahosting_cli-0.1.0-py3-none-any.whl

Download URL dinahosting_cli-0.1.0-py3-none-any.whl
Size 20.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1c856585022d0b6c79a75a9cc4bfcd1c381058aa871991b64739f60c34484c7d
BLAKE2b-256 checksum
How to use checksums
29eb0aebdd8430f0727666bdbed00190001ab50bcd60dba849f477ea94bd1bad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

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