Skip to main content

Livescore-api

Python Test License PyPi Black Passing coverage Progress Downloads

Access and manipulate football data from Livescore.

Installation

  1. From pip
pip install livescore-api
  1. From source
  • Clone repo and install
git clone https://github.com/Simatwa/livescore-api.git
cd livescore-api
pip install .

Usage

  • $ livescore-api

Developer docs

  1. Retrieving data offline
from livescore_api import json_formatter
raw_matches = open("matches.json").read()
sorted_matches = json_formatter(raw_matches)
print(sorted_matches(max=1))

"""
Output
[
{
    "Serial Id": "12413",
    "League": "Primera Division",
    "Country": "Argentina",
    "Match Id": "866073",
    "H Scores": "1",
    "A Scores": "4",
    "Kickoff": 20230613011500,
    "Status": "FT",
    "Home": "Banfield",
    "H id": "5252",
    "Away": "River Plate",
    "A id": "4802"
}
]
"""
  1. Retrieving data online
from livescore_api import livescore

matches = livescore()
print(matches(max=1))

"""
Output

[
{
    "Serial Id": "12413",
    "League": "Primera Division",
    "Country": "Argentina",
    "Match Id": "866073",
    "H Scores": "1",
    "A Scores": "4",
    "Kickoff": 20230613011500,
    "Status": "FT",
    "Home": "Banfield",
    "H id": "5252",
    "Away": "River Plate",
    "A id": "4802"
}
]
"""
  1. Making predictions
from livescore_api import Make
matches = [{"Home":"Arsenal", "Away":"Liverpool"}]
bet = Make(matches)
print(bet())

"""
Output

[{'Home': 'Arsenal', 'Away': 'Liverpool', 'g': 10.0, 'gg': 55.0, 'ov15': 60.0, 'ov25': 45.0, 'ov35': 25.0, 'choice': 62.5, 'result': '2', 'pick': '2'}]
"""

For more info run $ livescore-api -h

usage: livescore-api [-h] [-v] [-m MONTH] [-y YEAR] [-c COUNTRY]
                     [-l LEAGUE] [-n NAME] [-s STATUS] [-M MAX]
                     [-H HEADERS] [-o PATH]
                     [-f html|csv|xlsx|markdown|xml|json] [-i PATH]
                     [-t html|pretty|grid|fancy_grid|orgtbl|secure_html]
                     [-D CODE] [-E TIMEOUT] [-I INDENT] [-C PATH]
                     [--update] [--raw] [--predict] [-U USERNAME]
                     [-P PASSWORD] [-S SERVER] [-T LIMIT] [--offline]
                     [--REST] [--include-position]
                     [date]

Access and manipulate matches from Livescore.com

positional arguments:
  date                  Date of the matches - 13

options:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -m MONTH, --month MONTH
                        Month of the matches - 6
  -y YEAR, --year YEAR  Year of the matches - 2023
  -c COUNTRY, --country COUNTRY
                        Return matches from the specified countries only
                        - None
  -l LEAGUE, --league LEAGUE
                        Return matches of the specified league(s) only -
                        None
  -n NAME, --name NAME  Return matches with the specified team-name only
                        - None
  -s STATUS, --status STATUS
                        Return matches of the specified status - None
  -M MAX, --max MAX     Maximum matches to be returned - 1000
  -H HEADERS, --headers HEADERS
                        Path to .json file containing http headers - None
  -o PATH, --output PATH
                        Path to save the content - None
  -f html|csv|xlsx|markdown|xml|json, --format html|csv|xlsx|markdown|xml|json
                        Contents output format - json
  -i PATH, --input PATH
                        Use .json formatted file in path - None
  -t html|pretty|grid|fancy_grid|orgtbl|secure_html, --tabulate html|pretty|grid|fancy_grid|orgtbl|secure_html
                        Tabulate the contents using style specified -
                        None
  -D CODE, --code CODE  Country code for making http request - KE
  -E TIMEOUT, --timeout TIMEOUT
                        Http request timeout - 20s
  -I INDENT, --indent INDENT
                        Indentation level for formatting .json output - 4
  -C PATH, --config PATH
                        Use mapper-keys in path - None
  --update              Update mapper-keys from repo - False
  --raw                 Return contents with zero manipulation - False
  --predict             Proceed to make predictions - False
  -U USERNAME, --username USERNAME
                        Username for the REST api - API
  -P PASSWORD, --password PASSWORD
                        Passkey for the REST api - developer
  -S SERVER, --server SERVER
                        Url pointing to REST api - http://localhost:8000
  -T LIMIT, --limit LIMIT
                        Limit number of matches for prediction - 1000
  --offline             Make predictions based on data available offline
                        - False
  --REST                Specifies to make predictions using REST api -
                        False
  --include-position    Include team-league rank in making predictions -
                        False

This script has no official relation with Livescore.com

Disclaimer

This script utilizes the Livescore API to provide live scores and other information about sporting events. The Livescore-API is a third-party service and is not affiliated with any specific sporting event or organization. The accuracy of the information provided by the Livescore API is not guaranteed and may vary depending on a number of factors, including the availability of data and the quality of the data. The user of this script assumes all responsibility for any legal action, errors or omissions in the information provided by the Livescore API.

Author

The author of this script makes no representations or warranties, express or implied, about the accuracy, completeness, or suitability of the information provided by the Livescore API. The author of this script accepts no liability for any legal action, errors or omissions in the information provided by the Livescore API.

Note : This is just for information purposes do not sue me.

Metadata

Release files for livescore-api 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for livescore-api 0.0.6
File Size Uploaded Provenance Actions
livescore-api-0.0.6.tar.gz 14.0 kB Without provenance Details for livescore-api-0.0.6.tar.gz

Release files / livescore-api-0.0.6.tar.gz

Download URL livescore-api-0.0.6.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
0767e2f713e597e0d216971c078ee29a211dbf1e8c47c087eed56940f2c8f782
BLAKE2b-256 checksum
How to use checksums
d6ad6df822182c1b20fcbbae17af31a04f3d2aaf74c778e2453e3a6ba2b5c92a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.0

Security for livescore-api 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page