Skip to main content

A Python package for fetching Chrome extension metadata from the Chrome Web Store

Project description

ChromePy

A Python package for fetching Chrome extension metadata from the Chrome Web Store.

Features

  • 🔍 Fetch extension metadata - Get detailed information about any Chrome extension
  • 📊 Rich metadata - Ratings, user count, version, permissions, and more
  • 🚀 Simple API - Easy to use with just an extension ID or URL
  • 💾 Built-in caching - Reduces requests and improves performance
  • ⏱️ Rate limiting - Respectful of Chrome Web Store servers
  • 🐍 Type hints - Full type annotations for better IDE support

Installation

pip install chromepy

For development:

pip install -e ".[dev]"

Quick Start

from chrome_extension_info import ChromeWebStoreClient

# Create a client
client = ChromeWebStoreClient()

# Fetch extension metadata by ID
extension = client.get_extension("aapbdbdomjkkjkaonfhkkikfgjllcleb")
print(f"{extension.name} - {extension.user_count:,} users, ★{extension.rating}")

# Or fetch by Chrome Web Store URL
url = "https://chrome.google.com/webstore/detail/google-translate/aapbdbdomjkkjkaonfhkkikfgjllcleb"
extension = client.get_extension_by_url(url)
print(extension.to_dict())

Available Metadata

ChromePy can fetch the following information about extensions:

  • Basic Info: Name, description, version, extension ID
  • Developer: Developer name, website, support URL, privacy policy
  • Stats: User count, rating, number of ratings
  • Technical: Size, languages, manifest version, permissions
  • Store Info: Category, last updated date, featured status
  • Assets: Icon URL, screenshot URLs

API Reference

ChromeWebStoreClient

The main client for interacting with the Chrome Web Store.

client = ChromeWebStoreClient(
    cache_ttl=3600,        # Cache duration in seconds (default: 1 hour)
    rate_limit_delay=1.0   # Delay between requests in seconds (default: 1 second)
)

Methods

  • get_extension(extension_id: str) -> ExtensionMetadata: Fetch metadata for an extension
  • get_extension_by_url(url: str) -> ExtensionMetadata: Fetch metadata from a Chrome Web Store URL
  • search_extensions(query: str, max_results: int = 10) -> List[ExtensionMetadata]: Search for extensions (not yet implemented)

ExtensionMetadata

The data model containing all extension information.

@dataclass
class ExtensionMetadata:
    id: str
    name: Optional[str]
    description: Optional[str]
    version: Optional[str]
    developer: Optional[str]
    user_count: Optional[int]
    rating: Optional[float]
    # ... and many more fields

Examples

Get detailed information about an extension

from chrome_extension_info import ChromeWebStoreClient

client = ChromeWebStoreClient()

# Google Translate
extension = client.get_extension("aapbdbdomjkkjkaonfhkkikfgjllcleb")

print(f"Name: {extension.name}")
print(f"Version: {extension.version}")
print(f"Users: {extension.user_count:,}")
print(f"Rating: {extension.rating} ({extension.rating_count} reviews)")
print(f"Category: {extension.category}")
print(f"Last Updated: {extension.last_updated}")
print(f"Size: {extension.size}")

Cache behavior

# First call fetches from Chrome Web Store
extension1 = client.get_extension("extension-id")  # Network request

# Second call within cache TTL returns cached data
extension2 = client.get_extension("extension-id")  # From cache, no network request

Error handling

from chrome_extension_info import ChromeWebStoreClient, ExtensionNotFoundError, ChromeExtensionInfoError

client = ChromeWebStoreClient()

try:
    extension = client.get_extension("invalid-extension-id")
except ExtensionNotFoundError:
    print("Extension not found in Chrome Web Store")
except ChromeExtensionInfoError as e:
    print(f"An error occurred: {e}")

Exceptions

  • ChromeExtensionInfoError: Base exception for all ChromePy errors
  • ExtensionNotFoundError: Extension not found in the Chrome Web Store
  • NetworkError: Network request failed
  • RateLimitError: Rate limiting exceeded
  • ParseError: Failed to parse response data

Development

Setup

git clone https://github.com/karansbir/chromepy.git
cd chromepy
pip install -e ".[dev]"

Running Tests

pytest

Code Formatting

black chromepy tests

Type Checking

mypy chromepy

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chrome_extension_info-0.2.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chrome_extension_info-0.2.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file chrome_extension_info-0.2.0.tar.gz.

File metadata

  • Download URL: chrome_extension_info-0.2.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for chrome_extension_info-0.2.0.tar.gz
Algorithm Hash digest
SHA256 3c3a56cf85be85be3039cb49dbfe58ae6aeb2af5158cf455908e58c8f994576f
MD5 28a8e4222c74c115cf9a9133b63facdc
BLAKE2b-256 88a2b9d7c4e702a01494f7cfc4a8017755f87a778de330d05f7292e29819c24a

See more details on using hashes here.

File details

Details for the file chrome_extension_info-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chrome_extension_info-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ab46b0322b1cf2cf3956b2b2cd56404c8c1ee43f753917ef6f280077aba2f32
MD5 951a29cf6b405dff2a705569659cae68
BLAKE2b-256 70e8123b3b6cbdbef881e23bb11cb7c5f1656165b10bef7e661181908c095d37

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page