Skip to main content

Library to handle Elifoot equipas

Project description

libelifoot

CI License: LGPL v3

Overview

Library to handle Elifoot 98 equipas. The main functionalities of the library are:

  • View data from a equipa file;
  • Generate patch files with upstream data from an equipa file;
  • Generate patches in batch from a directory of equipa files.

Usage

View the content of an equipa file:

from sys import argv

from libelifoot import view_equipa


def main(equipa: str) -> None:
    print(view_equipa(equipa))


if __name__ == "__main__":
    main(argv[1])

Generate a patch file with upstream data from an equipa file:

from sys import argv
from typing import Optional

from libelifoot import (
    update_equipa,
    Equipa,
    EquipaFileHandler,
    UpdateEquipaListener
)


class EventHandler(UpdateEquipaListener):

    def on_update_equipa(
        self,
        equipa_name: str,
        equipa_data: Optional[Equipa]
    ) -> None:
        print(f'{equipa_name}\n{equipa_data}')

        if equipa_data:
            EquipaFileHandler.write(f'{equipa_name}.patch', equipa_data)

    def on_update_equipa_error(self, error: str) -> None:
        print(f'ERROR: {error}')


def main(equipa: str, provider: str, season: int) -> None:
    ev = EventHandler()

    update_equipa(equipa, provider, season, ev)


if __name__ == "__main__":
    main(argv[1], argv[2], int(argv[3]))

Generate patches in batch based on a directory of equipa files:

from sys import argv
from typing import Optional

from libelifoot import (
    bulk_update,
    Equipa,
    EquipaFileHandler,
    UpdateEquipaListener,
)


class EventHandler(UpdateEquipaListener):

    def on_update_equipa(
        self,
        equipa_name: str,
        equipa_data: Optional[Equipa]
    ) -> None:
        print(f'{equipa_name}\n{equipa_data}')

        if equipa_data:
            EquipaFileHandler.write(f'{equipa_name}.patch', equipa_data)

    def on_update_equipa_error(self, error: str) -> None:
        print(f'ERROR: {error}')


def main(equipa_dir: str, provider: str, season: int) -> None:
    ev = EventHandler()

    bulk_update(equipa_dir, provider, season, ev)


if __name__ == "__main__":
    main(argv[1], argv[2], int(argv[3]))

Supported providers

To generate patches, the library fetches data from public football data providers. Currently, the library supports the following providers:

  • ESPN;
  • Transfermarkt.

Documentation

See docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

libelifoot-0.1.1.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

libelifoot-0.1.1-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file libelifoot-0.1.1.tar.gz.

File metadata

  • Download URL: libelifoot-0.1.1.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for libelifoot-0.1.1.tar.gz
Algorithm Hash digest
SHA256 87174156d764fbbe274192557ec0c796b3570301d02ce1e49e2a312afd0555ec
MD5 8681d7ef2fefb5cc1cdc3bed6cfef94b
BLAKE2b-256 b829e3f5457f391eec84a961a0071955fa1c3619a48c88a1d7161bc70ca70368

See more details on using hashes here.

File details

Details for the file libelifoot-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: libelifoot-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for libelifoot-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 278dc8ea1d545e47209fa222ccafc2672913d0cdf12eab288cdb00cddea6b6a5
MD5 c722b83960522ebf437a6c8a18a1c18b
BLAKE2b-256 e77554ca014883d63e3a035bbfbb66ddc470fa7d9244280e5ba90918c8d9c2ff

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page