{"id":35600563,"url":"https://github.com/mabel-dev/opteryx-catalog","last_synced_at":"2026-02-27T21:19:19.728Z","repository":{"id":327746254,"uuid":"1110601663","full_name":"mabel-dev/opteryx-catalog","owner":"mabel-dev","description":"📚 Opteryx Cloud Catalog","archived":false,"fork":false,"pushed_at":"2026-02-19T23:13:31.000Z","size":510,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-20T03:35:28.288Z","etag":null,"topics":["catalog","data","python","sql"],"latest_commit_sha":null,"homepage":"https://opteryx.app","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/mabel-dev.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":"2025-12-05T12:47:27.000Z","updated_at":"2026-02-19T23:12:56.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/mabel-dev/opteryx-catalog","commit_stats":null,"previous_names":["mabel-dev/pyiceberg-firestore-gcs","mabel-dev/opteryx-catalog"],"tags_count":75,"template":false,"template_full_name":null,"purl":"pkg:github/mabel-dev/opteryx-catalog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabel-dev%2Fopteryx-catalog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabel-dev%2Fopteryx-catalog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabel-dev%2Fopteryx-catalog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabel-dev%2Fopteryx-catalog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mabel-dev","download_url":"https://codeload.github.com/mabel-dev/opteryx-catalog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mabel-dev%2Fopteryx-catalog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29914466,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T19:37:42.220Z","status":"ssl_error","status_checked_at":"2026-02-27T19:37:41.463Z","response_time":57,"last_error":"SSL_read: 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":["catalog","data","python","sql"],"created_at":"2026-01-05T01:21:32.945Z","updated_at":"2026-02-27T21:19:19.703Z","avatar_url":"https://github.com/mabel-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pyiceberg-firestore-gcs\n\nA Firestore + Google Cloud Storage (GCS) backed implementation of a\nlightweight catalog interface. This package provides an opinionated\ncatalog implementation for storing table metadata documents in Firestore and\nconsolidated Parquet manifests in GCS.\n\n**Important:** This library is *modelled after* Apache Iceberg but is **not\ncompatible** with Iceberg; it is a separate implementation with different\nstorage conventions and metadata layout. This library is the catalog and\nmetastore used by [opteryx.app](https://opteryx.app/) and uses **Firestore** as the primary\nmetastore and **GCS** for data and manifest storage.\n\n---\n\n## Features ✅\n\n- Firestore-backed catalog and collection storage\n- GCS-based table metadata storage; export/import utilities available for artifact conversion\n- Table creation, registration, listing, loading, renaming, and deletion\n- Commit operations that write updated metadata to GCS and persist references in Firestore\n- Simple, opinionated defaults (e.g., default GCS location derived from catalog properties)\n- Lightweight schema handling (supports pyarrow schemas)\n\n## Quick start 💡\n\n1. Ensure you have GCP credentials available to the environment. Typical approaches:\n   - Set `GOOGLE_APPLICATION_CREDENTIALS` to a service account JSON key file, or\n   - Use `gcloud auth application-default login` for local development.\n\n2. Install locally (or publish to your package repo):\n\n```bash\npython -m pip install -e .\n```\n\n3. Create a `FirestoreCatalog` and use it in your application:\n\n```python\nfrom pyiceberg_firestore_gcs import create_catalog\nfrom pyiceberg.schema import Schema, NestedField\nfrom pyiceberg.types import IntegerType, StringType\n\ncatalog = create_catalog(\n\t\"my_catalog\",\n\tfirestore_project=\"my-gcp-project\",\n\tgcs_bucket=\"my-default-bucket\",\n)\n\n# Create a collection\ncatalog.create_collection(\"example_collection\")\n\n# Create a simple PyIceberg schema\nschema = Schema(\n\tNestedField(field_id=1, name=\"id\", field_type=IntegerType(), required=True),\n\tNestedField(field_id=2, name=\"name\", field_type=StringType(), required=False),\n)\n\n# Create a new dataset (metadata written to a GCS path derived from the bucket property)\ntable = catalog.create_dataset((\"example_collection\", \"users\"), schema)\n\n# Or register a table if you already have a metadata JSON in GCS\ncatalog.register_table((\"example_namespace\", \"events\"), \"gs://my-bucket/path/to/events/metadata/00000001.json\")\n\n# Load a table\ntbl = catalog.load_dataset((\"example_namespace\", \"users\"))\nprint(tbl.metadata)\n```\n\n## Configuration and environment 🔧\n\n- GCP authentication: Use `GOOGLE_APPLICATION_CREDENTIALS` or Application Default Credentials\n- `firestore_project` and `firestore_database` can be supplied when creating the catalog\n- `gcs_bucket` is recommended to allow `create_dataset` to write metadata automatically; otherwise pass `location` explicitly to `create_dataset`\n - The catalog writes consolidated Parquet manifests and does not write manifest-list artifacts in the hot path. Use the provided export/import utilities for artifact conversion when necessary.\n\nExample environment variables:\n\n```bash\nexport GOOGLE_APPLICATION_CREDENTIALS=\"/path/to/service-account.json\"\nexport GOOGLE_CLOUD_PROJECT=\"my-gcp-project\"\n```\n\n### Manifest format\n\nThis catalog writes consolidated Parquet manifests for fast query planning and stores table metadata in Firestore. Manifests and data files are stored in GCS. If you need different artifact formats, use the provided export/import utilities to convert manifests outside the hot path.\n\n## API overview 📚\n\nThe package exports a factory helper `create_catalog` and the `FirestoreCatalog` class.\n\nKey methods include:\n- `create_collection(collection, properties={}, exists_ok=False)`\n- `drop_namespace(namespace)`\n- `list_namespaces()`\n- `create_dataset(identifier, schema, location=None, partition_spec=None, sort_order=None, properties={})`\n- `register_table(identifier, metadata_location)`\n- `load_dataset(identifier)`\n- `list_datasets(namespace)`\n- `drop_dataset(identifier)`\n- `rename_table(from_identifier, to_identifier)`\n- `commit_table(table, requirements, updates)`\n- `create_view(identifier, sql, schema=None, author=None, description=None, properties={})`\n- `load_view(identifier)`\n- `list_views(namespace)`\n- `view_exists(identifier)`\n- `drop_view(identifier)`\n- `update_view_execution_metadata(identifier, row_count=None, execution_time=None)`\n\n### Views 👁️\n\nViews are SQL queries stored in the catalog that can be referenced like tables. Each view includes:\n- **SQL statement**: The query that defines the view\n- **Schema**: The expected result schema (optional but recommended)\n- **Metadata**: Author, description, creation/update timestamps\n- **Execution history**: Last run time, row count, execution time\n\nExample usage:\n```python\nfrom pyiceberg.schema import Schema, NestedField\nfrom pyiceberg.types import IntegerType, StringType\n\n# Create a schema for the view\nschema = Schema(\n    NestedField(field_id=1, name=\"user_id\", field_type=IntegerType(), required=True),\n    NestedField(field_id=2, name=\"username\", field_type=StringType(), required=False),\n)\n\n# Create a view\nview = catalog.create_view(\n    identifier=(\"my_namespace\", \"active_users\"),\n    sql=\"SELECT user_id, username FROM users WHERE active = true\",\n    schema=schema,\n    author=\"data_team\",\n    description=\"View of all active users in the system\"\n)\n\n# Load a view\nview = catalog.load_view((\"my_namespace\", \"active_users\"))\nprint(f\"SQL: {view.sql}\")\nprint(f\"Schema: {view.metadata.schema}\")\n\n# Update execution metadata after running the view\ncatalog.update_view_execution_metadata(\n    (\"my_namespace\", \"active_users\"),\n    row_count=1250,\n    execution_time=0.45\n)\n```\n\nNotes about behavior:\n- `create_dataset` will try to infer a default GCS location using the provided `gcs_bucket` property if `location` is omitted.\n- `register_table` validates that the provided `metadata_location` points to an existing GCS blob.\n- Views are stored as Firestore documents with complete metadata including SQL, schema, authorship, and execution history.\n- Table transactions are intentionally unimplemented.\n\n## Development \u0026 Linting 🧪\n\nThis package includes a small `Makefile` target to run linting and formatting tools (`ruff`, `isort`, `pycln`).\n\nInstall dev tools and run linters with:\n\n```bash\npython -m pip install --upgrade pycln isort ruff\nmake lint\n```\n\nRunning tests (if you add tests):\n\n```bash\npython -m pytest\n```\n\n## Compaction 🔧\n\nThis catalog supports small file compaction to improve query performance. See [COMPACTION.md](COMPACTION.md) for detailed design documentation.\n\n### Quick Start\n\n```python\nfrom pyiceberg_firestore_gcs import create_catalog\nfrom pyiceberg_firestore_gcs.compaction import compact_table, get_compaction_stats\n\ncatalog = create_catalog(...)\n\n# Check if compaction is needed\ntable = catalog.load_dataset((\"namespace\", \"dataset_name\"))\nstats = get_compaction_stats(table)\nprint(f\"Small files: {stats['small_file_count']}\")\n\n# Run compaction\nresult = compact_table(catalog, (\"namespace\", \"table_name\"))\nprint(f\"Compacted {result.files_rewritten} files\")\n```\n\n### Configuration\n\nControl compaction behavior via table properties:\n\n```python\ntable = catalog.create_dataset(\n    identifier=(\"namespace\", \"table_name\"),\n    schema=schema,\n    properties={\n        \"compaction.enabled\": \"true\",\n        \"compaction.min-file-count\": \"10\",\n        \"compaction.max-small-file-size-bytes\": \"33554432\",  # 32 MB\n        \"write.target-file-size-bytes\": \"134217728\"  # 128 MB\n    }\n)\n```\n\n## Limitations \u0026 KNOWN ISSUES ⚠️\n\n- No support for dataset-level transactions. `create_dataset_transaction` raises `NotImplementedError`.\n- The catalog stores metadata location references in Firestore; purging metadata files from GCS is not implemented.\n- This is an opinionated implementation intended for internal or controlled environments. Review for production constraints before use in multi-tenant environments.\n\n## Contributing 🤝\n\nContributions are welcome. Please follow these steps:\n\n1. Fork the repository and create a feature branch.\n2. Run and pass linting and tests locally.\n3. Submit a PR with a clear description of the change.\n\nPlease add unit tests and docs for new behaviors.\n\n---\n\nIf you'd like, I can also add usage examples that show inserting rows using PyIceberg readers/writers, or add CI testing steps to the repository. ✅\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabel-dev%2Fopteryx-catalog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmabel-dev%2Fopteryx-catalog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmabel-dev%2Fopteryx-catalog/lists"}