Skip to main content

langchain-adapterspot

LangChain tools for the Power Adapter Label Reader API by AdapterSpot.

  • AdapterSpotLabelReader: send a photo of a power adapter label (or the rating plate on a device) and get the output voltage, current, wattage, connector type and polarity back as JSON, plus the requirements a replacement power supply must meet.
  • AdapterSpotPowerSupplyFinder: give the ratings (at least two of volts, amps and watts, optionally connector and polarity) and get the same requirements: exact voltage, minimum current and power, plug, polarity and plain-English rules.

Full guide: https://adapterspot.com/en/api/langchain/

Install

pip install langchain-adapterspot

API key

Get a free key at https://adapterspot.com/en/api/ (10 label reads per month; requirement lookups are free), then:

export ADAPTERSPOT_API_KEY="as_live_..."

You can also pass api_key="..." to each tool.

Use the tools directly

from langchain_adapterspot import AdapterSpotLabelReader, AdapterSpotPowerSupplyFinder

reader = AdapterSpotLabelReader()
print(reader.invoke({"image": "adapter-label.jpg"}))  # local path, http(s) URL or data URL

finder = AdapterSpotPowerSupplyFinder()
print(finder.invoke({"voltage": 12, "current": 5, "connector": "5.5x2.1"}))

Both tools return a JSON string. Errors (missing key, quota used up, unreadable photo) come back as a readable message instead of an exception, so an agent can react to them.

Use them in an agent

from langchain.agents import create_agent
from langchain_adapterspot import AdapterSpotLabelReader, AdapterSpotPowerSupplyFinder

agent = create_agent(
    model="anthropic:claude-sonnet-5-5",
    tools=[AdapterSpotLabelReader(), AdapterSpotPowerSupplyFinder()],
)
result = agent.invoke(
    {"messages": [{"role": "user", "content": "Which power supply do I need? The label photo is ./nas-adapter.jpg"}]}
)
print(result["messages"][-1].content)

Output (label reader)

{
  "readable": true,
  "confidence": "high",
  "output": {"voltage_v": 12, "current_a": 5, "power_w": 60, "computed_field": null, "polarity": "center_positive"},
  "connector": {"id": null, "name": null, "printed": null, "seen_in_photo": "not_visible"},
  "requirements": {
    "voltage_v": 12, "min_current_a": 5, "min_power_w": 60,
    "connector": null, "polarity": "center_positive", "complete": false,
    "rules": [
      "Use exactly 12 V DC. A different voltage can damage the device.",
      "Current rating at least 5 A (60 W). A higher rating is safe: the device only draws what it needs.",
      "Plug size unknown: measure the plug or the socket on the device (common sizes: 5.5 × 2.1 mm, 5.5 × 2.5 mm, 3.5 × 1.35 mm).",
      "Polarity: center positive (+ on the inner pin)."
    ]
  },
  "usage": {"month": "2026-11", "label_reads_used": 1, "label_reads_quota": 10, "label_reads_left": 9}
}

See the API docs for every field.

Development

pip install -e ".[test]"
pytest

License

MIT. Maintained by AdapterSpot (Clear Solutions BV, Essen, Belgium). Support: info@adapterspot.com

Metadata

Release files for langchain-adapterspot 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-adapterspot 0.2.0
File Size Uploaded Provenance Actions
langchain_adapterspot-0.2.0.tar.gz 7.2 kB With provenance Details for langchain_adapterspot-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for langchain-adapterspot 0.2.0
File Interpreter ABI Platform Actions
langchain_adapterspot-0.2.0-py3-none-any.whl Python 3 none any Details for langchain_adapterspot-0.2.0-py3-none-any.whl

Total release size: 13.9 kB

Release files / langchain_adapterspot-0.2.0.tar.gz

Download URL langchain_adapterspot-0.2.0.tar.gz
Size 7.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1a564670bf02f247317f38b39897fd046403172c2315852761806f3a0ceea9df
BLAKE2b-256 checksum
How to use checksums
3dcfd27c879628d7e2cf98179d8ae366cd07fa4586a64af647e853202b9ee32c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / langchain_adapterspot-0.2.0-py3-none-any.whl

Download URL langchain_adapterspot-0.2.0-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e116546ff09ddb6ad1ca20790c8a0bd51b926f14edc4ebd2821391872221a58
BLAKE2b-256 checksum
How to use checksums
ecc7f10cb6d630fd9c5eafcf62a432fee6dc938e79932ea24952f957616497a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for langchain-adapterspot 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for langchain_adapterspot-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page