{"id":49225498,"url":"https://github.com/tonicai/tonic-fabricate-python","last_synced_at":"2026-04-24T07:02:45.956Z","repository":{"id":334239853,"uuid":"1046138113","full_name":"TonicAI/tonic-fabricate-python","owner":"TonicAI","description":"The official Fabricate client package for Python.","archived":false,"fork":false,"pushed_at":"2026-01-23T15:15:10.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T06:32:51.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TonicAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-08-28T08:43:18.000Z","updated_at":"2025-08-28T08:56:14.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/TonicAI/tonic-fabricate-python","commit_stats":null,"previous_names":["tonicai/tonic-fabricate-python"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/TonicAI/tonic-fabricate-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonicAI%2Ftonic-fabricate-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonicAI%2Ftonic-fabricate-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonicAI%2Ftonic-fabricate-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonicAI%2Ftonic-fabricate-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TonicAI","download_url":"https://codeload.github.com/TonicAI/tonic-fabricate-python/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TonicAI%2Ftonic-fabricate-python/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32212810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T03:15:14.334Z","status":"ssl_error","status_checked_at":"2026-04-24T03:15:11.608Z","response_time":64,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-04-24T07:02:43.311Z","updated_at":"2026-04-24T07:02:45.949Z","avatar_url":"https://github.com/TonicAI.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fabricate Client\n\nThe official [Fabricate](https://www.tonic.ai/products/fabricate) client package for Python.\n\n## Installation\n\n```bash\npip install tonic-fabricate\n```\n\n## Usage\n\nTo generate and download data from Fabricate:\n\n```python\nfrom tonic_fabricate import generate\n\ngenerate(\n    # The workspace to use\n    workspace='Default',\n\n    # The name of the database to generate\n    database='ecommerce',\n\n    # The format to generate. Should be one of:\n    # - 'sql'\n    # - 'sqlite'\n    # - 'csv'\n    # - 'jsonl'\n    # - 'xml'\n    format='sql',\n\n    # The destination to save the data\n    dest='./data',\n\n    # Optional: Overwrite the destination if it exists\n    overwrite=True,\n\n    # Optional: Generate a single table\n    # entity='Customers',\n)\n```\n\nTo push data to an existing database:\n\n```python\nfrom tonic_fabricate import generate\nimport os\n\ngenerate(\n    # The workspace to use\n    workspace='Default',\n\n    # The name of the database in Fabricate\n    database='ecommerce',\n\n    # The connection details for the target database\n    connection={\n        # The host of the target database\n        'host': 'host.example.com',\n\n        # The port of the target database\n        'port': 5432,\n\n        # The name of the target database\n        'database_name': 'ecommerce',\n\n        # The username for the target database\n        'username': os.environ.get('FABRICATE_DATABASE_USERNAME'),\n\n        # The password for the target database\n        'password': os.environ.get('FABRICATE_DATABASE_PASSWORD'),\n\n        # Whether to use TLS for the connection\n        'tls': True,\n    },\n)\n```\n\n## Progress Tracking\n\nYou can track the progress of data generation using a callback function:\n\n```python\nfrom tonic_fabricate import generate\n\ndef on_progress(data):\n    phase = data.get('phase', '')\n    percent = data.get('percentComplete', 0)\n    status = data.get('status', '')\n\n    phase_text = f\"[{phase}] \" if phase else \"\"\n    status_text = f\", {status}\" if status else \"\"\n    print(f\"{phase_text}{percent}% complete{status_text}...\")\n\ngenerate(\n    workspace='Default',\n    database='ecommerce',\n    format='sql',\n    dest='./data',\n    on_progress=on_progress\n)\n```\n\n## Environment Variables\n\nThe client will automatically use the following environment variables if they are set:\n\n- `FABRICATE_API_KEY`: Your Fabricate API key\n- `FABRICATE_API_URL`: The Fabricate API URL (defaults to https://fabricate.tonic.ai/api/v1)\n\n## Error Handling\n\nThe client raises appropriate exceptions for various error conditions:\n\n```python\nfrom tonic_fabricate import generate\n\ntry:\n    generate(\n        workspace='Default',\n        database='ecommerce',\n        format='sql',\n        dest='./data'\n    )\nexcept ValueError as e:\n    print(f\"Invalid parameters: {e}\")\nexcept Exception as e:\n    print(f\"Generation failed: {e}\")\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonicai%2Ftonic-fabricate-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftonicai%2Ftonic-fabricate-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftonicai%2Ftonic-fabricate-python/lists"}