Skip to main content

Package used to find fencers ranking placements.

Project description

Finfo

This is a python-package used to get current and histrorical rankings of fencers.

Table of Contents

  1. Installation
  2. Practical Information
  3. Usage
  4. Contributing
  5. License

Installation

pip install finfo

Practical information

Before you begin to use this package I have some practical information.

There are current and historical fencing rankings you can access. The historic ones only go back to the 2019-2020 season.

We have made out own system to classify how one should look up the rankings. You can get all the categories when running the all_fencing_categories function.

This package is built around reading the rankings from the official PDF files. This means that sometimes the runtime is a bit slow, because it needs to pull the latest packages.

Usage

Table of Contents

  1. Configuring class
  2. Getting specific fencer by rank
  3. Getting specific fencer by name
  4. Getting all fencers from a specific country
  5. Getting all categories

Configuring class

Almost all actions will be used on a class. This class will be configured like this:

from finfo.FIE import FIE

fie = FIE(season)

An example of this can look like this:

fie = FIE("foil_senior_men_2022_2023")

Getting specific fencer by rank

This method takes a rank, and outputs the athlete:

from finfo.FIE import FIE

fie = FIE("foil_senior_men_2022_2023")

fie.find_fencer_by_rank(1)
{"First name": "Alexander", "Last name": "Massiales", "CountryCode": "USA"}

Getting specific fencer by name

This method takes the fencers name, and outputs the fencer as a dictionary object with rank, name and countrycode.

from finfo.FIE import FIE

fie = FIE("foil_senior_men_2022_2023")

fie.find_fencer_by_name('alexander', 'massiales')
{"First name": "Alexander", "Last name": "Massiales", "CountryCode": "USA", "Rank": 1}

Getting all fencers from a specific country

This method takes an countrycode, and outputs all the fencers from that country.

from finfo.FIE import FIE

fie = FIE("foil_senior_men_2022_2023")

fie.get_all_fencers_from_country("CYP")
[{'Lastname': 'tofalides', 'Firstname': 'alex', 'CountryCode': 'CYP', 'Rank': 68}, {'Lastname': 'kiayias', 'Firstname': 'william', 'CountryCode': 'CYP', 'Rank': 762}]

Getting all categories

This method takes no arguments, and outputs all valid categories.

from finfo.FIE import all_fencing_categories

all_fencing_categories()
['foil_senior_men_2023_2024', 'epee_senior_men_2023_2024', 'sabre_senior_men_2023_2024', 'foil_senior_woman_2023_2024', 'epee_senior_woman_2023_2024', 'sabre_senior_woman_2023_2024', 'foil_junior_men_2023_2024', 'epee_junior_men_2023_2024', 'sabre_junior_men_2023_2024', 'foil_junior_woman_2023_2024', 'epee_junior_woman_2023_2024', 'sabre_junior_woman_2023_2024', 'foil_cadet_men_eu_2023_2024', 'epee_cadet_men_eu_2023_2024', 'sabre_cadet_men_eu_2023_2024', 'foil_cadet_woman_eu_2023_2024', 'epee_cadet_woman_eu_2023_2024', 'sabre_cadet_woman_eu_2023_2024', 'foil_senior_men_2022_2023', 'epee_senior_men_2022_2023', 'sabre_senior_men_2022_2023', 'foil_senior_woman_2022_2023', 'epee_senior_woman_2022_2023', 'sabre_senior_woman_2022_2023', 'foil_junior_men_2022_2023', 'epee_junior_men_2022_2023', 'sabre_junior_men_2022_2023', 'foil_junior_woman_2022_2023', 'epee_junior_woman_2022_2023', 'sabre_junior_woman_2022_2023', 'foil_cadet_men_eu_2022_2023', 'epee_cadet_men_eu_2022_2023', 'sabre_cadet_men_eu_2022_2023', 'foil_cadet_woman_eu_2022_2023', 'epee_cadet_woman_eu_2022_2023', 'sabre_cadet_woman_eu_2022_2023', 'foil_senior_men_2021_2022', 'epee_senior_men_2021_2022', 'sabre_senior_men_2021_2022', 'foil_senior_woman_2021_2022', 'epee_senior_woman_2021_2022', 'sabre_senior_woman_2021_2022', 'foil_junior_men_2021_2022', 'epee_junior_men_2021_2022', 'sabre_junior_men_2021_2022', 'foil_junior_woman_2021_2022', 'epee_junior_woman_2021_2022', 'sabre_junior_woman_2021_2022', 'foil_cadet_men_eu_2021_2022', 'epee_cadet_men_eu_2021_2022', 'sabre_cadet_men_eu_2021_2022', 'foil_cadet_woman_eu_2021_2022', 'epee_cadet_woman_eu_2021_2022', 'sabre_cadet_woman_eu_2021_2022', 'foil_senior_men_2020_2021', 'epee_senior_men_2020_2021', 'sabre_senior_men_2020_2021', 'foil_senior_woman_2020_2021', 'epee_senior_woman_2020_2021', 'sabre_senior_woman_2020_2021', 'foil_junior_men_2020_2021', 'epee_junior_men_2020_2021', 'sabre_junior_men_2020_2021', 'foil_junior_woman_2020_2021', 'epee_junior_woman_2020_2021', 'sabre_junior_woman_2020_2021', 'foil_cadet_men_eu_2020_2021', 'epee_cadet_men_eu_2020_2021', 'sabre_cadet_men_eu_2020_2021', 'foil_cadet_woman_eu_2020_2021', 'epee_cadet_woman_eu_2020_2021', 'sabre_cadet_woman_eu_2020_2021', 'foil_senior_men_2019_2020', 'epee_senior_men_2019_2020', 'sabre_senior_men_2019_2020', 'foil_senior_woman_2019_2020', 'epee_senior_woman_2019_2020', 'sabre_senior_woman_2019_2020', 'foil_junior_men_2019_2020', 'epee_junior_men_2019_2020', 'sabre_junior_men_2019_2020', 'foil_junior_woman_2019_2020', 'epee_junior_woman_2019_2020', 'sabre_junior_woman_2019_2020', 'foil_cadet_men_eu_2019_2020', 'epee_cadet_men_eu_2019_2020', 'sabre_cadet_men_eu_2019_2020', 'foil_cadet_woman_eu_2019_2020', 'epee_cadet_woman_eu_2019_2020', 'sabre_cadet_woman_eu_2019_2020']

