Skip to main content

No project description provided

Project description

Polars Domain Lookup Plugin

This plugin extends the functionality of Polars by providing a method to check whether domains are included in a predefined list of the top 1,000,000 domains. The result is returned as a boolean value (True/False).

Features

  • Domain Lookup: Checks if the provided domains are included in a list of the top 1,000,000 domains.
  • Integration with Polars: Works seamlessly with Polars DataFrames, offering fast processing.

Requirements

  • Python 3.8+
  • Polars library

Install Polars with:

uv add polars
  • Top 1 Million Domains List: The domain list must be provided as a file (e.g., cloudflare-radar_top-1000000-domains.csv) in CSV format. This file can be downloaded from sources like Cloudflare Radar.

Installation

Add the plugin to your project. Install it directly from the repository or manually include the Python file.

uv add polars-domain-lookup

Usage

Example Code

import polars as pl
from polars_domain_lookup import is_common_domain

# Example DataFrame with domains
df = pl.DataFrame({
    "domains": ["example.com", "google.com", "nonexistentdomain.xyz"]
})

# Perform the lookup
df = df.with_columns(
    is_common_domain(df["domains"], top_domains_file="cloudflare-radar_top-1000000-domains.csv").alias("is_common_domain")
)

print(df)

Output

If cloudflare-radar_top-1000000-domains.csv contains google.com, the output will look like this:

shape: (3, 2)
┌───────────────────────┬───────────────┐
│ domains               │ is_top_domain │
├───────────────────────┼───────────────┤
│ example.com           │ false         │
│ google.com            │ true          │
│ nonexistentdomain.xyz │ false         │
└───────────────────────┴───────────────┘

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

polars_domain_lookup-0.2.1.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

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

polars_domain_lookup-0.2.1-cp38-abi3-manylinux_2_34_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.34+ x86-64

File details

Details for the file polars_domain_lookup-0.2.1.tar.gz.

File metadata

  • Download URL: polars_domain_lookup-0.2.1.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.7.8

File hashes

Hashes for polars_domain_lookup-0.2.1.tar.gz
Algorithm Hash digest
SHA256 d7936b96baec45761dac0e376a5d61d3fa855af0beacc35ff7daf9c030c42579
MD5 0a32d9018b2d4be5d0dfa9352054e652
BLAKE2b-256 54342b4514aaf8bd2a0ad5e05f0dbc4fdfd21eb2672038542c85285d1cdb4312

See more details on using hashes here.

File details

Details for the file polars_domain_lookup-0.2.1-cp38-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polars_domain_lookup-0.2.1-cp38-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4cdd0f16458ca663c45b4022cecedbc91fe4f5c0b07f6da75371edd01c48f1e2
MD5 e27fd9beedd27eb5da4a13907f229cf6
BLAKE2b-256 07e75395654c0a4d0a7a99193fdd891582f16f7f0a6690cda321132a129fad3b

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