Skip to content

Add documentation for using tempolocus as a Python library#22

Merged
adulau merged 1 commit into
mainfrom
codex/add-documentation-for-tempolocus-library
Jul 10, 2026
Merged

Add documentation for using tempolocus as a Python library#22
adulau merged 1 commit into
mainfrom
codex/add-documentation-for-tempolocus-library

Conversation

@adulau

@adulau adulau commented Jul 10, 2026

Copy link
Copy Markdown
Member

Motivation

  • Provide concise guidance for developers who want to import and use tempolocus programmatically instead of via the CLI.

Description

  • Add a new README section Using tempolocus as a Python library with install instructions and editable-install guidance in README.md.
  • Document the public entry points detect, analyze_activity, and load_json, including parameter descriptions for detect and example usage for weekly, timestamps, and yearly inputs.
  • Add an input shape reference table and an example showing how to catch tempolocus.core.DetectionError for invalid inputs.

Testing

  • Ran the test suite with python -m pytest, which executed 31 tests and all tests passed.

Codex Task

@adulau
adulau merged commit a7d4ebe into main Jul 10, 2026
8 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbb316c4f4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md
from tempolocus import analyze_activity, load_json

activity = analyze_activity(load_json("samples/year.json"), kind="yearly")
print(activity["activity_type"], activity["score"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the actual activity confidence field

In the inspected README library example, this raises KeyError for any valid input because analyze_activity() returns activity_type, confidence, basis, and shares from tempolocus/core.py, not score. Users copying this documented snippet will fail when they try to read the activity summary; update the example and field description to use activity["confidence"] or add a real score alias in the API.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant