Code Monkey home page Code Monkey logo

cocapi's Introduction

Hi there ๐Ÿ‘‹

  • ๐Ÿ“ซ Reach me: here
  • ๐Ÿ connoisseur.
  • In love with ๐Ÿฆ€ .
  • ๐Ÿค” Trying to embrace the enemy : Javascript/Typescript.
  • ๐Ÿ”ญ Question I'm usually asked - Tu krta kya h!
  • ๐Ÿคฆ An engineer doing an MBA(Yes the stereotype).

cocapi's People

Contributors

2kofawsome avatar dependabot[bot] avatar nagayev avatar tonybenoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cocapi's Issues

import requests

Hey,

Last version has a bug, "import requests" is missing at the beginning as it is still being used on line 8:
self.requests = requests

Cheers and thanks for the script!

Add async support

Requests was replaced with httpx in the early days so as to enable the wrapper to call the APIs asynchronously. Although httpx was added the async capabilities were never added/implemented due to a lack of time and me being lazy overall.
In order to implement the same I would have to either

  1. Add new methods i.e. async_
  2. Add a wrapper that would make the function awaitable if needed
  3. Add a new async class which would preferably inherit from CocApi and add async
    The main concern being that all methods are simply a wrapper around endpoints I really don't want to maintain twice the functions just to add async.

New endpoints

Last update changed and added new endpoints, do you plan to add it?


The next Clash of Clans release will introduce the following changes in the API of the game.

Some existing routes and model properties will become deprecated: they will still be present in the API for now but eventually they will be removed.

There will not be a replacement in the API for the versusBattleWins property. After the next Clash of Clans release this property will be constant zero until it will eventually be removed.

Routes

The route /locations/{locationId}/rankings/clans-versus will become deprecated and replaced by the route /locations/{locationId}/rankings/clans-builder-base.
The route /locations/{locationId}/rankings/players-versus will become deprecated and replaced by the route /locations/{locationId}/rankings/players-builder-base.
The routes /builderbaseleagues and /builderbaseleagues/{leagueId} will be added.

Models
Clan

The property clanVersusPoints will become deprecated and replaced by the property clanBuilderBasePoints.
The property requiredVersusTrophies will become deprecated and replaced by the property requiredBuilderBaseTrophies.

ClanMember

The property versusTrophies will become deprecated and replaced by the property builderBaseTrophies.
The property builderBaseLeague will be added.

ClanVersusRanking

This model will be renamed to ClanBuilderBaseRanking.
The property clanVersusPoints will become deprecated and replaced by the property clanBuilderBasePoints.

Player

The property versusTrophies will become deprecated and replaced by the property builderBaseTrophies.
The property versusBattleWins will become deprecated and will be constant zero until it is removed.
The property legendStatistics.previousVersusSeason will become deprecated and replaced by the property legendStatistics.previousBuilderBaseSeason.
The property legendStatistics.bestVersusSeason will become deprecated and replaced by the property legendStatistics.bestBuilderBaseSeason.
The property builderBaseLeague will be added. It will be present only if Builder Base has been unlocked, similar to e.g. the property builderBaseTrophies.

PlayerVersusRanking

This model will be renamed to PlayerBuilderBaseRanking.
The property versusTrophies will become deprecated and replaced by the property builderBaseTrophies.
The property versusBattleWins will become deprecated and will be constant zero until it is removed.
The property builderBaseLeague will be added._

Source:
https://discord.com/channels/566451504332931073/854485301748432907/1106542015023419452

README.md

Small detail but in Readme.md it is written "api.clan_warleague(war_tag)" for Warleague Information and in the cocapi.py there is no "clan_" in the function.

Improvements needed

Terrible documentation. Need to improve that with better documentation for all possiblities.
Would love help if someone would like to contribute.

Something broke

Describe the bug
Until last month it was working normally but from yesterday I noticed that I often get the:
{"result": "error", "message": "Something broke"}

After asking in COC Api Junkies on Discord, I was recommended to modified it for:

except Exception as error:
  exc = ''.join(traceback.format_exception(type(error), error, error.__traceback__, chain=True))
  print(exc)

(with "import traceback" at the top of the script)

This did showed some "httpx.ReadTimeout: The read operation timed out", so I am currently trying with a value of 60 instead of 20 for timeout. It seemed to have improved so maybe there is a problem in my server.

Version used : [2.0.6]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.