Getting all valid Country Codes

This methods returns all valid Country Codes, and takes no arguments.

from finfo.FIE import all_valid_countrycodes

all_valid_countrycodes()
{'AIN', 'VIE', 'TUN', 'JOR', 'AZE', 'BOL', 'CAN', 'TKM', 'NGR', 
'ROU', 'GRE', 'MAR', 'UZB', 'IRI', 'NCA', 'EST', 'PHI', 'LBA', 
'UAE', 'LBN', 'MKD', 'TPE', 'BUL', 'IRL', 'CYP', 'MGL', 'SEN', 
'POL', 'POR', 'QAT', 'SUI', 'KSA', 'MAS', 'CZE', 'PAR', 'KGZ', 
'TUR', 'MEX', 'BRA', 'ALG', 'IND', 'INA', 'ARM', 'PAN', 'DEN', 
'CRC', 'ESP', 'EGY', 'THA', 'SRB', 'PUR', 'RSA', 'CHN', 'FIN', 
'GBR', 'KUW', 'MDA', 'MAC', 'ITA', 'COD', 'AUS', 'CHI', 'ARG', 
'ANG', 'USA', 'OMA', 'PER', 'KOR', 'FRA', 'JPN', 'NZL', 'NOR', 
'UKR', 'SVK', 'MLT', 'HKG', 'SGP', 'COL', 'GER', 'SWE', 'ESA', 
'JAM', 'LAT', 'VEN', 'SLO', 'LUX', 'BRN', 'GEO', 'CRO', 'BEL', 
'AUT', 'NED', 'ISR', 'ISV', 'LTU', 'HUN', 'KAZ', 'DOM', 'ECU', 
'GUA', 'URU', 'NIG', 'IRQ', 'GHA', 'BER', 'ISL', 'TOG', 'PAK'
'BAR', 'RUS', 'CPV', 'MLI', 'CIV', 'BAH', 'MRI', 'CUB', 'MNE'
'GUY', 'TJK', 'BEN', 'PAK', 'SRI', 'KEN', 'BUR', 'HON', 'NEP',
'BRU', 'UGA', 'CMR', 'RWA', 'BAR', 'HAI', 'YEM', 'ARU', 'SYR', 
'MNE', 'MON', 'SUD'}

Contributing

Contributing is welcome, please just email so I can get a clear understanding of the improvement. Please make sure to update tests as appropriate.

License

MIT

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

finfo-3.tar.gz (10.3 kB view details)

Uploaded Source

Built Distribution

finfo-3-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file finfo-3.tar.gz.

File metadata

  • Download URL: finfo-3.tar.gz
  • Upload date:
  • Size: 10.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.1

File hashes

Hashes for finfo-3.tar.gz
Algorithm Hash digest
SHA256 b487f887dcdb311ae251edd648defb3c459240a500223594ba1a5edcdc066183
MD5 3b19dbc7d7bba157d94720f7781bf7a1
BLAKE2b-256 d18d4b094f9e49786c44797ff42e95259757b79bbefce5dea7564f77e83bdee4

See more details on using hashes here.

File details

Details for the file finfo-3-py3-none-any.whl.

File metadata

  • Download URL: finfo-3-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.1

File hashes

Hashes for finfo-3-py3-none-any.whl
Algorithm Hash digest
SHA256 b6d646e46b5e6a91e96d69625537b7c355d3a5d8842a0e47537e927ef93b32e0
MD5 2707c1d4bf830a741d98fdfed9c51378
BLAKE2b-256 d0d0fb7da02659a7589ea7c2e565f0c6d977b41c93d924060b0f2cc471af873f

See more details on using hashes here.

Supported by

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