# Riddles Solver
๐งฉ A Python library for solving riddles using repixify.com API
[](https://badge.fury.io/py/riddles-solver)
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
## โจ Features
- ๐ **Synchronous and asynchronous API**
- ๐ **Automatic key extraction**
- ๐ญ **Random User-Agent support**
- ๐ **Easy to use**
## ๐ฆ Installation
```bash
pip install riddles-solver
# Install all dependencies
playwright install
```
### Optional dependencies
```bash
# For asynchronous client
pip install riddles-solver[async]
# For User-Agent generation
pip install riddles-solver[user-agent]
# For development
pip install riddles-solver[dev]
```
## ๐ Quick Start
### 1. Getting a key
```python
import riddles_solver
# Automatic key extraction
key = riddles_solver.get_key()
print(f"Your key: {key}")
```
### 2. Solving riddles (synchronous)
```python
import riddles_solver
# Create client
client = riddles_solver.Client(key="a1b2c3d4e5f6789012345678901234567890abcdef")
# Solve riddles
answer = client.solve("2+2")
print(answer) # 4
answer = client.solve("What has keys but no locks?")
print(answer) # Piano
```
### 3. Asynchronous riddle solving
```python
import asyncio
import riddles_solver
async def main():
# Create asynchronous client
async with riddles_solver.AsyncClient(key="a1b2c3d4e5f6789012345678901234567890abcdef") as client:
# Solve one riddle
answer = await client.solve("2+2")
print(answer)
# Solve multiple riddles in parallel
riddles = ["2+2", "2+2*2", "What is the capital of France?"]
answers = await client.solve_batch(riddles)
for riddle, answer in zip(riddles, answers):
print(f"{riddle} = {answer}")
asyncio.run(main())
```
## ๐ Documentation
### Synchronous client
```python
# Basic usage
client = riddles_solver.Client(key="your_key")
# With custom User-Agent
client = riddles_solver.Client(
key="your_key",
user_agent="Custom User Agent"
)
# Solve riddle
answer = client.solve("your riddle")
```
### Asynchronous client
```python
# Create client
async_client = riddles_solver.AsyncClient(key="your_key")
# Solve one riddle
answer = await async_client.solve("riddle")
# Batch solving
riddles = ["riddle1", "riddle2", "riddle3"]
answers = await async_client.solve_batch(riddles)
# Don't forget to close the session
await async_client.close()
# Or use context manager
async with riddles_solver.AsyncClient(key="your_key") as client:
answer = await client.solve("riddle")
```
### Getting keys
```python
# Programmatically
key = riddles_solver.get_key()
# Via CLI
# riddles-get-key
```
## ๐ ๏ธ CLI
After installation, a command-line utility is available:
```bash
# Get a new key
riddles-get-key
# Or
python -m riddles_solver.cli
```
## ๐ Complete example
```python
import asyncio
import riddles_solver
async def demo():
print("๐ Getting key...")
key = riddles_solver.get_key()
if not key:
print("โ Failed to get key")
return
print(f"โ
Key obtained: {key}")
# Synchronous client
print("\n๐ Synchronous solving:")
sync_client = riddles_solver.Client(key=key)
answer = sync_client.solve("2+2")
print(f"2+2 = {answer}")
# Asynchronous client
print("\nโก Asynchronous solving:")
async with riddles_solver.AsyncClient(key=key) as async_client:
riddles = ["2+2*2", "What is the capital of Russia?", "10-5"]
answers = await async_client.solve_batch(riddles)
for riddle, answer in zip(riddles, answers):
print(f"{riddle} = {answer}")
if __name__ == "__main__":
asyncio.run(demo())
```
## ๐งช Testing
```bash
# Run tests
pytest
# With coverage
pytest --cov=riddles_solver
```
## ๐ค Development
```bash
# Clone repository
git clone https://github.com/Towux/riddles_solver.git
cd riddles_solver
# Install in development mode
pip install -e .[dev]
# Code formatting
black riddles_solver/
# Type checking
mypy riddles_solver/
```
## ๐ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## ๐โโ๏ธ Support
If you have questions or issues:
1. Check [Issues](https://github.com/Towux/riddles_solver/issues)
2. Create a new Issue if you don't find a solution
3. Describe the problem in as much detail as possible
Raw data
{
"_id": null,
"home_page": "https://github.com/Towux/riddles_solver",
"name": "riddles-solver",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "riddles, puzzle, solver, api, repixify, ai, artificial-intelligence, automation, nlp, text-processing",
"author": "Towux",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/c0/7f/9de5a4655656011c467e9a332f4f2f7102909627fd849fb2ccf36d5b1603/riddles_solver-1.0.0.tar.gz",
"platform": null,
"description": "# Riddles Solver\r\n\r\n\ud83e\udde9 A Python library for solving riddles using repixify.com API\r\n\r\n[](https://badge.fury.io/py/riddles-solver)\r\n[](https://www.python.org/downloads/)\r\n[](https://opensource.org/licenses/MIT)\r\n\r\n## \u2728 Features\r\n\r\n- \ud83d\udd04 **Synchronous and asynchronous API**\r\n- \ud83d\udd11 **Automatic key extraction**\r\n- \ud83c\udfad **Random User-Agent support**\r\n- \ud83d\ude80 **Easy to use**\r\n\r\n## \ud83d\udce6 Installation\r\n\r\n```bash\r\npip install riddles-solver\r\n\r\n# Install all dependencies\r\nplaywright install\r\n```\r\n\r\n### Optional dependencies\r\n\r\n```bash\r\n# For asynchronous client\r\npip install riddles-solver[async]\r\n\r\n# For User-Agent generation\r\npip install riddles-solver[user-agent]\r\n\r\n# For development\r\npip install riddles-solver[dev]\r\n```\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n### 1. Getting a key\r\n\r\n```python\r\nimport riddles_solver\r\n\r\n# Automatic key extraction\r\nkey = riddles_solver.get_key()\r\nprint(f\"Your key: {key}\")\r\n```\r\n\r\n### 2. Solving riddles (synchronous)\r\n\r\n```python\r\nimport riddles_solver\r\n\r\n# Create client\r\nclient = riddles_solver.Client(key=\"a1b2c3d4e5f6789012345678901234567890abcdef\")\r\n\r\n# Solve riddles\r\nanswer = client.solve(\"2+2\")\r\nprint(answer) # 4\r\n\r\nanswer = client.solve(\"What has keys but no locks?\")\r\nprint(answer) # Piano\r\n```\r\n\r\n### 3. Asynchronous riddle solving\r\n\r\n```python\r\nimport asyncio\r\nimport riddles_solver\r\n\r\nasync def main():\r\n # Create asynchronous client\r\n async with riddles_solver.AsyncClient(key=\"a1b2c3d4e5f6789012345678901234567890abcdef\") as client:\r\n # Solve one riddle\r\n answer = await client.solve(\"2+2\")\r\n print(answer)\r\n \r\n # Solve multiple riddles in parallel\r\n riddles = [\"2+2\", \"2+2*2\", \"What is the capital of France?\"]\r\n answers = await client.solve_batch(riddles)\r\n \r\n for riddle, answer in zip(riddles, answers):\r\n print(f\"{riddle} = {answer}\")\r\n\r\nasyncio.run(main())\r\n```\r\n\r\n## \ud83d\udcd6 Documentation\r\n\r\n### Synchronous client\r\n\r\n```python\r\n# Basic usage\r\nclient = riddles_solver.Client(key=\"your_key\")\r\n\r\n# With custom User-Agent\r\nclient = riddles_solver.Client(\r\n key=\"your_key\",\r\n user_agent=\"Custom User Agent\"\r\n)\r\n\r\n# Solve riddle\r\nanswer = client.solve(\"your riddle\")\r\n```\r\n\r\n### Asynchronous client\r\n\r\n```python\r\n# Create client\r\nasync_client = riddles_solver.AsyncClient(key=\"your_key\")\r\n\r\n# Solve one riddle\r\nanswer = await async_client.solve(\"riddle\")\r\n\r\n# Batch solving\r\nriddles = [\"riddle1\", \"riddle2\", \"riddle3\"]\r\nanswers = await async_client.solve_batch(riddles)\r\n\r\n# Don't forget to close the session\r\nawait async_client.close()\r\n\r\n# Or use context manager\r\nasync with riddles_solver.AsyncClient(key=\"your_key\") as client:\r\n answer = await client.solve(\"riddle\")\r\n```\r\n\r\n### Getting keys\r\n\r\n```python\r\n# Programmatically\r\nkey = riddles_solver.get_key()\r\n\r\n# Via CLI\r\n# riddles-get-key\r\n```\r\n\r\n## \ud83d\udee0\ufe0f CLI\r\n\r\nAfter installation, a command-line utility is available:\r\n\r\n```bash\r\n# Get a new key\r\nriddles-get-key\r\n\r\n# Or\r\npython -m riddles_solver.cli\r\n```\r\n\r\n## \ud83d\udccb Complete example\r\n\r\n```python\r\nimport asyncio\r\nimport riddles_solver\r\n\r\nasync def demo():\r\n print(\"\ud83d\udd11 Getting key...\")\r\n key = riddles_solver.get_key()\r\n \r\n if not key:\r\n print(\"\u274c Failed to get key\")\r\n return\r\n \r\n print(f\"\u2705 Key obtained: {key}\")\r\n \r\n # Synchronous client\r\n print(\"\\n\ud83d\udd04 Synchronous solving:\")\r\n sync_client = riddles_solver.Client(key=key)\r\n answer = sync_client.solve(\"2+2\")\r\n print(f\"2+2 = {answer}\")\r\n \r\n # Asynchronous client\r\n print(\"\\n\u26a1 Asynchronous solving:\")\r\n async with riddles_solver.AsyncClient(key=key) as async_client:\r\n riddles = [\"2+2*2\", \"What is the capital of Russia?\", \"10-5\"]\r\n answers = await async_client.solve_batch(riddles)\r\n \r\n for riddle, answer in zip(riddles, answers):\r\n print(f\"{riddle} = {answer}\")\r\n\r\nif __name__ == \"__main__\":\r\n asyncio.run(demo())\r\n```\r\n\r\n## \ud83e\uddea Testing\r\n\r\n```bash\r\n# Run tests\r\npytest\r\n\r\n# With coverage\r\npytest --cov=riddles_solver\r\n```\r\n\r\n## \ud83e\udd1d Development\r\n\r\n```bash\r\n# Clone repository\r\ngit clone https://github.com/Towux/riddles_solver.git\r\ncd riddles_solver\r\n\r\n# Install in development mode\r\npip install -e .[dev]\r\n\r\n# Code formatting\r\nblack riddles_solver/\r\n\r\n# Type checking\r\nmypy riddles_solver/\r\n```\r\n\r\n## \ud83d\udcc4 License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## \ud83d\ude4b\u200d\u2642\ufe0f Support\r\n\r\nIf you have questions or issues:\r\n\r\n1. Check [Issues](https://github.com/Towux/riddles_solver/issues)\r\n2. Create a new Issue if you don't find a solution\r\n3. Describe the problem in as much detail as possible\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A Python library for solving riddles using repixify.com API",
"version": "1.0.0",
"project_urls": {
"Bug Reports": "https://github.com/Towux/riddles_solver/issues",
"Homepage": "https://github.com/Towux/riddles_solver",
"Source": "https://github.com/Towux/riddles_solver"
},
"split_keywords": [
"riddles",
" puzzle",
" solver",
" api",
" repixify",
" ai",
" artificial-intelligence",
" automation",
" nlp",
" text-processing"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "e5454c9b4674b8a4cec84745d7bc44a5b88b6aa609c671f28016bca3cb0921a1",
"md5": "7f65b5e46a192d52181b473ea4d23191",
"sha256": "f8560912c7c6db3df1f1f8c2d8393517c14527203709d2e6cb472ec04aa8e463"
},
"downloads": -1,
"filename": "riddles_solver-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7f65b5e46a192d52181b473ea4d23191",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 9537,
"upload_time": "2025-08-27T06:53:03",
"upload_time_iso_8601": "2025-08-27T06:53:03.747167Z",
"url": "https://files.pythonhosted.org/packages/e5/45/4c9b4674b8a4cec84745d7bc44a5b88b6aa609c671f28016bca3cb0921a1/riddles_solver-1.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c07f9de5a4655656011c467e9a332f4f2f7102909627fd849fb2ccf36d5b1603",
"md5": "6ee43ba9fb26aff08d850622471d1548",
"sha256": "02776c383163d7405511ace90284243ac1294213fd72fce6495a9cd6785ebeac"
},
"downloads": -1,
"filename": "riddles_solver-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "6ee43ba9fb26aff08d850622471d1548",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 9878,
"upload_time": "2025-08-27T06:53:05",
"upload_time_iso_8601": "2025-08-27T06:53:05.062256Z",
"url": "https://files.pythonhosted.org/packages/c0/7f/9de5a4655656011c467e9a332f4f2f7102909627fd849fb2ccf36d5b1603/riddles_solver-1.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-08-27 06:53:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Towux",
"github_project": "riddles_solver",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "riddles-solver"
}