Metadata-Version: 2.4
Name: dealport
Version: 0.1.9
Summary: Official Dealport Python SDK, CLI, and AI agent tool adapters: the SMB knowledge layer for agents and humans.
Author-email: Dealport <support@dealport.com>
License-Expression: MIT
Project-URL: Homepage, https://dealport.com
Project-URL: Documentation, https://dealport.com/docs
Project-URL: Platform, https://app.dealport.com
Project-URL: AI Bootstrap, https://app.dealport.com/llms.txt
Project-URL: Repository, https://github.com/Dealport-HQ/dealport
Project-URL: Issues, https://github.com/Dealport-HQ/dealport/issues
Keywords: dealport,smb,private-companies,commercial-real-estate,origination,mcp,ai-agents,sdk,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Dealport Python SDK, CLI & Agent Tool Adapters

Zero-dependency official Python package (`Python >= 3.10`, standard library `urllib.request`, MIT license) for **Dealport**: the SMB knowledge layer for agents and humans across **28M+ US private companies**, **160M+ US property parcels**, the commercial buildings they own, and the human principals behind them, with primary public-filing citations.

Every account starts with a **$5.00 free USD balance** and pays as you go in plain USD. Create scoped API keys under **Connect your AI -> API keys** at [app.dealport.com/connect?tab=keys](https://app.dealport.com/connect?tab=keys).

## Install

```bash
pip install dealport

# Or run the CLI directly with uvx without installing globally:
uvx dealport preview --state OH --naics 238220 --independent --json
```

## Quickstart (`Dealport` Client)

`Dealport()` automatically reads `DP_API_KEY` or `~/.config/dealport/credentials.json` (`0600` permissions, shared with `dealport login` and `npx dealport login`).

```python
from dealport import Dealport, DealportError

dp = Dealport()

# 1. Size a US buy-box for free ($0.00)
preview = dp.preview_companies(
    state="OH",
    naics=["238220"],
    min_employees=15,
    independent=True,
    exclude_franchises=True,
    founded_before=2006,
    signals=["hiring_signal", "news_signal", "exec_hire"],
    signal_days=90,
)
print(f"Matching companies: {preview['matching_count']}")

# 2. Search companies & open a cited Record with $0.00 physical site screening ($0.01/record, $0.00 repeat within 30 days)
companies = dp.search_companies(state="OH", naics=["238220"], independent=True, exclude_franchises=True, limit=5)["data"]
record = dp.get_record(companies[0]["id"], include_site=True)["data"]

# 3. Save 0-100 scores & rationales into a Dealport Project ($0.00)
dp.annotate_companies(
    project_name="Ohio Commercial HVAC",
    items=[
        {
            "company_id": record["id"],
            "score": 92,
            "verdict": "priority",
            "rationale": "Active state trade license, 25+ employees, independent owner-operator",
        }
    ],
)

# 4. Resolve verified human owner phone & email ($0.09 hit / $0.00 miss)
try:
    owner = dp.find_owner(record["id"])
    print(owner.get("person"), owner.get("phone"), owner.get("email"))
except DealportError as err:
    if err.is_insufficient_balance:
        print("Top up balance at https://app.dealport.com:", err)

# 5. 50-state US parcel lookup ($0.03/parcel) & LLC unmasking ($0.09 verified hit / $0.00 miss)
parcel = dp.lookup_property("412 Atlantic Avenue, Brooklyn, NY", include_permits=True)
unmasked = dp.resolve_llc_owner("Atlantic Holdings LLC", state="NY")
```

## 2-Line Agent Tool Binding (`dealport.tools`)

Bind all 47 Dealport MCP tools directly into Python agent frameworks without external wrapper packages:

```python
from dealport import Dealport
from dealport.tools import anthropic_tools, as_callables, dispatch_tool_call, openai_tools

dp = Dealport()

# OpenAI Chat Completions / Responses SDK:
oa_tools = openai_tools()
# result = dispatch_tool_call(dp, tool_call.function.name, tool_call.function.arguments)

# Anthropic Messages SDK:
claude_tools = anthropic_tools()
# result = dispatch_tool_call(dp, tool_use.name, tool_use.input)

# OpenAI Agents SDK, Agno, CrewAI, AutoGen, DSPy, LlamaIndex, or LangChain StructuredTool.from_function:
functions = as_callables(dp)
```

Pass `include_avery_mutations=True` to include `avery_reach_out` and `avery_accept_intro` in agent tool lists, or `include_paid=False` to restrict an agent strictly to `$0.00` read/sizing/matching/annotation tools.

## CLI (`dealport` / `uvx dealport`)

```bash
dealport login --key dp_live_...
printf '%s\n' "$DP_API_KEY" | dealport connect --all --api-key-stdin
dealport doctor --proof
dealport balance
dealport companies --state OH --query "commercial HVAC" --exclude-franchises --founded-before 2006 --preview --json
dealport search --state OH --naics 238220 --signals hiring_signal,news_signal --signal-days 90 --limit 5 --json
dealport property "412 Atlantic Avenue, Brooklyn, NY" --permits
dealport llc "Atlantic Holdings LLC" --state NY
dealport records --type hiring_signal --state OH --preview
dealport record <company_id> --include-site --evidence
dealport playbooks list
dealport projects create --name "Ohio HVAC Mandate" --state OH --naics 238220 --independent
dealport projects run <project_id> --count 20
dealport owner <company_id>
```

## Links

- **Homepage:** [dealport.com](https://dealport.com)
- **Documentation:** [dealport.com/docs](https://dealport.com/docs)
- **Platform & API Keys:** [app.dealport.com/connect?tab=keys](https://app.dealport.com/connect?tab=keys)
- **AI Bootstrap (`llms.txt`):** [app.dealport.com/llms.txt](https://app.dealport.com/llms.txt)
- **GitHub:** [github.com/Dealport-HQ/dealport](https://github.com/Dealport-HQ/dealport)

## License

MIT
