Giter Site home page Giter Site logo

hltv-data's Introduction

Welcome to hltv-data ๐Ÿ‘‹ ๐ŸŽฎ

Version License: MIT

Data from popular Counter-Strike website hltv.org

Install

pip install hltv-data

Usage

The public methods can be reached using HLTVClient

from hltv_data import HLTVClient

hltv_client = HLTVClient()

Current ranking

hltv_client.get_ranking()
Response:

[
    {"position": 1, "name": "Natus Vincere", "points": 1000},
    {"position": 2, "name": "Gambit", "points": 822},
    {"position": 3, "name": "G2", "points": 629},
    {"position": 4, "name": "FaZe", "points": 409},
    {"position": 5, "name": "Virtus.pro", "points": 362},
    {"position": 6, "name": "Astralis", "points": 346},
    {"position": 7, "name": "Heroic", "points": 333},
    {"position": 8, "name": "NIP", "points": 287},
    {"position": 9, "name": "Vitality", "points": 282},
    {"position": 10, "name": "OG", "points": 241},
    {"position": 11, "name": "BIG", "points": 239},
    {"position": 12, "name": "Spirit", "points": 231},
    {"position": 13, "name": "Liquid", "points": 196},
    {"position": 14, "name": "mousesports", "points": 183},
    {"position": 15, "name": "forZe", "points": 179},
    {"position": 16, "name": "FURIA", "points": 176},
    {"position": 17, "name": "Complexity", "points": 164},
    {"position": 18, "name": "Entropiq", "points": 151},
    {"position": 19, "name": "Sinners", "points": 102},
    {"position": 20, "name": "ENCE", "points": 100},
    {"position": 21, "name": "Renegades", "points": 94},
    {"position": 22, "name": "SKADE", "points": 94},
    {"position": 23, "name": "AGO", "points": 89},
    {"position": 24, "name": "K23", "points": 82},
    {"position": 25, "name": "Extra Salt", "points": 79},
    {"position": 26, "name": "Endpoint", "points": 77},
    {"position": 27, "name": "Copenhagen Flames", "points": 76},
    {"position": 28, "name": "Evil Geniuses", "points": 71},
    {"position": 29, "name": "FunPlus Phoenix", "points": 60},
    {"position": 30, "name": "DBL PONEY", "points": 58},
]

Matches

hltv_client.get_matches()
Response:

[
    {
        "event": "ESL Pro League Season 16",
        "date": "2022-09-10T16:00:00",
        "team_1": "Outsiders",
        "team_2": "MIBR",
        "star_rating": 1
    },
    {
        "event": "ESL Pro League Season 16",
        "date": "2022-09-10T19:30:00",
        "team_1": "FaZe",
        "team_2": "G2",
        "star_rating": 3
    },
    ...
]

Results

hltv_client.get_results()
Response:

[
    {
        "event": "ESL Pro League Season 14",
        "team_1": {
            "name": "Vitality",
            "result": 2
        },
        "team_2": {
            "name": "Natus Vincere",
            "result": 3
        }
    },
    {
        "event": "Fragadelphia 15",
        "team_1": {
            "name": "Third Impact",
            "result": 1
        },
        "team_2": {
            "name": "Coldest Riders",
            "result": 2
        }
    },
    ...
]

Author

๐Ÿ‘ค Dariusz Choruzy

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a โญ๏ธ if this project helped you!

hltv-data's People

Contributors

dchoruzy 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

Watchers

 avatar  avatar  avatar

hltv-data's Issues

Include star rating in get_matches()

Feature request

Hey, is there a way to get the star rating of upcoming matches within the package? I think it would be appropriate to return it within the get_mathces method.

error of use hltv_client.get_matches()

'NoneType' object has no attribute 'find_all'

code:
from hltv_data import HLTVClient
hltv_client = HLTVClient()
matches = hltv_client.get_matches()
for match in matches:
event = match["event"]
date = match["date"]
team_1 = match["team_1"]
team_2 = match["team_2"]
star_rating = match["star_rating"]
print(f"{event} - {date} - {team_1} vs {team_2} - {star_rating}")

Add some param filters

Just an idea to receive some parameters in the functions to filter like "today matches" or the "10 next matches" etc

Optimization Suggestions for "hltv_client.get_ranking()"

"After downloading and using your package, I found that the data returned by 'hltv_client.get_ranking()' was always from March 5th. Therefore, I made a modification in the 'client.py' file of the package by changing the 'RANKING_URL' parameter, removing "/2024/march/5" from it. This adjustment allows the function to return real-time ranking data."

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.