Giter Club home page Giter Club logo

pyot's Introduction

Caution

This package is now DEPRECATED and will no longer receive new updates. It has proved to be overly complex, hard to customize or extend, and contains an increased amount of implicit syntaxes that go against best practices. New projects shall NOT use this package and old projects should move away from this package as soon as possible.

The recommended package is pulsefire. A modern and flexible Riot Games Python SDK. Built to be simple to use, highly configurable, and extendable. Objects and client responses are fully typed to speed up coding efficiency.

Pyot

Pyot is an asyncIO-based high-level Python Riot Games API framework that encourages rapid development and clean, pragmatic design. It takes care of much of the hassle of the Riot Games API, so developers can focus on writing apps without reinventing the wheel. It’s free and open source.

Index Version
PyPI 6.0.9
master 6.0.9

If you're migrating your project to a newer version of Pyot, please refer to the Changelog section of the documentation.

Features

Features that Pyot can provide for your projects.

  • AsyncIO Based: Performing 60x faster with AsyncIO, highly configurable settings, and a wide range of tools to speed I/O tasks.
  • Community Projects Integrations: Includes support for CDragon, MerakiCDN. DDragon for LoL is Forbidden due to incompatible APIs.
  • Caches Integrated: A wide range of Caches Stores is available out of the box, and currently supports Omnistone(Runtime), RedisCache(RAM), DiskCache(Disk), and MongoDB(NoSQL).
  • Multiple Models: Available models of League of Legends, Teamfight Tactics, Legends of Runeterra and VALORANT.
  • Code Autocompletion: Access data through attributes and properties, and maximize code efficiency with code autocompletion.
  • Perfect Rate Limiter: Pyot's Rate Limiter is production-tested in all asynchronous, multithreaded, and multiprocessed environments.
  • User-Friendly Docs: Human readable documentation that covers guides and all the available high-level and low-level APIs in Pyot.

If this framework is useful, consider giving a star to the repo.

Documentation

Portal: https://pyot.iann838.com

The documentation covers:

  • Installation.
  • Configuration.
  • Base Objects.
  • Concurrency Basics.
  • Models API.
  • Stores.
  • Limiters.
  • Utilities.
  • Integrations.
  • Issues.
  • Changelog.

Due to the complexity of the framework, there is no quick-start guide, it is recommended to start with:

  • Reading and understanding the Cores section of the documentation.
  • Reading and understanding the example projects at Examples section to get familiar.
  • If your project requires a specific integration, check out Integrations section.

pyot's People

Contributors

bangingheads avatar iann838 avatar spannerk avatar verylongnicknamesuchwow avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

pyot's Issues

SummonerLeague does not have attribute entries.

I am using the SummonerLeague object and trying to get to its entries. I get an error which says that the object does not have an attribute named entries. According to the source code and the documentation however, it does.

Code:

summoner = await lol.Summoner(name=name, platform=region).get()
leagues = summoner.league_entries
print(leagues.entries)

Output:

'SummonerLeague' object has no attribute 'entries'
'SummonerLeague' object has no attribute 'entries'

Code:

print(dir(leagues))
print(vars(leagues))

Output:

['Meta', '__annotations__', '__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattr__', '__getattribute__', '__getitem__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__iter__', '__le__', '__len__', '__lt__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_locale', '_meta', '_platform', '_platform2regions', '_platforms', '_region', '_regions', '_version', 'body', 'clean', 'dict', 'fill', 'filter', 'get', 'initialize', 'load', 'load_lazy_properties', 'locale', 'match_rule', 'match_server', 'metapipeline', 'metaroot', 'pipeline', 'platform', 'post', 'post_request', 'pre_request', 'put', 'qualkey', 'query', 'raw', 'rdict', 'region', 'setup', 'summoner', 'summoner_id', 'token', 'transform', 'version']
{'_meta': <pyot.models.lol.league.SummonerLeague.Meta object at 0x0000022B34F52F50>, 'summoner_id': 'CRyYy0X6Eu0mBbqLIZND_IYoixNORDK4kUG18ZdD2QC0EMM', '_platform': 'euw1'}

Both the name and the region are correct, the summoner is also ranked.

@activate_pipeline("lol") KeyError 'backend'

Sorry for creating an issue for this, but I don't know where I would otherwise get help from.
I am wondering what this error means:

Exception has occurred: KeyError
'backend'
  File "C:\Users\XXX\Realm-Wrap\backend\utils\pyotconf.py", line 18, in <module>
    @activate_pipeline("lol")
     ^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'backend'

I get this error when loading the pyotconf.py
I copied the pyotconf.py mostly from the docs and just made some minor changes, so I don't know what the problem is, since the error is not that much of a help.

from pyot.conf.model import activate_model, ModelConf
from pyot.conf.pipeline import activate_pipeline, PipelineConf
from dotenv import load_dotenv
import os

# Load env variables
load_dotenv(os.path.join(os.path.dirname(__file__), "..", ".env"))


@activate_model("lol")
class LolModel(ModelConf):
    default_platform = "euw1"
    default_region = "europe"
    default_version = "latest"
    default_locale = "en_us"


@activate_pipeline("lol")
class LolPipeline(PipelineConf):
    name = "lol_main"
    default = True
    stores = [
        {
            "BACKEND": "pyot.stores.riotapi.RiotAPI",
            "API_KEY": os.getenv("RIOT_API_KEY"),
            "RATE_LIMITER": {
                "BACKEND": "pyot.limiters.redis.RedisLimiter",
                "HOST": "redis",
                "PORT": 6379,
                "DB": 0,
                "LIMITING_SHARE": 0.9,
            }
        }
    ]

Unclear how to use external databases like MongoDB

I've been trying to figure out a way to utilize a MongoDB database as a long-term storage option that persists between runs of the application. The documentation provides very little information, and there are no examples of using MongoDB (or any other of the external stores) to retrieve/save information.

Is this functionality implemented yet? If so, can you expand on the documentation to provide examples of interfacing with the database?

Specifically, I want to save a lot of match information with something that looks like

summoner = await Summoner(...)
matches = await MatchHistory(puuid=summoner.puuid).query(count=10).get()
mongodb = ... # How do I access the database specified in the config?
for id in matches.ids:
    match = await Match(id=id).get()
    # Save the match to MongoDB
    mongodb.set( ... )

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.