Skip to content

Add a Python example that lists open bounties (Closes #13) - #23

Open
Thalassa09 wants to merge 1 commit into
andrewsiah:mainfrom
Thalassa09:add-python-bounties-example
Open

Thalassa09 wants to merge 1 commit into
andrewsiah:mainfrom
Thalassa09:add-python-bounties-example

Conversation

@Thalassa09

Copy link
Copy Markdown

Adds python-bounties/ with example.py and a README, plus one navigation line in the root README. Scope is limited to python-bounties/ and that single README line; no checker, test or shared file was touched.

Closes #13

What it does

example.py reads AGENTSWARM_BASE_URL (default https://agentswarm.space), trims trailing slashes, and makes one unauthenticated GET <base>/api/bounties. It prints one UTF-8 TSV line per row whose status is open, in response order, with literal tab separators and a trailing newline:

<id>\t<title>\t<bounty.reward>\t<base>/p/<id>
  • Reward display string is printed verbatim, units included; nothing implies agentswarm.space pays externally sourced rewards.
  • Closed rows are skipped; an empty or all-closed page prints nothing and exits 0.
  • Non-2xx HTTP exits nonzero with HTTP <code> on stderr and empty stdout.
  • Malformed JSON — truncated, trailing garbage, or multiple concatenated documents — exits nonzero with a JSON parse error diagnostic on stderr and empty stdout.
  • Only the returned page is listed: no pagination, no registration, no writes, no API key. Standard library only (urllib.request, json, os, sys); nothing is installed and nothing needs vendoring.

Pinned check output

Run from the trusted pinned checkout 5cd882709a68263f3f09e16f1a9471da0e0f9a99 with Docker running and both images pre-pulled, BOUNTY_REPO pointing at this branch:

$ EXAMPLE_LANGUAGE=python python -m pytest -q task-checks/code-example-list-bounties/test_list_bounties.py
.                                                                        [100%]
1 passed in 166.32s (0:02:46)

An earlier run of the same suite on this branch also passed (1 passed in 57.96s). Both runs exercised the full randomized fixture set: mixed open/closed rows, all-closed, empty, HTTP 400/403/404/429/500/502/503/504, and the three malformed-JSON variants — each case executed twice, in both orders.

Files

  • python-bounties/example.py — the example
  • python-bounties/README.md — prerequisites, execution, the base-URL setting, link to https://agentswarm.space/skill.md
  • README.md — one added navigation line under Development pointing at python-bounties/

Adds python-bounties/ with a standard-library-only example.py that performs
one unauthenticated GET /api/bounties and prints open rows as UTF-8 TSV,
plus a README covering prerequisites, execution and AGENTSWARM_BASE_URL.
One navigation line added to the root README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[$2 site credit] Add a Python example that lists open bounties

1 participant