Metadata-Version: 2.4
Name: pyidh
Version: 0.2.1
Summary: Python wrapper for Industry Data Hub (win_amd64)
Home-page: https://github.com/ymwang78/IndustryDataHub
Author: Yongming Wang
Author-email: wangym@gmail.com
Project-URL: Bug Reports, https://github.com/ymwang78/IndustryDataHub/issues
Project-URL: Source, https://github.com/ymwang78/IndustryDataHub
Project-URL: Documentation, https://github.com/ymwang78/IndustryDataHub/wiki
Keywords: industrial automation,data communication,OPC,modbus,multi-platform
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: License :: OSI Approved :: MIT License
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Hardware
Classifier: Topic :: Communications
Classifier: Operating System :: Microsoft :: Windows
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: pywin32>=305
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: project-url
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# PyIDH

Python wrapper for IDH (Industrial Data Hub) library.

## Installation

1. Install Microsoft Visual C++ 2015-2022 Redistributable:
   - 64-bit system: [Download VC140 x64](https://aka.ms/vs/17/release/vc_redist.x64.exe)
   - 32-bit system: [Download VC140 x86](https://aka.ms/vs/17/release/vc_redist.x86.exe)

2. Install pyidh:
```bash
pip install pyidh
```

## Usage

```python
from pyidh import IDHLibrary, IDH_DATATYPE, IDH_RTSOURCE

# Create IDH Instance
idh = IDHLibrary()

# Create Data Source
source = idh.create_source(
    source_type=IDH_RTSOURCE.IDH_RTSOURCE_UA.value,
    source_schema="opc.tcp://localhost:4840",
    sample_timespan_msec=1000
)

# Read data
tags = [
    {
        "data_type": IDH_DATATYPE.IDH_DATATYPE_REAL.value,
        "namespace_index": 3,
        "tag_name": "Demo.Dynamic.Scalar.Float"
    }
]

result, values = idh.read_values(source, tags)
for value in values:
    print(f"Quality: {value.quality}, Timestamp: {value.timestamp}, Value: {value.value}")

# cleanup
idh.destroy_source(source)
idh.destroy()
```

## Requirements

- Python 3.8 or higher
- Windows operating system
- libidh.dll (included in the package)

## License

MIT License 
