{"id":26884,"library":"datahub","title":"Acryl DataHub Python Client","description":"DataHub is an open-source metadata platform for the modern data stack. The Python client (acryl-datahub) provides utilities for ingesting metadata, interacting with the DataHub API, and managing data lineage. As of version 0.12.1, the package has transitioned from 'datahub' to 'acryl-datahub' on PyPI. The dummy package 'datahub' 0.999.1 is a placeholder and should be avoided in favor of 'acryl-datahub'.","status":"deprecated","version":"0.999.1","language":"python","source_language":"en","source_url":"https://github.com/datahub-project/datahub","tags":["data-catalog","metadata","data-lineage","acryl"],"install":[{"cmd":"pip install acryl-datahub","lang":"bash","label":"Install the real client"}],"dependencies":[],"imports":[{"note":"The recommended import path uses the emitter submodule.","wrong":"from datahub import DataHubRestEmitter","symbol":"DataHubRestEmitter","correct":"from datahub.emitter.rest_emitter import DataHubRestEmitter"},{"note":"The correct module is datahub.ingestion.graph.client.","wrong":"from datahub.graph import DataHubGraph","symbol":"DataHubGraph","correct":"from datahub.ingestion.graph.client import DataHubGraph"}],"quickstart":{"code":"import os\nfrom datahub.emitter.rest_emitter import DataHubRestEmitter\nfrom datahub.metadata.schema_classes import DatasetPropertiesClass\n\n# Create an emitter to DataHub\nserver = os.environ.get('DATAHUB_SERVER', 'http://localhost:8080')\ntoken = os.environ.get('DATAHUB_TOKEN', '')\nemitter = DataHubRestEmitter(gms_server=server, token=token)\n\n# Emit a dataset metadata change\nemitter.emit_mcp(\n    entity_urn='urn:li:dataset:(urn:li:dataPlatform:hive,test_dataset,PROD)',\n    aspect=DatasetPropertiesClass(description='Test dataset')\n)\nprint('Metadata emitted successfully')","lang":"python","description":"Quickstart: Emit a dataset metadata change event."},"warnings":[{"fix":"Run: pip uninstall datahub && pip install acryl-datahub","message":"The 'datahub' package on PyPI (version 0.999.1) is a dummy placeholder. Install 'acryl-datahub' instead.","severity":"deprecated","affected_versions":">=0.999.1"},{"fix":"Upgrade to latest acryl-datahub and use new import paths.","message":"In older versions (pre-0.9.0), the import paths were different. The emitter was at 'datahub.emitter.rest_emitter' but now uses async/await patterns.","severity":"breaking","affected_versions":"<0.9.0"},{"fix":"Use DataHubRestEmitter for synchronous emits or use the async emitter with event loop.","message":"When using the emitters, ensure you call .emit() correctly. The synchronous emitter no longer exists; use async or use DataHubRestEmitter which is synchronous.","severity":"gotcha","affected_versions":">=0.9.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"pip install acryl-datahub","cause":"The 'datahub' dummy package is not installed or is the wrong package.","error":"ModuleNotFoundError: No module named 'datahub'"},{"fix":"Install acryl-datahub and use from datahub.emitter.rest_emitter import DataHubRestEmitter","cause":"The import path changed or the wrong package is installed.","error":"ImportError: cannot import name 'DataHubRestEmitter' from 'datahub'"},{"fix":"pip install --upgrade acryl-datahub","cause":"Using the dummy package or an outdated version.","error":"AttributeError: module 'datahub' has no attribute 'emitter'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}