langchain-asterwise
LangChain tools for the Asterwise astrology API. Five StructuredTools over the official Python SDK:
| Tool | What it returns |
|---|---|
asterwise_natal_chart |
Vedic natal chart: planets by sign, degree, nakshatra and house; ascendant; Moon sign |
asterwise_western_natal_chart |
Western natal chart: planets, ascendant, midheaven; Placidus, Koch, Equal or Whole Sign |
asterwise_matchmaking |
Ashtakoot Guna Milan out of 36 with Rajju and Vedha as separate vetoes, Mangal dosha comparison, narrative |
asterwise_panchanga |
Tithi, nakshatra, yoga, karana, vara, sunrise and sunset, Rahu kaal for a date and place |
asterwise_numerology_profile |
Life path, expression, soul urge, personality and related numbers |
Outputs are slimmed by default to the fields a model needs to reason with. Pass slim=False for the full API payload. Birthplaces are plain text; the API geocodes them.
Install
pip install langchain-asterwise
Get a free key at asterwise.com/dashboard: 500 calls a month, no card.
Use
import os
from asterwise_langchain import AsterwiseToolkit
tools = AsterwiseToolkit(api_key=os.environ["ASTERWISE_API_KEY"]).get_tools()
With any LangChain chat model that supports tool calling:
from langchain.chat_models import init_chat_model
llm = init_chat_model("claude-sonnet-5").bind_tools(tools)
msg = llm.invoke("Cast a Vedic chart for 12 Nov 1985, 06:45, Mumbai and tell me the Moon nakshatra.")
print(msg.tool_calls)
Or as a ReAct agent with LangGraph:
from langgraph.prebuilt import create_react_agent
agent = create_react_agent(init_chat_model("claude-sonnet-5"), tools)
result = agent.invoke({"messages": [("user", "Are these two compatible? Arjun 1990-05-14 07:20 Pune; Meera 1992-11-03 22:45 Jaipur.")]})
print(result["messages"][-1].content)
The toolkit's methods also work without LangChain:
kit = AsterwiseToolkit(api_key="aw_...")
kit.matchmaking("1990-05-14", "Pune, India", "1992-11-03", "Jaipur, India")
Why the matchmaking tool reports vetoes separately
Rajju and Vedha between the two Moon nakshatras are stops in the classical method, not point deductions. A 30 out of 36 with Rajju present is not a good match, so the tool returns classical_vetoes alongside total_score and the tool description tells the model so. Background: Rajju and Vedha as hard vetoes.
Accuracy
Every Asterwise position is computed with the Swiss Ephemeris and checked against NASA JPL Horizons: 80 positions from 1950 to 2050, median difference 0.046 arcseconds, raw data and script published.
Test
pip install -e ".[test]" && pytest # offline, mocks the SDK
ASTERWISE_API_KEY=aw_... python scripts/smoke.py # one live call per tool
MIT licensed.
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 langchain_asterwise-0.1.0.tar.gz.
File metadata
- Download URL: langchain_asterwise-0.1.0.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
33bd4010aa0fde7ad2801615da83bedf40def1fd09920343fe276c1fb7b69d3f
|
|
| MD5 |
9dd4f6f3fb639641cc1b072a9f51a973
|
|
| BLAKE2b-256 |
2bf87f62b7961fe711cb9f2dd801dc3d814c0567128f776c925383599a733ecf
|
File details
Details for the file langchain_asterwise-0.1.0-py3-none-any.whl.
File metadata
- Download URL: langchain_asterwise-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61737005195fbc592447eb4998af0080ea70c1f21c4d4df23681cdc50c0ec751
|
|
| MD5 |
44634c12bc1c38669158ce52d1db4b17
|
|
| BLAKE2b-256 |
ab52fd9aa9feb7ac95009d32927cb2cb3146de36f569f4cb337617059f12dff5
|