diff --git a/account_manager.py b/account_manager.py index c774add..1185b5b 100644 --- a/account_manager.py +++ b/account_manager.py @@ -13,9 +13,10 @@ from datetime import UTC, datetime from pathlib import Path from typing import Any +from paths import PRY_DATA_DIR logger = logging.getLogger(__name__) -ACCOUNTS_DIR = Path(os.path.expanduser("~/.pry/accounts")) +ACCOUNTS_DIR = PRY_DATA_DIR / "accounts" ACCOUNTS_DIR.mkdir(parents=True, exist_ok=True) diff --git a/actor_marketplace.py b/actor_marketplace.py index 37f0285..8b3e4dc 100644 --- a/actor_marketplace.py +++ b/actor_marketplace.py @@ -1,6 +1,7 @@ """Pry — Actor Marketplace (Apify-style). Pre-built scrapers that can be subscribed to and run on schedule. Users can publish their own actors. We earn from usage.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -19,7 +20,7 @@ from typing import Any logger = logging.getLogger(__name__) -ACTOR_DIR = Path(os.path.expanduser("~/.pry/actors")) +ACTOR_DIR = PRY_DATA_DIR / "actors" ACTOR_DIR.mkdir(parents=True, exist_ok=True) diff --git a/agency.py b/agency.py index e62a87f..5bdc486 100644 --- a/agency.py +++ b/agency.py @@ -1,5 +1,6 @@ """Pry — White-Label Agency Dashboard. Multi-tenant reseller platform: custom branding, client management, sub-accounts.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -17,7 +18,7 @@ from typing import Any, cast logger = logging.getLogger(__name__) -AGENCY_DIR = Path(os.path.expanduser("~/.pry/agency")) +AGENCY_DIR = PRY_DATA_DIR / "agency" AGENCY_DIR.mkdir(parents=True, exist_ok=True) diff --git a/auth_connector.py b/auth_connector.py index 5e0fa73..e0f8726 100644 --- a/auth_connector.py +++ b/auth_connector.py @@ -1,5 +1,6 @@ """Pry — Enterprise SSO / Auth Connector System. Credential vault, session persistence, SSO flow automation, CAPTCHA integration.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: BSL-1.1 # Copyright (c) 2026 Rug Munch Media LLC @@ -20,7 +21,7 @@ from typing import Any, Literal, cast logger = logging.getLogger(__name__) -VAULT_DIR = Path(os.path.expanduser("~/.pry/vault")) +VAULT_DIR = PRY_DATA_DIR / "vault" VAULT_DIR.mkdir(parents=True, exist_ok=True) # ── Credential Vault (encrypted at rest) ── diff --git a/commerce_sync.py b/commerce_sync.py index 4831d24..16d7eed 100644 --- a/commerce_sync.py +++ b/commerce_sync.py @@ -1,5 +1,6 @@ """Pry — Commerce Platform Sync Engine. Unified interface for WooCommerce, Shopify, and generic API sync.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -16,7 +17,7 @@ logger = logging.getLogger(__name__) # ── Record sync operation ── -COMMERCE_DIR = Path(os.path.expanduser("~/.pry/commerce")) +COMMERCE_DIR = PRY_DATA_DIR / "commerce" COMMERCE_DIR.mkdir(parents=True, exist_ok=True) diff --git a/costing.py b/costing.py index 43d0f6f..fd0b9a5 100644 --- a/costing.py +++ b/costing.py @@ -1,5 +1,6 @@ """Pry — Cost Analytics Engine. Tracks usage costs, cache hit rates, projected burn, and smart scheduling.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -17,7 +18,7 @@ from typing import Any logger = logging.getLogger(__name__) -COSTING_DIR = Path(os.path.expanduser("~/.pry/costing")) +COSTING_DIR = PRY_DATA_DIR / "costing" COSTING_DIR.mkdir(parents=True, exist_ok=True) # Cost per operation (in USD, configurable) diff --git a/freshness.py b/freshness.py index d4c2ce7..a90601e 100644 --- a/freshness.py +++ b/freshness.py @@ -1,5 +1,6 @@ """Pry — Adaptive Freshness Scheduling. Conditional scraping, content fingerprinting, staleness dashboard, adaptive frequency.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -18,7 +19,7 @@ from typing import Any logger = logging.getLogger(__name__) -FRESHNESS_DIR = Path(os.path.expanduser("~/.pry/freshness")) +FRESHNESS_DIR = PRY_DATA_DIR / "freshness" FRESHNESS_DIR.mkdir(parents=True, exist_ok=True) diff --git a/gdpr.py b/gdpr.py index 716f133..2dc47f2 100644 --- a/gdpr.py +++ b/gdpr.py @@ -1,5 +1,6 @@ """Pry — GDPR Compliance Portal. Data deletion API, consent management, retention policies, audit log.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -19,7 +20,7 @@ from typing import Any logger = logging.getLogger(__name__) -GDPR_DIR = Path(os.path.expanduser("~/.pry/gdpr")) +GDPR_DIR = PRY_DATA_DIR / "gdpr" GDPR_DIR.mkdir(parents=True, exist_ok=True) CONSENT_DIR = GDPR_DIR / "consent" diff --git a/gdpr_real.py b/gdpr_real.py index 89af45c..cb20fc9 100644 --- a/gdpr_real.py +++ b/gdpr_real.py @@ -15,9 +15,10 @@ from datetime import UTC, datetime from pathlib import Path from typing import Any +from paths import PRY_DATA_DIR logger = logging.getLogger(__name__) -GDPR_DIR = Path(os.path.expanduser("~/.pry/gdpr_real")) +GDPR_DIR = PRY_DATA_DIR / "gdpr_real" GDPR_DIR.mkdir(parents=True, exist_ok=True) DATA_RESIDENCES = [ @@ -61,7 +62,7 @@ class GDPRService: "records": {}, "total_records": 0, } - pry_dir = Path(os.path.expanduser("~/.pry")) + pry_dir = PRY_DATA_DIR subject_lower = subject_id.lower() for subdir in DATA_RESIDENCES: subdir_path = pry_dir / subdir diff --git a/intelligence.py b/intelligence.py index 002b87d..993f03d 100644 --- a/intelligence.py +++ b/intelligence.py @@ -1,5 +1,6 @@ """Pry — Competitive Intelligence Engine. Historical snapshots, anomaly detection, natural-language alerts, weekly reports.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -18,7 +19,7 @@ from typing import Any logger = logging.getLogger(__name__) -INTEL_DIR = Path(os.path.expanduser("~/.pry/intel")) +INTEL_DIR = PRY_DATA_DIR / "intel" INTEL_DIR.mkdir(parents=True, exist_ok=True) diff --git a/llm_providers/registry.py b/llm_providers/registry.py index 8b50837..add16fb 100644 --- a/llm_providers/registry.py +++ b/llm_providers/registry.py @@ -16,9 +16,10 @@ from typing import Any from llm_providers.base import LLMProvider, LLMResponse, ReferralConfig +from paths import PRY_DATA_DIR logger = logging.getLogger(__name__) -USAGE_DIR = Path(os.path.expanduser("~/.pry/llm_usage")) +USAGE_DIR = PRY_DATA_DIR / "llm_usage" USAGE_DIR.mkdir(parents=True, exist_ok=True) diff --git a/monitor.py b/monitor.py index dc4e94e..0a41ab2 100644 --- a/monitor.py +++ b/monitor.py @@ -1,5 +1,6 @@ """Pry — scheduled monitors with AI change detection. Cron-based monitors that diff content and judge meaningful changes.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -20,7 +21,7 @@ from typing import Any logger = logging.getLogger(__name__) -MONITORS_DIR = Path(os.path.expanduser("~/.pry/monitors")) +MONITORS_DIR = PRY_DATA_DIR / "monitors" MONITORS_DIR.mkdir(parents=True, exist_ok=True) diff --git a/pipelines.py b/pipelines.py index b53d463..949c385 100644 --- a/pipelines.py +++ b/pipelines.py @@ -3,6 +3,7 @@ JSON-defined workflow engine. Users define pipelines as structured steps, the engine executes them sequentially with branching and error handling. A UI can render these steps as drag-and-drop blocks.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -20,7 +21,7 @@ from typing import Any, cast logger = logging.getLogger(__name__) -PIPELINE_DIR = Path(os.path.expanduser("~/.pry/pipelines")) +PIPELINE_DIR = PRY_DATA_DIR / "pipelines" PIPELINE_DIR.mkdir(parents=True, exist_ok=True) # ── Step Types Registry ── diff --git a/proxy_manager.py b/proxy_manager.py index f1b140a..0bf06b9 100644 --- a/proxy_manager.py +++ b/proxy_manager.py @@ -1,6 +1,7 @@ """Pry — Proxy Manager with affiliate-signup flow. Tries free proxies first (Tor, public rotating). When premium proxy is needed, prompts user to sign up via affiliate links. Pre-wired to 5+ providers.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -24,7 +25,7 @@ try: except ImportError: # proxy_referrals module not always present in slim installs _PROXY_REFERRALS = {} -PROXY_DIR = Path(os.path.expanduser("~/.pry/proxies")) +PROXY_DIR = PRY_DATA_DIR / "proxies" PROXY_DIR.mkdir(parents=True, exist_ok=True) # Free proxy sources (no signup required) diff --git a/quality.py b/quality.py index 1c10a31..06bec34 100644 --- a/quality.py +++ b/quality.py @@ -1,5 +1,6 @@ """Pry — Data Quality SLA Dashboard. Per-extraction quality metrics, anomaly detection, freshness tracking.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -20,7 +21,7 @@ from typing import Any logger = logging.getLogger(__name__) -QUALITY_DIR = Path(os.path.expanduser("~/.pry/quality")) +QUALITY_DIR = PRY_DATA_DIR / "quality" QUALITY_DIR.mkdir(parents=True, exist_ok=True) # ── Quality Metrics ── diff --git a/referrals.py b/referrals.py index 0fc61b8..fce2e37 100644 --- a/referrals.py +++ b/referrals.py @@ -1,6 +1,7 @@ """Pry — Referral / Affiliate revenue system. Tracks clicks, conversions, and revenue across 60+ providers. Supports x402 (HTTP 402) pay-per-scrape protocol for monetization.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -18,7 +19,7 @@ from typing import Any logger = logging.getLogger(__name__) -REFERRAL_DIR = Path(os.path.expanduser("~/.pry/referrals")) +REFERRAL_DIR = PRY_DATA_DIR / "referrals" REFERRAL_DIR.mkdir(parents=True, exist_ok=True) # Provider catalog with referral program details diff --git a/reports.py b/reports.py index ab5c97a..b3d209e 100644 --- a/reports.py +++ b/reports.py @@ -1,5 +1,6 @@ """Pry — Automated White-Label Report Generator. Generate branded PDF/HTML reports from scraped data for client delivery.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -16,7 +17,7 @@ from typing import Any logger = logging.getLogger(__name__) -REPORTS_DIR = Path(os.path.expanduser("~/.pry/reports")) +REPORTS_DIR = PRY_DATA_DIR / "reports" REPORTS_DIR.mkdir(parents=True, exist_ok=True) diff --git a/reports_real.py b/reports_real.py index 6188117..da6ad69 100644 --- a/reports_real.py +++ b/reports_real.py @@ -12,9 +12,10 @@ from html.parser import HTMLParser from pathlib import Path from typing import Any +from paths import PRY_DATA_DIR logger = logging.getLogger(__name__) -REPORTS_DIR = Path(os.path.expanduser("~/.pry/reports_real")) +REPORTS_DIR = PRY_DATA_DIR / "reports_real" REPORTS_DIR.mkdir(parents=True, exist_ok=True) try: diff --git a/review.py b/review.py index d308bda..f67c50b 100644 --- a/review.py +++ b/review.py @@ -1,5 +1,6 @@ """Pry — Human-in-the-Loop Validation Workflow. Routes low-confidence extractions to human review before delivery.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -17,7 +18,7 @@ from typing import Any, cast logger = logging.getLogger(__name__) -REVIEW_DIR = Path(os.path.expanduser("~/.pry/reviews")) +REVIEW_DIR = PRY_DATA_DIR / "reviews" REVIEW_DIR.mkdir(parents=True, exist_ok=True) # Status enum for review items diff --git a/seo_monitor.py b/seo_monitor.py index d920cf8..e65053b 100644 --- a/seo_monitor.py +++ b/seo_monitor.py @@ -1,5 +1,6 @@ """Pry — SEO Content Change Monitor. Track competitor meta tags, titles, descriptions, headings, content changes.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -19,7 +20,7 @@ from typing import Any logger = logging.getLogger(__name__) -SEO_DIR = Path(os.path.expanduser("~/.pry/seo")) +SEO_DIR = PRY_DATA_DIR / "seo" SEO_DIR.mkdir(parents=True, exist_ok=True) diff --git a/sessions.py b/sessions.py index 9927177..4a6e076 100644 --- a/sessions.py +++ b/sessions.py @@ -1,5 +1,6 @@ """Pry — persistent browser session management. Saves and restores Playwright browser contexts to disk.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -17,7 +18,7 @@ from typing import Any, cast logger = logging.getLogger(__name__) -SESSIONS_DIR = Path(os.path.expanduser("~/.pry/sessions")) +SESSIONS_DIR = PRY_DATA_DIR / "sessions" SESSIONS_DIR.mkdir(parents=True, exist_ok=True) diff --git a/structure_monitor.py b/structure_monitor.py index a7ddd8d..80c6847 100644 --- a/structure_monitor.py +++ b/structure_monitor.py @@ -1,5 +1,6 @@ """Pry — Page Structure Monitor. Track CSS selector validity over time. Alert before scrapers break.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -22,7 +23,7 @@ from client import get_client logger = logging.getLogger(__name__) -STRUCTURE_DIR = Path(os.path.expanduser("~/.pry/structure")) +STRUCTURE_DIR = PRY_DATA_DIR / "structure" STRUCTURE_DIR.mkdir(parents=True, exist_ok=True) diff --git a/tasks.py b/tasks.py index e6660ea..b7966fb 100644 --- a/tasks.py +++ b/tasks.py @@ -1,5 +1,6 @@ """Pry — Background job system using asyncio (built-in) or Celery if available. Long-running jobs like crawls, monitors, and bulk imports should not block request threads.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -27,7 +28,7 @@ try: except ImportError: _has_celery = False -JOBS_DIR = Path(os.path.expanduser("~/.pry/jobs")) +JOBS_DIR = PRY_DATA_DIR / "jobs" JOBS_DIR.mkdir(parents=True, exist_ok=True) diff --git a/training_data.py b/training_data.py index 930ba09..658ede4 100644 --- a/training_data.py +++ b/training_data.py @@ -1,5 +1,6 @@ """Pry — AI Training Data Pipeline. Per-record provenance, license classifier, clean room export, compliance reports.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -21,7 +22,7 @@ from typing import Any, Literal logger = logging.getLogger(__name__) -TRAINING_DIR = Path(os.path.expanduser("~/.pry/training")) +TRAINING_DIR = PRY_DATA_DIR / "training" TRAINING_DIR.mkdir(parents=True, exist_ok=True) # ── License Classification ── diff --git a/webhook_delivery.py b/webhook_delivery.py index 4d27897..3f24e18 100644 --- a/webhook_delivery.py +++ b/webhook_delivery.py @@ -1,5 +1,6 @@ """Pry — Webhook Delivery Service. Reliable webhook delivery with retries, signing (HMAC), and dead letter queue.""" +from paths import PRY_DATA_DIR # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC @@ -20,7 +21,7 @@ from typing import Any logger = logging.getLogger(__name__) -WEBHOOK_DIR = Path(os.path.expanduser("~/.pry/webhooks")) +WEBHOOK_DIR = PRY_DATA_DIR / "webhooks" WEBHOOK_DIR.mkdir(parents=True, exist_ok=True) diff --git a/x402.py b/x402.py index 8f96e51..26127ab 100644 --- a/x402.py +++ b/x402.py @@ -12,7 +12,6 @@ Standards compliance: - Multiple facilitators: coinbase, payai, cloudflare, eip-7702 - Smart facilitator router with auto-fallback """ - # SPDX-License-Identifier: MIT # Copyright (c) 2026 Rug Munch Media LLC # @@ -20,6 +19,7 @@ Standards compliance: # Licensed under MIT. See LICENSE. from __future__ import annotations +from paths import PRY_DATA_DIR import base64 import json @@ -37,7 +37,7 @@ import httpx logger = logging.getLogger(__name__) -X402_DIR = Path(os.path.expanduser("~/.pry/x402")) +X402_DIR = PRY_DATA_DIR / "x402" X402_DIR.mkdir(parents=True, exist_ok=True) # x402 pricing per operation (USDC atomic units, 6 decimals)