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.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.1.1
File Size Uploaded Provenance Actions
industrial_connect-0.1.1.tar.gz 85.2 kB Without provenance Details for industrial_connect-0.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 118.4 kB

Release files / industrial_connect-0.1.1.tar.gz

Download URL industrial_connect-0.1.1.tar.gz
Size 85.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b5075b366651c0c9a199bf48b7ebd3c341dcecfe6c4353237aae9c46510090aa
BLAKE2b-256 checksum
How to use checksums
dfd553f1762a27b9b2562668d04cfe930d8dd45cc70b60599bced1bf355661e7
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.1-py3-none-any.whl

Download URL industrial_connect-0.1.1-py3-none-any.whl
Size 33.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d73fe52e0e1c09d3db9af9f7327a602094516f5378aa096fefe345a6e65cf7b1
BLAKE2b-256 checksum
How to use checksums
fd08445874357de7b5a07542d3a0f435faafa475a58f948f789cf20689a76db7
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.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