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. Run examples from the checkout; --help lists the available 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:.

Metadata

Release files for industrial-connect 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 industrial-connect 0.1.0
File Size Uploaded Provenance Actions
industrial_connect-0.1.0.tar.gz 83.0 kB Without provenance Details for industrial_connect-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 115.6 kB

Release files / industrial_connect-0.1.0.tar.gz

Download URL industrial_connect-0.1.0.tar.gz
Size 83.0 kB
Tags Source
SHA-256 checksum
How to use checksums
b9504a6482542c7579d9e079425778f8a86bc2f81d03120dd7713d970fd7c24c
BLAKE2b-256 checksum
How to use checksums
007f90ebbaadc875db7d46398d81e99be8d676c93684220a45d0eaad4df994db
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.1.0-py3-none-any.whl

Download URL industrial_connect-0.1.0-py3-none-any.whl
Size 32.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d058ab42f653fb21c455f9bc9ff3a9c9d77eb5eaef17221f117f4b4c2d065f3e
BLAKE2b-256 checksum
How to use checksums
88d2c800e286f5a267ed6ef2a3e59714428f71edd86d96a9e12eb5215c6bc6ed
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.1.0

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