{"id":38681277,"url":"https://github.com/fortierq/mtgscan","last_synced_at":"2026-01-17T10:13:45.281Z","repository":{"id":44927344,"uuid":"307382930","full_name":"fortierq/mtgscan","owner":"fortierq","description":"Recognition of Magic cards on images. Detection with OCR.","archived":false,"fork":false,"pushed_at":"2022-11-21T19:50:37.000Z","size":2934,"stargazers_count":71,"open_issues_count":0,"forks_count":9,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T23:14:13.079Z","etag":null,"topics":["card","computer-vision","deck","detect","magic","magic-the-gathering","mtg","ocr","recognition","scan","scanner","screenshot","vision"],"latest_commit_sha":null,"homepage":"https://fortierq.github.io/mtgscan-ocr-azure-flask-celery-socketio","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fortierq.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}},"created_at":"2020-10-26T13:32:50.000Z","updated_at":"2025-07-29T03:04:07.000Z","dependencies_parsed_at":"2022-09-10T20:22:48.722Z","dependency_job_id":null,"html_url":"https://github.com/fortierq/mtgscan","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/fortierq/mtgscan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortierq%2Fmtgscan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortierq%2Fmtgscan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortierq%2Fmtgscan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortierq%2Fmtgscan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fortierq","download_url":"https://codeload.github.com/fortierq/mtgscan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fortierq%2Fmtgscan/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28505863,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T06:57:29.758Z","status":"ssl_error","status_checked_at":"2026-01-17T06:56:03.931Z","response_time":85,"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":["card","computer-vision","deck","detect","magic","magic-the-gathering","mtg","ocr","recognition","scan","scanner","screenshot","vision"],"created_at":"2026-01-17T10:13:45.208Z","updated_at":"2026-01-17T10:13:45.270Z","avatar_url":"https://github.com/fortierq.png","language":"Python","readme":"# MTGScan\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n[![CodeFactor](https://www.codefactor.io/repository/github/fortierq/mtgscan/badge)](https://www.codefactor.io/repository/github/fortierq/mtgscan)\n\n![mtgscan](https://user-images.githubusercontent.com/49362475/102022934-448ffb80-3d8a-11eb-8948-3a10d190162a.jpg)\n\nMTGScan uses OCR recognition to list Magic cards from an image.  \nAfter OCR, cards are looked up in a dictionnary provided by [MTGJSON](https://mtgjson.com), using fuzzy search with [SymSpell](https://github.com/wolfgarbe/SymSpell).\n\n## [Try the Web App](http://mtgscan.net) (DOWN for now)\n```mermaid\n  flowchart LR;\n  subgraph \"Browser\"\n    C1[Client];\n    C2[Client];\n    C3[Client];\n  end\n  subgraph \"Frontend\"\n    F((Flask Server));\n  end\n  subgraph \"Backend\"\n    W1[Celery Worker\u003cbr\u003eusing mtgscan];\n    W2[Celery Worker\u003cbr\u003eusing mtgscan];\n  end\n  subgraph \"Cloud\"\n    A[Azure Read OCR];\n  end\n  C1 \u003c--\u003e|Socket.IO| F;\n  C2 \u003c--\u003e|Socket.IO| F;\n  C3 \u003c--\u003e|Socket.IO| F;\n  F \u003c--\u003e|RedisMQ| W1;\n  F \u003c--\u003e|RedisMQ| W2;\n  W1 \u003c--\u003e|API| A;\n  W2 \u003c--\u003e|API| A;\n```\n[Repository for the web app](https://github.com/fortierq/mtgscan-app)\n\n## Prerequisites\n\n- Python \u003e= 3.7\n- (Recommended) Poetry\n- Credentials for the required OCR (e.g Azure Computer Vision Read API)\n\n## Installation\n\n### ... with Poetry\n\n```python\npoetry install\n```\n\n### ...  with pip\n\n```console\npip install mtgscan\n```\n\n### ... with docker\n\nSee https://github.com/fortierq/mtgscan-app\n\n## OCR\n\nCurrently, only Azure OCR is supported. To add an OCR, inherit mtgscan.ocr.OCR.  \n\n### Azure\n\nAPI subscription key and endpoint must be stored in environment variables `AZURE_VISION_KEY` and `AZURE_VISION_ENDPOINT` respectively.  \nSteps:\n- Subscribre for a free Azure account: https://azure.microsoft.com/free/cognitive-services\n- Create a Computer Vision resource: https://portal.azure.com/#create/Microsoft.CognitiveServicesComputerVision\n- Get your key and endpoint\n\n## Tests\n\nEvery test case is stored in a separated folder in tests/samples/ containing:\n- image.*: image of Magic cards\n- deck.txt: decklist of the cards on the image\n\nTo run every test:\n```python\npoetry run python tests/test.py\n```\n\nThis produces the following outputs, for each sample and OCR:\n- statistics about number of cards found, number of errors...\n- test.log: informations about the run\n- errors.txt: history of the number of errors made by the OCR\n- box_texts.txt: output of the OCR\n\n## Example\n\n[This example](./example.py) scans the following screenshot:\n![Screenshot](https://user-images.githubusercontent.com/49362475/105632710-fa07a180-5e54-11eb-91bb-c4710ef8168f.jpeg)\n\n```\n$ poetry run python example.py\n\nLoading https://mtgjson.com/api/v5/VintageAtomic.json\nLoaded all_cards.txt: 23253 cards\nLoading https://mtgjson.com/api/v5/Keywords.json\nLoaded Keywords.json: 282 keywords\n4 Ancient Tomb\n4 Mishra's Factory\n4 Mishra's Workshop\n1 Strip Mine\n1 Tolarian Academy\n4 Wasteland\n1 Sacrifice\n1 Mox Ruby\n1 Mox Emerald\n1 Mox Jet\n1 Mox Pearl\n1 Mox Sapphire\n1 Black Lotus\n1 Mana Crypt\n1 Sol Ring\n4 Phyrexian Revoker\n4 Arcbound Ravager\n1 Thorn of Amethyst\n4 Sphere of Resistance\n4 Foundry Inspector\n3 Chief of the Foundry\n1 Trinisphere\n1 Lodestone Golem\n1 Mystic Forge\n2 Fleetwheel Cruiser\n1 Traxos, Scourge of Kroog\n4 Walking Ballista\n3 Stonecoil Serpent\n1 Chalice of the Void\n\n3 Mindbreak Trap\n4 Leyline of the Void\n2 Crucible of Worlds\n4 Pithing Needle\n2 Wurmcoil Engine\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortierq%2Fmtgscan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffortierq%2Fmtgscan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffortierq%2Fmtgscan/lists"}