Skip to main content

Library to handle Elifoot equipas

Project description

libelifoot

CI License: LGPL v3 pypi

Overview

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

  • View data from an 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.2.tar.gz (16.9 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.2-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: libelifoot-0.1.2.tar.gz
  • Upload date:
  • Size: 16.9 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.2.tar.gz
Algorithm Hash digest
SHA256 a4e319ee7ad1f119b095d3d19b89141c301b4af30d3e7044ae2f76ea2b4c09c1
MD5 ee0d3dae7b2c44b3e0614c668278f427
BLAKE2b-256 1d993a5b020a91a6a637bf5f1d4fa693f1f00c6ce4d0021b30fda37b23cced77

See more details on using hashes here.

File details

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

File metadata

  • Download URL: libelifoot-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 30.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c080b508093602ba7d93466760e61c55c615a557a99f8262ab1f0c3515a8861
MD5 895099d3db384b1f7077ec72b8952f6f
BLAKE2b-256 9aeb64b75c68c6b540ef783766befde655121b87b5ccf1d0fc31b53c81ea06b0

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