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,env]"
pip install "industrial-connect[mqtt,opcua]"
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",)))

Every config supports explicit constructors and from_env(); loading a .env file requires the env extra and an explicit env_file argument. 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

Structured application settings use Config.from_mapping() with environment overrides. 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.1

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.1
File Size Uploaded Provenance Actions
industrial_connect-0.2.1.tar.gz 89.0 kB Without provenance Details for industrial_connect-0.2.1.tar.gz

Built distribution (wheel)

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

Total release size: 123.6 kB

Release files / industrial_connect-0.2.1.tar.gz

Download URL industrial_connect-0.2.1.tar.gz
Size 89.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8dc05c55cc33637d2320f3fb7eabf812eb3fe826c0b98c57890510371b639b72
BLAKE2b-256 checksum
How to use checksums
e37ec79bea3c13a4fae664878ea2f60716e9f48becf6d823cd7905fdb73ae2bb
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.1-py3-none-any.whl

Download URL industrial_connect-0.2.1-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0bebf77545b6ac96868fb3914b6dbcb3be9272b901a4811bc12e5cab674a39e
BLAKE2b-256 checksum
How to use checksums
23528603825c937a2bbcd9c78e995269c274f73197bce99daf9b25a817ce40c9
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.1

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