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-1.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

finfo-1.2-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for finfo-1.2.tar.gz
Algorithm Hash digest
SHA256 7479dcd08b4242591a523c34333049106acd1336aa1a9b1e2609c2f99caaeb44
MD5 30d4b397cef8901600310c9dd353f1e7
BLAKE2b-256 92fa61edd25d8bb1bb8c3b565d9638e6f72199670a0950bd15571acbf94928e8

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for finfo-1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 402d715cb9a541d3f57afc1a4b5956bce52d0c07326b8bcc874695a7c01ba5f3
MD5 0cd43195c3c64af53c24f4a303b79fc9
BLAKE2b-256 c4d486cbde30ee7d8cd2e6387bc1116ce6b901cc0ce655c9e76a490303c8bf0c

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