{"id":23088067,"url":"https://github.com/orengrinker/textfromimage","last_synced_at":"2026-05-15T20:02:12.950Z","repository":{"id":263176537,"uuid":"889605006","full_name":"OrenGrinker/textFromImage","owner":"OrenGrinker","description":"Python package (pip) - Get descriptions of images using OpenAI's GPT models, Azure OpenAI, and Anthropic Claude in an easy way.","archived":false,"fork":false,"pushed_at":"2024-11-26T18:41:14.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-19T14:17:08.140Z","etag":null,"topics":["anthropic","anthropic-claude","azure-openai","claude","image-processing","openai","package","pip","python3","textfromimage"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OrenGrinker.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}},"created_at":"2024-11-16T18:47:19.000Z","updated_at":"2024-11-26T18:41:17.000Z","dependencies_parsed_at":"2024-11-16T18:47:46.014Z","dependency_job_id":"3924f5b7-7a35-4c20-9ad8-52627496480e","html_url":"https://github.com/OrenGrinker/textFromImage","commit_stats":null,"previous_names":["orengrinker/textfromimage"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/OrenGrinker/textFromImage","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrenGrinker%2FtextFromImage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrenGrinker%2FtextFromImage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrenGrinker%2FtextFromImage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrenGrinker%2FtextFromImage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OrenGrinker","download_url":"https://codeload.github.com/OrenGrinker/textFromImage/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrenGrinker%2FtextFromImage/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33077925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-15T11:35:32.926Z","status":"ssl_error","status_checked_at":"2026-05-15T11:35:31.362Z","response_time":103,"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":["anthropic","anthropic-claude","azure-openai","claude","image-processing","openai","package","pip","python3","textfromimage"],"created_at":"2024-12-16T20:15:52.342Z","updated_at":"2026-05-15T20:02:12.938Z","avatar_url":"https://github.com/OrenGrinker.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TextFromImage\n\n![Python Version](https://img.shields.io/pypi/pyversions/textfromimage)\n![PyPI Version](https://img.shields.io/pypi/v/textfromimage)\n![License](https://img.shields.io/pypi/l/textfromimage)\n![Downloads](https://img.shields.io/pypi/dm/textfromimage)\n\nA powerful Python library for obtaining detailed descriptions of images using various AI models including OpenAI's GPT models, Azure OpenAI, and Anthropic Claude. Perfect for applications requiring image understanding, accessibility features, and content analysis. Supports both local files and URLs, with batch processing capabilities.\n\n## 🌟 Key Features\n\n- 🤖 **Multiple AI Providers**: Support for OpenAI, Azure OpenAI, and Anthropic Claude\n- 🌐 **Flexible Input**: Support for both URLs and local file paths\n- 📦 **Batch Processing**: Process multiple images (up to 20) concurrently\n- 🔄 **Flexible Integration**: Easy-to-use API with multiple initialization options\n- 🎯 **Custom Prompting**: Configurable prompts for targeted descriptions\n- 🔑 **Secure Authentication**: Multiple authentication methods including environment variables\n- 🛠️ **Model Selection**: Support for different model versions and configurations\n- 📝 **Type Hints**: Full typing support for better development experience\n\n## 📦 Installation\n\n```bash\npip install textfromimage\n\n# With Azure support\npip install textfromimage[azure]\n\n# With all optional dependencies\npip install textfromimage[all]\n```\n\n## 🚀 Quick Start\n\n```python\nimport textfromimage\n\n# Initialize with API key\ntextfromimage.openai.init(api_key=\"your-openai-api-key\")\n\n# Process single image (URL or local file)\nimage_url = 'https://example.com/image.jpg'\nlocal_image = '/path/to/local/image.jpg'\n\n# Get description from URL\nurl_description = textfromimage.openai.get_description(image_path=image_url)\n\n# Get description from local file\nlocal_description = textfromimage.openai.get_description(image_path=local_image)\n\n# Batch processing\nimage_paths = [\n    'https://example.com/image1.jpg',\n    '/path/to/local/image2.jpg',\n    'https://example.com/image3.jpg'\n]\n\nbatch_results = textfromimage.openai.get_description_batch(\n    image_paths=image_paths,\n    concurrent_limit=3  # Process 3 images at a time\n)\n\n# Process results\nfor result in batch_results:\n    if result.success:\n        print(f\"Success for {result.image_path}: {result.description}\")\n    else:\n        print(f\"Failed for {result.image_path}: {result.error}\")\n```\n\n## 💡 Advanced Usage\n\n### 🤖 Multiple Provider Support\n\n```python\n# Anthropic Claude Integration\ntextfromimage.claude.init(api_key=\"your-anthropic-api-key\")\n\n# Single image\nclaude_description = textfromimage.claude.get_description(\n    image_path=image_path,\n    model=\"claude-3-sonnet-20240229\"\n)\n\n# Batch processing\nclaude_results = textfromimage.claude.get_description_batch(\n    image_paths=image_paths,\n    model=\"claude-3-sonnet-20240229\",\n    concurrent_limit=3\n)\n\n# Azure OpenAI Integration\ntextfromimage.azure_openai.init(\n    api_key=\"your-azure-openai-api-key\",\n    api_base=\"https://your-azure-endpoint.openai.azure.com/\",\n    deployment_name=\"your-deployment-name\"\n)\n\n# Single image with system prompt\nazure_description = textfromimage.azure_openai.get_description(\n    image_path=image_path,\n    system_prompt=\"Analyze this image in detail\"\n)\n\n# Batch processing\nazure_results = textfromimage.azure_openai.get_description_batch(\n    image_paths=image_paths,\n    system_prompt=\"Analyze each image in detail\",\n    concurrent_limit=3\n)\n```\n\n### 🔧 Configuration Options\n\n```python\n# Environment Variable Configuration\nimport os\nos.environ['OPENAI_API_KEY'] = 'your-openai-api-key'\nos.environ['ANTHROPIC_API_KEY'] = 'your-anthropic-api-key'\nos.environ['AZURE_OPENAI_API_KEY'] = 'your-azure-openai-api-key'\nos.environ['AZURE_OPENAI_ENDPOINT'] = 'your-azure-endpoint'\nos.environ['AZURE_OPENAI_DEPLOYMENT'] = 'your-deployment-name'\n\n# Custom options for batch processing\nbatch_results = textfromimage.openai.get_description_batch(\n    image_paths=image_paths,\n    model='gpt-4-vision-preview',\n    prompt=\"Describe the main elements of each image\",\n    max_tokens=300,\n    concurrent_limit=5\n)\n```\n\n## 📋 Parameters and Types\n\n```python\n# Single image processing parameters\ndef get_description(\n    image_path: str,\n    prompt: str = \"What's in this image?\",\n    max_tokens: int = 300,\n    model: str = \"gpt-4-vision-preview\"\n) -\u003e str: ...\n\n# Batch processing result type\n@dataclass\nclass BatchResult:\n    success: bool\n    description: Optional[str]\n    error: Optional[str]\n    image_path: str\n\n# Batch processing parameters\ndef get_description_batch(\n    image_paths: List[str],\n    prompt: str = \"What's in this image?\",\n    max_tokens: int = 300,\n    model: str = \"gpt-4-vision-preview\",\n    concurrent_limit: int = 3\n) -\u003e List[BatchResult]: ...\n```\n\n## 🔍 Error Handling\n\n```python\nfrom textfromimage.utils import BatchResult\n\n# Single image processing\ntry:\n    description = textfromimage.openai.get_description(image_path=image_path)\nexcept ValueError as e:\n    print(f\"Image processing error: {e}\")\nexcept RuntimeError as e:\n    print(f\"API error: {e}\")\n\n# Batch processing error handling\nresults = textfromimage.openai.get_description_batch(image_paths)\nsuccessful = [r for r in results if r.success]\nfailed = [r for r in results if not r.success]\n\nfor result in failed:\n    print(f\"Failed to process {result.image_path}: {result.error}\")\n```\n\n## 🤝 Contributing\n\nWe welcome contributions! Here's how you can help:\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forengrinker%2Ftextfromimage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forengrinker%2Ftextfromimage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forengrinker%2Ftextfromimage/lists"}