Landline Scrubber core library - phone verification and DNC checking
Project description
ai-lls-lib
Core Python library for Landline Scrubber - phone verification and DNC (Do Not Call) checking.
Documentation & Reports
| Resource | Description |
|---|---|
| API Documentation | pdoc-generated API reference |
| Test Coverage | HTML coverage report |
| Test Results | Unit test results |
| Security Scans | Bandit, Safety, pip-audit results |
| License Compliance | Dependency license report |
| PyPI Package | Published package |
Features
- Phone number normalization (E.164 format)
- Line type detection (mobile/landline/VoIP)
- DNC list checking via landlineremover.com API
- DynamoDB caching with 30-day TTL
- Bulk CSV processing with streaming support
- Stripe payment integration
- CLI for admin operations
Installation
pip install ai-lls-lib
For development:
git clone https://github.com/augmenting-integrations/ai-lls-lib.git
cd ai-lls-lib
uv sync --all-extras
Quick Start
Single Phone Verification
from ai_lls_lib import PhoneVerifier, DynamoDBCache
cache = DynamoDBCache(table_name="phone-cache")
verifier = PhoneVerifier(cache)
result = verifier.verify("+15551234567")
print(f"Line type: {result.line_type}") # mobile, landline, voip, unknown
print(f"DNC: {result.dnc}") # True/False
print(f"Cached: {result.cached}") # True/False
Bulk Processing
from ai_lls_lib import BulkProcessor, PhoneVerifier, DynamoDBCache
cache = DynamoDBCache(table_name="phone-cache")
verifier = PhoneVerifier(cache)
processor = BulkProcessor(verifier)
csv_text = "name,phone\nJohn,+15551234567\nJane,+15551234568"
results = processor.process_csv(csv_text)
# Generate results CSV with added columns
results_csv = processor.generate_results_csv(csv_text, results)
Streaming Large Files
from ai_lls_lib import BulkProcessor, PhoneVerifier, DynamoDBCache
cache = DynamoDBCache(table_name="phone-cache")
verifier = PhoneVerifier(cache)
processor = BulkProcessor(verifier)
csv_lines = open('large_file.csv').readlines()
for batch in processor.process_csv_stream(csv_lines, batch_size=100):
print(f"Processed batch of {len(batch)} phones")
Custom Verification Providers
from ai_lls_lib import PhoneVerifier, DynamoDBCache
from ai_lls_lib.providers import StubProvider
# Use stub provider for testing (deterministic results)
cache = DynamoDBCache(table_name="phone-cache")
provider = StubProvider()
verifier = PhoneVerifier(cache, provider=provider)
Configuration
Environment Variables
| Variable | Description | Required |
|---|---|---|
LANDLINE_REMOVER_API_KEY |
API key for landlineremover.com | Yes (for production) |
AWS_REGION |
AWS region for DynamoDB | No (default: us-east-1) |
CLI
# Verify single phone
ai-lls verify phone +15551234567 --stack landline-api
# Bulk verify CSV
ai-lls verify bulk input.csv -o output.csv --stack landline-api
# Cache management
ai-lls cache stats --stack landline-api
ai-lls cache get +15551234567 --stack landline-api
# Admin commands
ai-lls admin user-credits user123 --add 100
ai-lls admin api-keys --user user123
# Test stack management
ai-lls test-stack deploy
ai-lls test-stack status
ai-lls test-stack delete
Development
# Install dev dependencies
uv sync --all-extras
# Run tests
uv run pytest
# Run linting
uv run pre-commit run --all-files
# Type checking
uv run mypy src/
# Build package
uv build
Testing
# Unit tests (mocked AWS)
uv run pytest tests/unit -v
# Integration tests (requires AWS + test stack)
TEST_STACK_NAME=ai-lls-lib-test uv run pytest tests/integration -v
# Coverage report
uv run pytest --cov=src --cov-report=html --cov-fail-under=80
Project Structure
src/ai_lls_lib/
├── __init__.py # Public exports, version
├── core/ # PhoneVerifier, BulkProcessor, DynamoDBCache
├── auth/ # JWT/API key authentication
├── payment/ # StripeManager, CreditManager
├── admin/ # AdminService
├── providers/ # External API clients
├── cli/ # Command-line interface
└── testing/ # Test fixtures
License
Proprietary - All rights reserved
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 ai_lls_lib-3.2.0.tar.gz.
File metadata
- Download URL: ai_lls_lib-3.2.0.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af75e255acefc69cc38c12f51aaab06881f90c0762cafaf7c0dc242ad5dfc5e8
|
|
| MD5 |
98a2202a423d0619f98f4878f08be720
|
|
| BLAKE2b-256 |
7a2636e9ba604ec84fd49db131b698310c644d7e09d538e7f6e0830b50a203e7
|
Provenance
The following attestation bundles were made for ai_lls_lib-3.2.0.tar.gz:
Publisher:
pipeline.yaml on Augmenting-Integrations/ai-lls-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_lls_lib-3.2.0.tar.gz -
Subject digest:
af75e255acefc69cc38c12f51aaab06881f90c0762cafaf7c0dc242ad5dfc5e8 - Sigstore transparency entry: 927178467
- Sigstore integration time:
-
Permalink:
Augmenting-Integrations/ai-lls-lib@03af4184bb4f7b57f6f2244c158de4923c9367c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Augmenting-Integrations
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yaml@03af4184bb4f7b57f6f2244c158de4923c9367c3 -
Trigger Event:
push
-
Statement type:
File details
Details for the file ai_lls_lib-3.2.0-py3-none-any.whl.
File metadata
- Download URL: ai_lls_lib-3.2.0-py3-none-any.whl
- Upload date:
- Size: 48.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c110db41438577b9eb18caf60e8ffd5299ebe263387b8d8aa56c29cdd59e94f
|
|
| MD5 |
1000e65a3ba893e284dc1bb85f7c94b8
|
|
| BLAKE2b-256 |
ab28a3e342ef9d3ee62846227f15a59501544e460eb403aa5e4a312fb9894d2e
|
Provenance
The following attestation bundles were made for ai_lls_lib-3.2.0-py3-none-any.whl:
Publisher:
pipeline.yaml on Augmenting-Integrations/ai-lls-lib
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ai_lls_lib-3.2.0-py3-none-any.whl -
Subject digest:
2c110db41438577b9eb18caf60e8ffd5299ebe263387b8d8aa56c29cdd59e94f - Sigstore transparency entry: 927178468
- Sigstore integration time:
-
Permalink:
Augmenting-Integrations/ai-lls-lib@03af4184bb4f7b57f6f2244c158de4923c9367c3 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Augmenting-Integrations
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pipeline.yaml@03af4184bb4f7b57f6f2244c158de4923c9367c3 -
Trigger Event:
push
-
Statement type: