Skip to main content

AI-powered object query proxy using Claude AI

Project description

talkabout

PyPI version

(inspired by https://github.com/awwaiid/gremllm)

Ask anything about any Python object using natural language and get Python code executed automatically. Passes the object's repr() and your query to Claude API. For now, Claude responds to the system query with single-line code statements only

Installation

pip install talkabout

Setup

You'll need an Anthropic API key. Set it as an environment variable:

export ANTHROPIC_API_KEY="your-api-key-here"

Or pass it directly when creating a Talk instance:

from talkabout import Talk
talk = Talk(my_object, api_key="your-api-key-here")

Usage

A simple example:

import numpy as np
from talkabout import Talk

x = np.random.uniform(size=50)

talk = Talk(x)
talk('90th percentile')

# printed output
Executing code: np.percentile(obj, 90)

Out[1]: np.float64(0.8442100946036629)

You can also use the .chat() method to just ask a question and get a textual response:

import torch
from talkabout import Talk

optimizer = torch.optim.Adam([torch.Tensor([0.0])], lr=0.001)
talk = Talk(optimizer)
talk.chat('is this the best optimiser ever?')

# printed output
Out[6]: 'Let me help you evaluate the Adam optimizer:\n\nAdam is generally considered ...'

A more complicated example - inspect financials of a company using Yahoo Finance API (this use-case actually motivated this package, because those yfinance dataframes are messy):

import yfinance as yf
from talkabout import Talk

pypl = yf.Ticker('PYPL')

talk = Talk(pypl)
talk('qoq Oper CF over debt; use .loc')

# printed output
Executing code: pypl.quarterly_cash_flow.loc['Operating Cash Flow'].pct_change() / pypl.quarterly_balancesheet.loc['Total Debt']

Out[6]:
2025-03-31             NaN
2024-12-31    1.076823e-10
2024-09-30   -3.265984e-11
2024-06-30   -5.669014e-12
2024-03-31    2.654644e-11
2023-12-31             NaN
dtype: float64

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

talkabout-0.1.3.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

talkabout-0.1.3-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file talkabout-0.1.3.tar.gz.

File metadata

  • Download URL: talkabout-0.1.3.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for talkabout-0.1.3.tar.gz
Algorithm Hash digest
SHA256 5cf8691f552c643100fb3c7afe02206679af1712166ac4c5a11233d08cfb6aae
MD5 a1210258e130f176647198f8ba45771a
BLAKE2b-256 bfcb9bf92e39238cbb04e4dad81786558ffd8559ba1ae77a9bfafee84a171d0a

See more details on using hashes here.

File details

Details for the file talkabout-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: talkabout-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for talkabout-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9b3b4f0411f9216e6b805e5f2e481f46295fe66e1bfea3f1f576e65be7ddbef4
MD5 68586dd824f3a45fe31da3c29b46566f
BLAKE2b-256 660419c25efbf21ab1527f91920ce8c5f8ca182b1d554cd419ae91ded42f8f0d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page