Python Wrapper for AnySolver
Unofficial API wrapper for the AnySolver service.
Requirements
- Python 3.12
Installation
pip install anysolver-api
or
uv add anysolver-api
Usage
from anysolver_api import AnySolver
solver = AnySolver("API_KEY")
balance = solver.getBalance()
print(f"Balance: ${balance}")
result = solver.solve(
{
"type": "TaskType",
"websiteKey": "KEY",
"websiteURL": "https://someurl.com/"
}
)['token']
For extra fields, use the documentation for the specific task on the AnySolver API.
You can also provide extra settings, e.g. for routing through specific models / auto route settings:
result = solver.solve(
task = {
"type": "TaskType",
"websiteKey": "KEY",
"websiteURL": "https://someurl.com/"
},
settings = {
"routing": { "mode": "autoCheapest" }
},
timeout = 120, # how long to wait for solution
delay = 5 # time between checks
)['token']
Error handling
All API errors raise one of the following:
from anysolver_api.exceptions import AnySolverExternalError, AnySolverInternalError, AnySolverTimeoutError
try:
result = solver.solve({...})
except AnySolverExternalError as e:
# invalid input, bad task, etc.
...
except AnySolverInternalError as e:
# error on AnySolver's side
...
except AnySolverTimeoutError as e:
# task didn't finish in time
...
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 anysolver_api-0.1.3.tar.gz.
File metadata
- Download URL: anysolver_api-0.1.3.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ecf34f3721bdf54299ae35e6bcba7e150248f6a1fbac40317c901279f5b12fa
|
|
| MD5 |
a3c1ed75e73efde10835d988e34dc815
|
|
| BLAKE2b-256 |
72482f5099211b587354724f45c6cbbcf8ceeb2d16c93bd60728a720ec13838a
|
Provenance
The following attestation bundles were made for anysolver_api-0.1.3.tar.gz:
Publisher:
release.yml on flafkus/anysolver-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anysolver_api-0.1.3.tar.gz -
Subject digest:
7ecf34f3721bdf54299ae35e6bcba7e150248f6a1fbac40317c901279f5b12fa - Sigstore transparency entry: 2724421441
- Sigstore integration time:
-
Permalink:
flafkus/anysolver-api@3976751f3156986efd886d127e7230e850225fbe -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/flafkus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3976751f3156986efd886d127e7230e850225fbe -
Trigger Event:
release
-
Statement type:
File details
Details for the file anysolver_api-0.1.3-py3-none-any.whl.
File metadata
- Download URL: anysolver_api-0.1.3-py3-none-any.whl
- Upload date:
- Size: 2.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f15c55a30664674bb4e63424e220877400f85293c3e7d2e444eeb0d0262667b
|
|
| MD5 |
8f954c0b4fe79fdb528b8300785516e1
|
|
| BLAKE2b-256 |
0bf552296206b35d4d943fa09b4397d8ed49677d15541843ae1aa873f77bf820
|
Provenance
The following attestation bundles were made for anysolver_api-0.1.3-py3-none-any.whl:
Publisher:
release.yml on flafkus/anysolver-api
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
anysolver_api-0.1.3-py3-none-any.whl -
Subject digest:
6f15c55a30664674bb4e63424e220877400f85293c3e7d2e444eeb0d0262667b - Sigstore transparency entry: 2724421491
- Sigstore integration time:
-
Permalink:
flafkus/anysolver-api@3976751f3156986efd886d127e7230e850225fbe -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/flafkus
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3976751f3156986efd886d127e7230e850225fbe -
Trigger Event:
release
-
Statement type: