{"id":34032591,"url":"https://github.com/wa8eem/wikidata-identifier-extractor","last_synced_at":"2026-03-08T21:34:47.146Z","repository":{"id":325712763,"uuid":"1102132459","full_name":"wa8eem/wikidata-identifier-extractor","owner":"wa8eem","description":"Extract cross-platform media identifiers from Wikidata (IMDb, Trakt, TMDB, etc.)","archived":false,"fork":false,"pushed_at":"2025-11-22T22:38:29.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-23T00:12:28.730Z","etag":null,"topics":["imdb","python","trakt-api","traktflix","wikidata","wikidata-api"],"latest_commit_sha":null,"homepage":"","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/wa8eem.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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-11-22T21:57:58.000Z","updated_at":"2025-11-22T22:44:30.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wa8eem/wikidata-identifier-extractor","commit_stats":null,"previous_names":["wa8eem/wikidata-identifier-extractor"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/wa8eem/wikidata-identifier-extractor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wa8eem%2Fwikidata-identifier-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wa8eem%2Fwikidata-identifier-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wa8eem%2Fwikidata-identifier-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wa8eem%2Fwikidata-identifier-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wa8eem","download_url":"https://codeload.github.com/wa8eem/wikidata-identifier-extractor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wa8eem%2Fwikidata-identifier-extractor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30274508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"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":["imdb","python","trakt-api","traktflix","wikidata","wikidata-api"],"created_at":"2025-12-13T18:53:03.164Z","updated_at":"2026-03-08T21:34:47.141Z","avatar_url":"https://github.com/wa8eem.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Wikidata Identifier Extractor\n\n[![PyPI version](https://badge.fury.io/py/wikidata-identifier-extractor.svg)](https://badge.fury.io/py/wikidata-identifier-extractor)\n[![Python Versions](https://img.shields.io/pypi/pyversions/wikidata-identifier-extractor.svg)](https://pypi.org/project/wikidata-identifier-extractor/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA powerful Python library for extracting cross-platform media identifiers from [Wikidata](https://www.wikidata.org/). Find IMDb, Trakt, TMDB, Rotten Tomatoes IDs and more for movies, TV shows, and episodes.\n\n## Features\n\n✨ **Cross-Platform Mapping**: Get identifiers for IMDb, Trakt, TMDB, Rotten Tomatoes, and more  \n🔗 **Relationship Data**: Automatically fetch sequels, prequels, and series information  \n💾 **Built-in Caching**: Efficient caching to minimize API calls  \n🆓 **No API Keys Required**: Uses Wikidata's free SPARQL endpoint  \n📊 **Comprehensive Coverage**: Access millions of movies, TV shows, and episodes  \n🔄 **Automatic URL Generation**: Get ready-to-use URLs for all platforms  \n\n## Installation\n\n```bash\npip install wikidata-identifier-extractor\n```\n\n## Quick Start\n\n```python\nfrom wikidata_identifier_extractor import WikidataIdentifierExtractor\n\n# Initialize the extractor\nextractor = WikidataIdentifierExtractor()\n\n# Search by IMDb ID\nresult = extractor.get_identifiers(imdb_id=\"tt1375666\")\n\nprint(f\"Title: {result['title']}\")           # Inception\nprint(f\"Trakt: {result['trakt']}\")           # movies/inception-2010\nprint(f\"TMDB: {result['tmdb_movie']}\")       # 27205\nprint(f\"IMDb URL: {result['urls']['imdb']}\")  # https://www.imdb.com/title/tt1375666\n```\n\n## Usage Examples\n\n### Search by Trakt Slug\n\n```python\nresult = extractor.get_identifiers(trakt_slug=\"movies/inception-2010\")\n\nprint(result['imdb'])          # tt1375666\nprint(result['wikidata_id'])   # Q25188\n```\n\n### Get Movie Sequels/Prequels\n\n```python\n# Lord of the Rings: The Two Towers\nresult = extractor.get_identifiers(imdb_id=\"tt0167261\")\n\n# Get previous movie\nif result.get('follows'):\n    print(result['follows']['title'])  # The Fellowship of the Ring\n    print(result['follows']['imdb'])   # tt0120737\n\n# Get next movie\nif result.get('followed_by'):\n    print(result['followed_by']['title'])  # The Return of the King\n    print(result['followed_by']['imdb'])   # tt0167260\n\n# Get series information\nif result.get('series'):\n    print(result['series']['title'])  # The Lord of the Rings trilogy\n```\n\n### Disable Relation Fetching\n\nFor faster queries when you don't need related items:\n\n```python\nresult = extractor.get_identifiers(\n    imdb_id=\"tt0167261\",\n    fetch_relations=False  # Skip fetching series/follows/followed_by\n)\n```\n\n## Response Structure\n\n```python\n{\n    'wikidata_id': 'Q25188',\n    'title': 'Inception',\n    'imdb': 'tt1375666',\n    'trakt': 'movies/inception-2010',\n    'trakt_film': 'inception-2010',\n    'tmdb_movie': '27205',\n    'rotten_tomatoes': 'm/inception',\n    'google_kg': '/g/11b6vxwpkm',\n    'fandom_wiki': 'inception',\n    'part_of_series_id': None,\n    'follows_id': None,\n    'followed_by_id': None,\n    'urls': {\n        'wikidata': 'https://www.wikidata.org/wiki/Q25188',\n        'imdb': 'https://www.imdb.com/title/tt1375666',\n        'trakt': 'https://trakt.tv/movies/inception-2010',\n        'tmdb_movie': 'https://www.themoviedb.org/movie/27205',\n        # ... more URLs\n    },\n    'series': None,        # Populated if part of a series\n    'follows': None,       # Populated if there's a previous item\n    'followed_by': None    # Populated if there's a next item\n}\n```\n\n## Supported Identifiers\n\n| Platform | Property | Example |\n|----------|----------|---------|\n| Wikidata | wikidata_id | Q25188 |\n| IMDb | imdb | tt1375666 |\n| Trakt.tv | trakt | movies/inception-2010 |\n| Trakt Film | trakt_film | inception-2010 |\n| TMDB Movie | tmdb_movie | 27205 |\n| TMDB Series | tmdb_series | 1399 |\n| TMDB Episode | tmdb_episode | 63056 |\n| Rotten Tomatoes | rotten_tomatoes | m/inception |\n| Fandom Wiki | fandom_wiki | lotr |\n| Google Knowledge Graph | google_kg | /g/11b6vxwpkm |\n\n## Advanced Usage\n\n### Batch Processing\n\n```python\ndef process_multiple_movies(imdb_ids):\n    extractor = WikidataIdentifierExtractor()\n    results = []\n    \n    for imdb_id in imdb_ids:\n        result = extractor.get_identifiers(imdb_id=imdb_id)\n        if result:\n            results.append(result)\n    \n    return results\n\nmovies = [\"tt1375666\", \"tt0468569\", \"tt0816692\"]\nresults = process_multiple_movies(movies)\n```\n\n### Error Handling\n\n```python\ntry:\n    result = extractor.get_identifiers(imdb_id=\"tt1375666\")\n    if result:\n        print(f\"Found: {result['title']}\")\n    else:\n        print(\"No results found\")\nexcept Exception as e:\n    print(f\"Error: {e}\")\n```\n\n## How It Works\n\nThis library uses [Wikidata's SPARQL endpoint](https://query.wikidata.org/) to query structured data about media content. Wikidata is a free, collaborative knowledge base that links various platform-specific identifiers together.\n\n**Key Benefits:**\n- 🆓 Free and open - no API keys required\n- 🌐 Community-maintained and constantly updated\n- 🔗 Comprehensive cross-platform linking\n- 📈 Covers millions of movies, TV shows, and episodes\n\n## Performance\n\n- **Caching**: Built-in memory cache prevents redundant API calls\n- **Configurable Depth**: Control relationship fetching to balance speed vs data completeness\n- **Rate Limiting Friendly**: Respectful of Wikidata's SPARQL endpoint limits\n\n## Requirements\n\n- Python 3.7+\n- requests \u003e= 2.25.0\n\n## Documentation\n\nFull documentation is available in the [docs](./docs) folder:\n\n- **[Complete Guide](./docs/GUIDE.md)**: Detailed usage examples and API reference\n- **[SPARQL Tutorial](./docs/GUIDE.md#sparql-query-examples)**: Learn how to modify and extend queries\n- **[Contributing](./CONTRIBUTING.md)**: How to contribute to the project\n\n## Development\n\n```bash\n# Clone the repository\ngit clone https://github.com/wa8eem/wikidata-identifier-extractor.git\ncd wikidata-identifier-extractor\n\n# Install in development mode\npip install -e \".[dev]\"\n\n# Run tests\npytest\n\n# Format code\nblack .\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- [Wikidata](https://www.wikidata.org/) for providing free access to structured data\n- The Wikidata community for maintaining and updating the database\n\n## Support\n\n- 📫 Issues: [GitHub Issues](https://github.com/wa8eem/wikidata-identifier-extractor/issues)\n- 📖 Documentation: [Full Guide](./docs/GUIDE.md)\n- 💬 Discussions: [GitHub Discussions](https://github.com/wa8eem/wikidata-identifier-extractor/discussions)\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md) for a list of changes in each version.\n\n---\n\nMade with ❤️ using [Wikidata](https://www.wikidata.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwa8eem%2Fwikidata-identifier-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwa8eem%2Fwikidata-identifier-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwa8eem%2Fwikidata-identifier-extractor/lists"}