Skip to main content

industrial-connect

Reusable Python connectors for industrial applications. Python 3.12+, Windows and Linux. Optional drivers, explicit resource ownership, no import-time connections.

Install

pip install industrial-connect                    # SQLite and core
pip install "industrial-connect[postgres]"
pip install "industrial-connect[mqtt,opcua]"
pip install "industrial-connect[env]"             # Optional .env file loader
pip install "industrial-connect[all]"

Install only the drivers you need. Pin the tested library version and lock your application's dependencies. db includes every database; all includes every extra.

Connectors and runnable examples

Each guide includes configuration, a realistic example, resource lifetime and error behavior. Example scripts are in examples/; --help lists their options.

Connector Extra Guide Example
PostgreSQL postgres PostgreSQL python -m examples.postgres
Oracle oracle Oracle and PL/SQL python -m examples.oracle
SQL Server mssql SQL Server python -m examples.mssql
SQLite none SQLite python -m examples.sqlite
QuestDB QWP questdb WebSocket ingestion and SQL python -m examples.questdb
MQTT mqtt Queue or callback telemetry python -m examples.mqtt / examples.mqtt_callback
OPC UA opcua PLC reads, writes and subscriptions python -m examples.opcua
Console/files none Logging python -m examples.logging_setup
Graylog graylog GELF/UDP python -m examples.graylog

Quick start without a service

from industrial_connect.db import SqliteClient, SqliteConfig

with SqliteClient(SqliteConfig(database=":memory:")) as db:
    db.execute("CREATE TABLE readings(equipment TEXT, temperature_c REAL)")
    with db.transaction() as tx:
        tx.execute("INSERT INTO readings VALUES (?, ?)", ("MILL_1", 72.5))
    print(db.query("SELECT * FROM readings WHERE equipment=?", ("MILL_1",)))

Load settings once with industrial_connect.config.load_env(), then pass values explicitly to each connector config. The standalone env extra enables .env file reading for any application; process variables need no extra. See configuration and the sample environment. For persistent clients shared across modules, see the sharing guide.

Operational contracts

  • Close clients after workers stop. Context managers own cleanup; closing is terminal.
  • Use bound SQL parameters. Native placeholders differ by database; see the guides.
  • Catch IndustrialConnectError or its DependencyError, ConnectionError and OperationError subclasses. Native errors remain in exception chains; cleanup failures add notes instead of hiding the original failure.
  • A failed write may already have arrived. The wrapper does not retry writes; native MQTT and QuestDB drivers have their own delivery/reconnect behavior.
  • MQTT/OPC UA queues are bounded. Monitor dropped_count; overflow means data loss.
  • Configure logging once with setup_logging(); modules use get_logger(__name__).
  • Configure TLS, certificate trust and credentials for your deployment. Avoid logging secrets and raw driver exception chains. Graylog GELF/UDP is unencrypted.

See database contracts and deployment and verification.

Develop and publish

python -m pip install -e ".[all,dev]"
python manage.py check
python manage.py build

The build command runs checks and creates a wheel and source archive in dist/. Uploads are explicit. See publishing for version bumps, TestPyPI, PyPI and private registries, and integration tests for disposable services. Passing unit tests alone does not validate your plant's devices, network, database permissions or delivery requirements.

Licensed under Apache-2.0. SQLite defaults to store.db; SqliteConfig.from_env() accepts SQLITE_DATABASE to choose another file or :memory:.

Application configuration

Applications can load settings once and construct connector configs explicitly. Config.from_mapping() is also available when automatic environment overrides are wanted. sqlite_connection() exposes managed native SQLite connections for application-owned transactions. OPC UA automatically prepares client certificates at first connection, with portable relative paths and optional forced renewal. Constructors perform no network or filesystem I/O. See the connector guides for resource ownership and failure behavior.

Metadata

Release files for industrial-connect 0.2.3

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

Source distribution (sdist)

Source distribution for industrial-connect 0.2.3
File Size Uploaded Provenance Actions
industrial_connect-0.2.3.tar.gz 90.2 kB Without provenance Details for industrial_connect-0.2.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for industrial-connect 0.2.3
File Interpreter ABI Platform Actions
industrial_connect-0.2.3-py3-none-any.whl Python 3 none any Details for industrial_connect-0.2.3-py3-none-any.whl

Total release size: 124.9 kB

Release files / industrial_connect-0.2.3.tar.gz

Download URL industrial_connect-0.2.3.tar.gz
Size 90.2 kB
Tags Source
SHA-256 checksum
How to use checksums
7393ad6077042dece88b7ff3c82655be335a8d9e51b9a8a44d8ca5804233022a
BLAKE2b-256 checksum
How to use checksums
42c4f08c7128c410437aad53067289bc55cc4e2b5cf51819e7a2949d3dab1f36
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / industrial_connect-0.2.3-py3-none-any.whl

Download URL industrial_connect-0.2.3-py3-none-any.whl
Size 34.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a6c79b06634782fbb0799b204b24cccea2dfcd841851585669248cf1db941237
BLAKE2b-256 checksum
How to use checksums
b02f0b4cfd6c035ecd30eee9575c87a7f2cb8eb429d532b0da6052a9ee9de454
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for industrial-connect 0.2.3

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.

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