Skip to main content

A python wrapper around the (Open-) Harmony device connector

Project description

hdc-py

A Python wrapper around the (Open)Harmony Device Connector hdc. Using the library requires the hdc tool to already be installed.

Release notes and migration guide: CHANGELOG.md

The API is split into global hdc operations and target-specific device operations:

from hdc_py import Hdc

hdc = Hdc()
device = hdc.connect()  # or hdc.connect(target="127.0.0.1:55555")
result = device.cmd("echo hello", capture_output=True, text=True)

HarmonyDeviceConnector remains available as a compatibility wrapper around a concrete connected device.

hdc-py is meant to make writing scripts for testing on OpenHarmony devices easier, and provide abstractions. Goals include:

  • Improved error checking and validation of command success
  • Multi-device support via Hdc.connect(...) and automatic -t <target> scoping on device commands
  • Support with syntax to enable performance mode for a number of commands, and disable the performance mode again, even if an exception occurs

This library is still under active development and far from complete. Known limitations include:

  • Only a subset of commands is currently wrapped

This library is not an official OpenHarmony project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hdc_py-0.2.0.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hdc_py-0.2.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file hdc_py-0.2.0.tar.gz.

File metadata

  • Download URL: hdc_py-0.2.0.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hdc_py-0.2.0.tar.gz
Algorithm Hash digest
SHA256 661480578867f426e8f0da18499a348a54c0d198cbab6c42dff28d2539823180
MD5 aa12df76014cece6518e284aaf28e3d0
BLAKE2b-256 7b3eb4a73cfb0a9fb6d129e008e4a1bb3d9745eb076acd6065cdd2edcca92482

See more details on using hashes here.

File details

Details for the file hdc_py-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: hdc_py-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for hdc_py-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 41b715498c87f19a5ace1b78f7b98fd4f44d305b02abb5e9b45896fee0c23bec
MD5 1c06992287a3c568c87af78afb649c7a
BLAKE2b-256 ccf407e995196670e374082d3c52c683fca1b8630d6d9e8685456c35450d6041

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page