--- id: pyhive version: "0.7.0" license: Apache License, Version 2.0 license_treatment: permissive maintenance: active --- # PyHive — Python interface to Hive License: permissive · Maintenance: active · Downloads: 6.9M/mo ## What it is and what it does PyHive is a Python client library that bridges your code to Hive, Presto, and Trino clusters via two interfaces: a standard DB-API (similar to psycopg2 or sqlite3) and a dialect for query builders. It lets you execute SQL queries against these big-data engines and fetch results, with optional asynchronous execution for long-running queries on Hive. The package has no runtime dependencies by default; you install extras for the specific engine you need (hive, presto, or trino), each bringing its own transport and protocol dependencies. The library is minimal in scope—it handles connection, query execution, and result fetching without attempting to abstract away engine-specific features. It supports session configuration (query timeouts, resource limits), authentication (LDAP, basic auth over HTTPS), and both modern and legacy patterns. The project is maintained but explicitly marked unsupported in its description, and installation friction is high due to the need to select and install the correct extras for your target engine. Use it for: - Execute ad-hoc SQL queries against a Hive cluster from a Python script or notebook. - Build a data pipeline that reads from Presto or Trino and processes results in Python. - Construct dynamic queries against Hive with LDAP authentication via the dialect interface. - Poll asynchronous Hive queries for completion and fetch logs while waiting. - Integrate Hive or Trino as a data source in a Python application via the DB-API. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyHive provides DB-API and SQLAlchemy interfaces to query Presto, Hive, and Trino clusters from Python, supporting both synchronous and asynchronous execution. Yes, if you need to query Hive, Presto, or Trino from Python and are willing to manage the extra selection and engine-specific dependencies. The package is actively maintained, permissively licensed, and widely downloaded, but install friction is high and the project's own description marks it unsupported—clarify your engine's support status before committing. No known vulnerabilities. ## Install pip install pyhive uv add pyhive poetry add pyhive ## Installing PyHive Before you install: Installation requires choosing extras for your target engine (hive, presto, or trino); the hive extra uses sasl which does not support Python 3.11, though a pure-sasl alternative is available. The package is actively maintained but marked unsupported in its description. License in practice: Licensed under Apache License, Version 2.0 (permissive), allowing commercial and private use with minimal restrictions. Quickstart: # DB-API usage from pyhive import presto cursor = presto.connect('localhost').cursor() cursor.execute('SELECT * FROM my_table LIMIT 10') print(cursor.fetchall()) # Alternative engines from pyhive import hive from pyhive import trino Requires a running Hive, Presto, or Trino server accessible at the specified host and port; install with extras (pip install 'pyhive[presto]', 'pyhive[hive]', or 'pyhive[trino]'). Verify before relying: - Current maintenance status unclear despite 'active' label and 'unsupported' notice in description—clarify project's actual support level. - Python 3.11 compatibility with hive extra depends on sasl package status; pure-sasl alternative availability should be verified. - Query generation functionality noted as not exhaustive in documentation; scope of supported SQL operations unclear. ## Package facts - License: Apache License, Version 2.0 (permissive) - Python support: unspecified - Install friction: high - Maintenance: active - Downloads: 6.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags hive query client python, presto python interface, trino python driver, db-api hive connection, hive dialect python, async hive queries, big data sql python, big-data-sql, db-api, hive-client [View on SkillFed](https://skillfed.io/packages/pyhive) · [View on PyPI](https://pypi.org/project/pyhive/)