{"id":34103125,"url":"https://github.com/innovationb1ue/hbase-driver","last_synced_at":"2026-02-23T05:10:56.367Z","repository":{"id":221668715,"uuid":"755018594","full_name":"innovationb1ue/hbase-driver","owner":"innovationb1ue","description":" Hbase client in pure native Python. (No thrift)","archived":false,"fork":false,"pushed_at":"2026-02-21T16:25:23.000Z","size":2630,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-21T22:57:40.334Z","etag":null,"topics":["hbase","hbase-client","hbase-driver","protobuf","python","pythonhbaseclient"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/innovationb1ue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-09T09:05:48.000Z","updated_at":"2026-02-21T16:25:27.000Z","dependencies_parsed_at":"2025-07-17T10:43:56.983Z","dependency_job_id":"1595ca64-6ec7-4672-ab56-bc4ee78364cb","html_url":"https://github.com/innovationb1ue/hbase-driver","commit_stats":null,"previous_names":["innovationb1ue/python-hbase-driver","innovationb1ue/hbase-driver"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/innovationb1ue/hbase-driver","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innovationb1ue%2Fhbase-driver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innovationb1ue%2Fhbase-driver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innovationb1ue%2Fhbase-driver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innovationb1ue%2Fhbase-driver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/innovationb1ue","download_url":"https://codeload.github.com/innovationb1ue/hbase-driver/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innovationb1ue%2Fhbase-driver/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29738083,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T04:51:08.365Z","status":"ssl_error","status_checked_at":"2026-02-23T04:49:15.865Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hbase","hbase-client","hbase-driver","protobuf","python","pythonhbaseclient"],"created_at":"2025-12-14T17:19:23.433Z","updated_at":"2026-02-23T05:10:56.358Z","avatar_url":"https://github.com/innovationb1ue.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hbase-driver\n\n[![Tests](https://github.com/innovationb1ue/hbase-driver/actions/workflows/ci.yml/badge.svg)](https://github.com/innovationb1ue/hbase-driver/actions)\n[![License](https://img.shields.io/badge/license-Apache%202-blue.svg)](LICENSE)\n\nPure-Python native HBase client (no Thrift). This project implements core HBase regionserver and master RPCs so Python programs can perform table and metadata operations against an HBase cluster.\n\n## Status\n\n- Integration test status (local): **77 / 77 tests passing** (2026-02-21) using the custom 3-node Docker cluster.\n\n## Quick Start\n\nGet started with hbase-driver in just a few lines:\n\n```python\nfrom hbasedriver.client.client import Client\nfrom hbasedriver.hbase_constants import HConstants\nfrom hbasedriver.operations.put import Put\nfrom hbasedriver.operations.get import Get\nfrom hbasedriver.operations.scan import Scan\n\n# Initialize client\nconfig = {HConstants.ZOOKEEPER_QUORUM: \"localhost:2181\"}\nclient = Client(config)\n\n# Put and Get data\nwith client.get_table(\"default\", \"mytable\") as table:\n    table.put(Put(b\"row1\").add_column(b\"cf\", b\"col\", b\"value\"))\n    row = table.get(Get(b\"row1\"))\n    print(row.get(b\"cf\", b\"col\"))  # b\"value\"\n\n# Scan data\nwith client.get_table(\"default\", \"mytable\") as table:\n    with table.scan(Scan()) as scanner:\n        for row in scanner:\n            print(row.rowkey)\n```\n\n## Complete Example\n\nFor a comprehensive example covering all major features, see [complete_example.py](complete_example.py) which demonstrates:\n\n- Basic CRUD operations (Put, Get, Delete, Scan)\n- Advanced features (Batch, CheckAndPut, Increment)\n- Filter usage for server-side filtering\n- DDL operations (Create, Disable, Enable, Delete, Truncate)\n- Connection management and resource cleanup\n- Cache invalidation after table modifications\n\nRun the example:\n```bash\npython3 complete_example.py\n```\n\n## Installation\n\n```bash\npip install hbase-driver\n```\n\nOr for development:\n\n```bash\ngit clone https://github.com/innovationb1ue/hbase-driver.git\ncd hbase-driver\npip install -e .\n```\n\n## Connection Management\n\nThe hbase-driver provides context managers for automatic resource cleanup, similar to Java's try-with-resources:\n\n```python\nfrom hbasedriver.client.client import Client\nfrom hbasedriver.hbase_constants import HConstants\n\n# Using context manager - automatic cleanup\nwith Client({HConstants.ZOOKEEPER_QUORUM: \"localhost:2181\"}) as client:\n    with client.get_table(\"default\", \"mytable\") as table:\n        # Do operations\n        table.put(Put(b\"row1\").add_column(b\"cf\", b\"col\", b\"value\"))\n    # Table automatically closed here\n# Client automatically closed here\n\n# Manual cleanup\nclient = Client({HConstants.ZOOKEEPER_QUORUM: \"localhost:2181\"})\ntry:\n    table = client.get_table(\"default\", \"mytable\")\n    try:\n        # Do operations\n        table.put(Put(b\"row1\").add_column(b\"cf\", b\"col\", b\"value\"))\n    finally:\n        table.close()\nfinally:\n    client.close()\n```\n\n### Resource Classes Supporting Context Managers\n\n- `Client` - Main client connection\n- `Table` - Table operations\n- `Admin` - DDL operations\n- `ResultScanner` - Scan results iteration\n\n## Configuration\n\n### Configuration Options\n\n| Key | Default | Description |\n|-----|---------|-------------|\n| `hbase.zookeeper.quorum` | Required | ZooKeeper quorum addresses (comma-separated) |\n| `zookeeper.znode.parent` | `/hbase` | ZooKeeper parent znode |\n| `hbase.connection.pool.size` | 10 | Maximum connections per pool |\n| `hbase.connection.idle.timeout` | 300 | Idle timeout in seconds |\n\n### Using Configuration Constants\n\nThe driver provides named constants for configuration keys, compatible with HBase Java driver's HConstants:\n\n```python\nfrom hbasedriver.client.client import Client\nfrom hbasedriver.hbase_constants import HConstants\n\nconfig = {\n    HConstants.ZOOKEEPER_QUORUM: \"localhost:2181\",\n    HConstants.CONNECTION_POOL_SIZE: 20,\n    HConstants.CONNECTION_IDLE_TIMEOUT: 600\n}\nclient = Client(config)\n```\n\n### String Literals (Backward Compatible)\n\nYou can also use string literals directly:\n\n```python\nconfig = {\n    \"hbase.zookeeper.quorum\": \"localhost:2181\",\n    \"hbase.connection.pool.size\": 20\n}\nclient = Client(config)\n```\n\n## API Reference\n\n### Client\n\nMain entry point for HBase operations.\n\n```python\nfrom hbasedriver.client.client import Client\nfrom hbasedriver.hbase_constants import HConstants\n\nclient = Client({HConstants.ZOOKEEPER_QUORUM: \"localhost:2181\"})\n\n# Get admin for DDL operations\nadmin = client.get_admin()\n\n# Get table for data operations\ntable = client.get_table(\"default\", \"mytable\")\n\n# Close when done\nclient.close()\n```\n\n### Table\n\nPerform data operations on a specific table.\n\n```python\nfrom hbasedriver.operations.put import Put\nfrom hbasedriver.operations.get import Get\nfrom hbasedriver.operations.delete import Delete\nfrom hbasedriver.operations.scan import Scan\n\n# Put data\ntable.put(Put(b\"row1\").add_column(b\"cf\", b\"col\", b\"value\"))\n\n# Get data\nrow = table.get(Get(b\"row1\"))\nif row:\n    print(row.get(b\"cf\", b\"col\"))\n\n# Delete data\ntable.delete(Delete(b\"row1\"))\n\n# Scan data\nwith table.scan(Scan()) as scanner:\n    for row in scanner:\n        print(row.rowkey)\n```\n\n### Admin\n\nPerform DDL operations.\n\n```python\nfrom hbasedriver.model import ColumnFamilyDescriptor\nfrom hbasedriver.table_name import TableName\n\n# Create table\ncfd = ColumnFamilyDescriptor(b\"cf\")\nadmin.create_table(TableName.value_of(b\"mytable\"), [cfd])\n\n# Disable table\nadmin.disable_table(TableName.value_of(b\"mytable\"))\n\n# Enable table\nadmin.enable_table(TableName.value_of(b\"mytable\"))\n\n# Delete table (must be disabled first)\nadmin.disable_table(TableName.value_of(b\"mytable\"))\nadmin.delete_table(TableName.value_of(b\"mytable\"))\n\n# List tables\ntables = admin.list_tables()\n```\n\n### Operations\n\n#### Put\n\n```python\nfrom hbasedriver.operations.put import Put\n\n# Simple put\nput = Put(b\"row1\").add_column(b\"cf\", b\"col\", b\"value\")\ntable.put(put)\n\n# Multiple columns\nput = Put(b\"row2\") \\\n    .add_column(b\"cf\", b\"name\", b\"Alice\") \\\n    .add_column(b\"cf\", b\"age\", b\"30\") \\\n    .add_column(b\"info\", b\"email\", b\"alice@example.com\")\ntable.put(put)\n\n# With timestamp\nimport time\nts = int(time.time() * 1000)\nput = Put(b\"row3\").add_column(b\"cf\", b\"col\", b\"value\", ts=ts)\ntable.put(put)\n```\n\n#### Get\n\n```python\nfrom hbasedriver.operations.get import Get\n\n# Get entire row\nrow = table.get(Get(b\"row1\"))\n\n# Get specific column\nrow = table.get(Get(b\"row1\").add_column(b\"cf\", b\"col\"))\n\n# Get multiple columns\nrow = table.get(Get(b\"row1\")\n    .add_column(b\"cf\", b\"name\")\n    .add_column(b\"cf\", b\"age\"))\n\n# With time range\nstart_ts = int((time.time() - 86400) * 1000)  # 24 hours ago\nend_ts = int(time.time() * 1000)\nrow = table.get(Get(b\"row1\").set_time_range(start_ts, end_ts))\n\n# Check existence only\nexists = table.get(Get(b\"row1\").set_check_existence_only(True)) is not None\n```\n\n#### Scan\n\n```python\nfrom hbasedriver.operations.scan import Scan\n\n# Scan entire table\nwith table.scan(Scan()) as scanner:\n    for row in scanner:\n        print(row.rowkey)\n\n# Scan with row key range\nscan = Scan(start_row=b\"row1\", end_row=b\"row9\")\nwith table.scan(scan) as scanner:\n    for row in scanner:\n        print(row.rowkey)\n\n# Scan with specific columns\nscan = Scan().add_column(b\"cf\", b\"col\")\nwith table.scan(scan) as scanner:\n    for row in scanner:\n        print(row.get(b\"cf\", b\"col\"))\n\n# Scan with limit\nscan = Scan().set_limit(100)\nwith table.scan(scan) as scanner:\n    for row in scanner:\n        print(row.rowkey)\n\n# Pagination\nscan = Scan()\nrows, resume_key = table.scan_page(scan, page_size=100)\nwhile resume_key:\n    scan = Scan(start_row=resume_key, include_start_row=False)\n    rows, resume_key = table.scan_page(scan, page_size=100)\n```\n\n#### Batch Operations\n\n```python\nfrom hbasedriver.operations.batch import BatchGet, BatchPut\n\n# Batch get\nbg = BatchGet([b\"row1\", b\"row2\", b\"row3\"])\nbg.add_column(b\"cf\", b\"col1\")\nresults = table.batch_get(bg)\n\n# Batch put\nbp = BatchPut()\nbp.add_put(Put(b\"row1\").add_column(b\"cf\", b\"col1\", b\"value1\"))\nbp.add_put(Put(b\"row2\").add_column(b\"cf\", b\"col1\", b\"value2\"))\nresults = table.batch_put(bp)\n\n# Context manager for batch\nwith table.batch(batch_size=1000) as batch:\n    batch.put(b\"row1\", {b\"cf:col1\": b\"value1\"})\n    batch.put(b\"row2\", {b\"cf:col1\": b\"value2\"})\n    batch.delete(b\"row3\")\n# All operations executed when exiting context\n```\n\n#### Check and Put\n\n```python\nfrom hbasedriver.operations.increment import CheckAndPut\n\ncap = CheckAndPut(b\"row1\")\ncap.set_check(b\"cf\", b\"lock\", b\"\")  # Check if lock is empty\ncap.set_put(Put(b\"row1\").add_column(b\"cf\", b\"data\", b\"value\"))\nsuccess = table.check_and_put(cap)\n```\n\n#### Increment\n\n```python\nfrom hbasedriver.operations.increment import Increment\n\ninc = Increment(b\"row1\")\ninc.add_column(b\"cf\", b\"counter\", 1)\nnew_value = table.increment(inc)\n```\n\n### Filters\n\nThe driver supports server-side filters:\n\n```python\nfrom hbasedriver.filter import PrefixFilter, RowFilter\nfrom hbasedriver.filter.compare_filter import CompareOperator\nfrom hbasedriver.filter.binary_comparator import BinaryComparator\n\n# Prefix filter\nscan = Scan().set_filter(PrefixFilter(b\"abc\"))\n\n# Row filter with comparison\nscan = Scan().set_filter(\n    RowFilter(CompareOperator.EQUAL, BinaryComparator(b\"row1\"))\n)\n```\n\n## Java Compatibility\n\nThis driver is designed to be familiar to HBase Java developers. Here's a quick comparison:\n\n| Java Driver | Python Driver |\n|-------------|---------------|\n| `Connection connection = ConnectionFactory.createConnection(config)` | `client = Client(config)` |\n| `Table table = connection.getTable(TableName.valueOf(\"mytable\"))` | `table = client.get_table(\"default\", \"mytable\")` |\n| `table.put(new Put(Bytes.toBytes(\"row1\"))...` | `table.put(Put(b\"row1\")...` |\n| `Result result = table.get(new Get(Bytes.toBytes(\"row1\"))...` | `row = table.get(Get(b\"row1\")...` |\n| `try (ResultScanner scanner = table.scan(...))` | `with table.scan(...) as scanner:` |\n| `try (Connection conn = ...)` | `with Client(config) as client:` |\n\n### Configuration Constants\n\nJava's `HConstants` are available as `hbase_constants.HConstants`:\n\n| Java | Python |\n|------|--------|\n| `HConstants.ZOOKEEPER_QUORUM` | `HConstants.ZOOKEEPER_QUORUM` |\n| `HConstants.ZOOKEEPER_ZNODE_PARENT` | `HConstants.ZOOKEEPER_ZNODE_PARENT` |\n| (Custom connection pool size) | `HConstants.CONNECTION_POOL_SIZE` |\n| (Custom idle timeout) | `HConstants.CONNECTION_IDLE_TIMEOUT` |\n\n## Development\n\n### Quickstart (3-node Docker dev environment)\n\nPrerequisites: Docker and docker-compose installed.\n\n1. Build, start the custom 3-node cluster and run the full test suite:\n\n```bash\n./scripts/run_tests_3node.sh\n```\n\n2. To run tests against an already-running cluster (fast):\n\n```bash\n./scripts/run_tests_3node.sh --no-start\n```\n\n3. Run a single test file or case:\n\n```bash\n./scripts/run_tests_3node.sh test/test_scan.py\n./scripts/run_tests_3node.sh test/test_scan.py::test_scan\n```\n\nLegacy single-node dev workflow (still available):\n\n```bash\n./scripts/run_tests_docker.sh\n```\n\nSee [TEST_GUIDE.md](docs/TEST_GUIDE.md) and [DEV_ENV.md](docs/DEV_ENV.md) for full documentation and troubleshooting steps.\n\n## Documentation\n\n- [API Reference](docs/api_reference.md) - Comprehensive API documentation\n- [Advanced Usage](docs/advanced_usage.md) - Advanced features and patterns\n- [Performance Guide](docs/performance_guide.md) - Performance tuning and optimization\n- [Troubleshooting](docs/troubleshooting.md) - Common issues and solutions\n- [Migration Guide](docs/migration_guide.md) - Migration from Java HBase, Happybase, and Thrift clients\n- [Migration from happybase](docs/migration_from_happybase.md) - Guide for migrating from happybase/happybase-thrift\n- [中文介绍](docs/中文介绍.md) - 中文文档介绍 | Chinese Introduction\n\n## License\n\nApache License 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnovationb1ue%2Fhbase-driver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnovationb1ue%2Fhbase-driver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnovationb1ue%2Fhbase-driver/lists"}