clasherjk


Nameclasherjk JSON
Version 1.0.5 PyPI version JSON
download
home_pageNone
SummaryA simple and efficient Python wrapper for the official Clash of Clans API, enabling developers to fetch player, clan, and war data with ease.
upload_time2025-08-13 02:47:45
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseNone
keywords clash-of-clans clasherjk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ClasherJK Python Library

[![PyPI version](https://badge.fury.io/py/clasherjk.svg)](https://badge.fury.io/py/clasherjk)
[![Python Versions](https://img.shields.io/pypi/pyversions/clasherjk.svg)](https://pypi.org/project/clasherjk/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

A simple and easy-to-use Python wrapper for the Clash of Clans API using a secure proxy server. 

**No API token required!** All requests are handled through our secure proxy server, making it incredibly easy to get started with Clash of Clans data.

## Installation

```bash
pip install clasherjk
```

## Finding Player and Clan Tags

To use this library, you need valid Clash of Clans player and clan tags:

**Player Tags:**
- In Clash of Clans app: Go to your profile → Copy the tag (starts with #)
- From leaderboards or clan member lists
- Example format: `#ABC123DEF`

**Clan Tags:**
- In Clash of Clans app: Go to clan info → Copy the tag (starts with #)  
- From clan search results
- Example format: `#123ABC`

## Quick Start

```python
from clasherjk.client import ClasherJK

# Create client (no authentication needed!)
client = ClasherJK()

# Get player information (replace with any valid player tag)
player = client.get_player("#PLAYER_TAG")
print(f"Player: {player.name}")
print(f"Level: {player.exp_level}")
print(f"Trophies: {player.trophies}")
print(f"Town Hall: {player.town_hall_level}")

# Get clan information (replace with any valid clan tag)
clan = client.get_clan("#CLAN_TAG")
print(f"Clan: {clan.name}")
print(f"Members: {clan.members}")
print(f"Clan Level: {clan.clan_level}")

# Close the client
client.close()
```

## Usage Examples

### Player Information

```python
from clasherjk.client import ClasherJK

with ClasherJK() as client:
    player = client.get_player("#PLAYER_TAG")  # Replace with actual player tag
    
    print(f"Player: {player.name}")
    print(f"Level: {player.exp_level}")
    print(f"Trophies: {player.trophies}")
    print(f"Town Hall Level: {player.town_hall_level}")
    
    # League information
    if player.league:
        print(f"League: {player.league.name}")
    
    # Troops information
    for troop in player.troops[:5]:  # Show first 5 troops
        print(f"{troop.name}: Level {troop.level}")
```

### Clan Information

```python
from clasherjk.client import ClasherJK

with ClasherJK() as client:
    clan = client.get_clan("#CLAN_TAG")  # Replace with actual clan tag
    
    print(f"Clan: {clan.name}")
    print(f"Level: {clan.clan_level}")
    print(f"Members: {clan.members}/50")
    print(f"War Wins: {clan.war_wins}")
    
    # Get clan members
    for member in clan.member_list[:5]:  # Show first 5 members
        print(f"{member.name}: {member.trophies} trophies ({member.role})")
```

### Search and Rankings

```python
from clasherjk.client import ClasherJK

with ClasherJK() as client:
    # Search for clans
    clans = client.search_clans(name="dragons", min_members=40, limit=3)
    for clan in clans:
        print(f"{clan.name}: {clan.members} members")
    
    # Global rankings
    top_players = client.get_global_player_rankings(limit=5)
    for i, player in enumerate(top_players, 1):
        print(f"#{i} {player.name}: {player.trophies:,} trophies")
```

## Requirements

- Python 3.7+
- httpx >= 0.24.0 (automatically installed)

## API Reference

### Main Client

- `ClasherJK()` - Initialize client
- `get_player(tag)` - Get player by tag
- `get_clan(tag)` - Get clan by tag
- `search_clans(**filters)` - Search for clans
- `get_global_player_rankings(limit=None)` - Global player rankings
- `get_global_clan_rankings(limit=None)` - Global clan rankings

### Data Models

- **Player** - Complete player information
- **Clan** - Complete clan information  
- **ClanMember** - Individual clan member
- **League** - League information
- **War** - War information

### Exception Handling

```python
from clasherjk.client import ClasherJK
from clasherjk.exceptions import PlayerNotFound, ClanNotFound

with ClasherJK() as client:
    try:
        player = client.get_player("#INVALID")
    except PlayerNotFound:
        print("Player not found!")
    except Exception as e:
        print(f"API Error: {e}")
```

## License

MIT License - see [LICENSE](LICENSE) file for details.

## Contributing

Issues and pull requests are welcome on GitHub.

---

**Made for the Clash of Clans community** ⚔️

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "clasherjk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": "clash-of-clans, clasherjk",
    "author": null,
    "author_email": "ClasherJK <jkminidev@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/22/58/695913980fd27b33fc6005d5cc064f6f4a0a324ec6c7d848c355eed0afb7/clasherjk-1.0.5.tar.gz",
    "platform": null,
    "description": "# ClasherJK Python Library\n\n[![PyPI version](https://badge.fury.io/py/clasherjk.svg)](https://badge.fury.io/py/clasherjk)\n[![Python Versions](https://img.shields.io/pypi/pyversions/clasherjk.svg)](https://pypi.org/project/clasherjk/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nA simple and easy-to-use Python wrapper for the Clash of Clans API using a secure proxy server. \n\n**No API token required!** All requests are handled through our secure proxy server, making it incredibly easy to get started with Clash of Clans data.\n\n## Installation\n\n```bash\npip install clasherjk\n```\n\n## Finding Player and Clan Tags\n\nTo use this library, you need valid Clash of Clans player and clan tags:\n\n**Player Tags:**\n- In Clash of Clans app: Go to your profile \u2192 Copy the tag (starts with #)\n- From leaderboards or clan member lists\n- Example format: `#ABC123DEF`\n\n**Clan Tags:**\n- In Clash of Clans app: Go to clan info \u2192 Copy the tag (starts with #)  \n- From clan search results\n- Example format: `#123ABC`\n\n## Quick Start\n\n```python\nfrom clasherjk.client import ClasherJK\n\n# Create client (no authentication needed!)\nclient = ClasherJK()\n\n# Get player information (replace with any valid player tag)\nplayer = client.get_player(\"#PLAYER_TAG\")\nprint(f\"Player: {player.name}\")\nprint(f\"Level: {player.exp_level}\")\nprint(f\"Trophies: {player.trophies}\")\nprint(f\"Town Hall: {player.town_hall_level}\")\n\n# Get clan information (replace with any valid clan tag)\nclan = client.get_clan(\"#CLAN_TAG\")\nprint(f\"Clan: {clan.name}\")\nprint(f\"Members: {clan.members}\")\nprint(f\"Clan Level: {clan.clan_level}\")\n\n# Close the client\nclient.close()\n```\n\n## Usage Examples\n\n### Player Information\n\n```python\nfrom clasherjk.client import ClasherJK\n\nwith ClasherJK() as client:\n    player = client.get_player(\"#PLAYER_TAG\")  # Replace with actual player tag\n    \n    print(f\"Player: {player.name}\")\n    print(f\"Level: {player.exp_level}\")\n    print(f\"Trophies: {player.trophies}\")\n    print(f\"Town Hall Level: {player.town_hall_level}\")\n    \n    # League information\n    if player.league:\n        print(f\"League: {player.league.name}\")\n    \n    # Troops information\n    for troop in player.troops[:5]:  # Show first 5 troops\n        print(f\"{troop.name}: Level {troop.level}\")\n```\n\n### Clan Information\n\n```python\nfrom clasherjk.client import ClasherJK\n\nwith ClasherJK() as client:\n    clan = client.get_clan(\"#CLAN_TAG\")  # Replace with actual clan tag\n    \n    print(f\"Clan: {clan.name}\")\n    print(f\"Level: {clan.clan_level}\")\n    print(f\"Members: {clan.members}/50\")\n    print(f\"War Wins: {clan.war_wins}\")\n    \n    # Get clan members\n    for member in clan.member_list[:5]:  # Show first 5 members\n        print(f\"{member.name}: {member.trophies} trophies ({member.role})\")\n```\n\n### Search and Rankings\n\n```python\nfrom clasherjk.client import ClasherJK\n\nwith ClasherJK() as client:\n    # Search for clans\n    clans = client.search_clans(name=\"dragons\", min_members=40, limit=3)\n    for clan in clans:\n        print(f\"{clan.name}: {clan.members} members\")\n    \n    # Global rankings\n    top_players = client.get_global_player_rankings(limit=5)\n    for i, player in enumerate(top_players, 1):\n        print(f\"#{i} {player.name}: {player.trophies:,} trophies\")\n```\n\n## Requirements\n\n- Python 3.7+\n- httpx >= 0.24.0 (automatically installed)\n\n## API Reference\n\n### Main Client\n\n- `ClasherJK()` - Initialize client\n- `get_player(tag)` - Get player by tag\n- `get_clan(tag)` - Get clan by tag\n- `search_clans(**filters)` - Search for clans\n- `get_global_player_rankings(limit=None)` - Global player rankings\n- `get_global_clan_rankings(limit=None)` - Global clan rankings\n\n### Data Models\n\n- **Player** - Complete player information\n- **Clan** - Complete clan information  \n- **ClanMember** - Individual clan member\n- **League** - League information\n- **War** - War information\n\n### Exception Handling\n\n```python\nfrom clasherjk.client import ClasherJK\nfrom clasherjk.exceptions import PlayerNotFound, ClanNotFound\n\nwith ClasherJK() as client:\n    try:\n        player = client.get_player(\"#INVALID\")\n    except PlayerNotFound:\n        print(\"Player not found!\")\n    except Exception as e:\n        print(f\"API Error: {e}\")\n```\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nIssues and pull requests are welcome on GitHub.\n\n---\n\n**Made for the Clash of Clans community** \u2694\ufe0f\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A simple and efficient Python wrapper for the official Clash of Clans API, enabling developers to fetch player, clan, and war data with ease.",
    "version": "1.0.5",
    "project_urls": {
        "Homepage": "https://jktripuri.site"
    },
    "split_keywords": [
        "clash-of-clans",
        " clasherjk"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "844e858045954bff6d09de376fa13452fe75a2ce5688b11bd163095854bd99fe",
                "md5": "0273da44052d598e6840012283fee0f0",
                "sha256": "7b7e6d598a0cf4b4782053b247e700e41a2a5241e6c141f62b8dac2a468f1f6e"
            },
            "downloads": -1,
            "filename": "clasherjk-1.0.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0273da44052d598e6840012283fee0f0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 9437,
            "upload_time": "2025-08-13T02:47:43",
            "upload_time_iso_8601": "2025-08-13T02:47:43.982248Z",
            "url": "https://files.pythonhosted.org/packages/84/4e/858045954bff6d09de376fa13452fe75a2ce5688b11bd163095854bd99fe/clasherjk-1.0.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "2258695913980fd27b33fc6005d5cc064f6f4a0a324ec6c7d848c355eed0afb7",
                "md5": "1dab82c3a007ed17334f9e5ca5f12b00",
                "sha256": "7d915f079a5502d2e20aac9d3d45066a30f44f8ac054e436881ac5a6fd877619"
            },
            "downloads": -1,
            "filename": "clasherjk-1.0.5.tar.gz",
            "has_sig": false,
            "md5_digest": "1dab82c3a007ed17334f9e5ca5f12b00",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 10212,
            "upload_time": "2025-08-13T02:47:45",
            "upload_time_iso_8601": "2025-08-13T02:47:45.006844Z",
            "url": "https://files.pythonhosted.org/packages/22/58/695913980fd27b33fc6005d5cc064f6f4a0a324ec6c7d848c355eed0afb7/clasherjk-1.0.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-13 02:47:45",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "clasherjk"
}
        
Elapsed time: 1.26199s