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"]
})
# Load the top 1,000,000 domains list
top_domains_path = "cloudflare-radar_top-1000000-domains.csv"
# Perform the lookup
df = df.with_columns(
is_common_domain(df["domains"]).alias("is_top_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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file polars_domain_lookup-0.2.0.tar.gz.
File metadata
- Download URL: polars_domain_lookup-0.2.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
64f2b513a4cbcf63cae2b03531ad6c8f4a7de319fcc0fed095779298ddbe9b4b
|
|
| MD5 |
3eda1a0ab62979d2efeb459072befb5f
|
|
| BLAKE2b-256 |
f1b5c28d083ea02f1acf5c2b4d36f7d0409cc094a1fcf0677b1c09280cf40b06
|
File details
Details for the file polars_domain_lookup-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: polars_domain_lookup-0.2.0-cp38-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 3.4 MB
- Tags: CPython 3.8+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d2f80f76d7d8c0bd73bc294de3da3ab746ed5ca8faef1c579f756446df78d4d
|
|
| MD5 |
8c6741659e12829c40b4d6d37ba926d6
|
|
| BLAKE2b-256 |
c9908a0a9d908068c0c7243971dc2af89f8f82781a9aa8b8710acd6ed51a4683
|