Welcome to UFCPy!

A fast and easy way to access the UFC roster

Features

  • Scrapes everything off the UFC website

  • Synchronous

  • Easy

First Steps

  1. Install the package

    python3 -m pip install ufcpy
    
  2. Import the function to find a fighter

    from ufcpy import find_fighter_by_fullname
    
  3. Call the function and define it.

    fighter = find_fighter_by_fullname('Jon Jones')
    
  4. Use the class returned via the previous function to return anything about the specified fighter

    fighter.nickname
    # Returns 'Bones'
    

Example

from ufcpy import find_fighter_by_fullname

f = find_fighter_by_fullname('Jon Jones')

print(f.nickname, f.hometown)

Classes

Fighter

class ufcpy.Fighter(_parsed_url)

Bases: object

property name

The full name of the fighter

Type:

str

property nickname

The nickname of the fighter

Type:

str

property age

The age of the fighter

Type:

int

property division

The division the fighter is currently particapting in

Type:

str

property gender

The gender of the fighter

Type:

str

property record

The record of the fighter in the format of WIN-LOSS-DRAW

Type:

str

property wins

Amount of wins the fighter have

Type:

int

property losses

Amount of losses the fighter have

Type:

int

property draws

Amount of draws the fighter have

Type:

int

property weight

The weight the fighter likes to compete at

Type:

float

property hometown

The hometown of the fighter

Type:

str

property activity

The activity of the fighter

Type:

str

property image_url

A image of the fighter

Type:

str

property height_in_inch

The fighter’s height in inches

Type:

Optional[float]

property height_in_feet

The fighter’s height in feet

Type:

Optional[str]

property reach

The reach of the fighter

Type:

Optional[str]

property leg_reach

str: The leg reach of the fighter

Type:

Optional[

Type:

class]

property octagon_debut

str]: The date of when the fighter first fought in the UFC octagon

Type:

Optional[

Type:

class

property trains_at

str]: The gym the UFC fighter currently trains out of

Type:

Optional[

Type:

class

property striking_accuracy

The striking accuracy percentage in the UFC career of the fighter

Type:

int

property significant_strikes_landed

The significant strikes landed in the UFC career of the fighter

Type:

int

property significant_strikes_attempted

The significant strikes attemped in the UFC career of the fighter

Type:

int

property takedown_accuracy

The takedown accuracy percentage in the UFC career of the fighter

Type:

int

property landed_takedowns

The takedowns landed in the UFC career of the fighter

Type:

Optional[int]

property attempted_takedowns

The takedowns attempted in the UFC career of the fighter

Type:

Optional[str]

property wins_by_ko

The amount of the knockout wins the fighter has in the UFC

Type:

int

property wins_by_ko_percentage

The percentage of the knockout wins the fighter has in the UFC

Type:

int

property wins_by_sub

The amount of the submission wins the fighter has in the UFC

Type:

int

property wins_by_sub_percentage

The percentage of the submission wins the fighter has in the UFC

Type:

int

property wins_by_dec

The amount of the decision wins the fighter has in the UFC

Type:

int

property wins_by_dec_percentage

The percentage of the decision wins the fighter has in the UFC

Type:

int

property sig_str_landed_min

The amount of signfication strikes the figher lands per minute

Type:

float

property sig_str_absorbed_min

The amount of signfication strikes the figher absorbs per minute

Type:

float

property takedown_avg

The average amount of takedowns the figher lands per fight

Type:

float

property submission_avg

The average amount of submissions the figher lands per fight

Type:

float

property sig_str_defense

The percentage of signfication strikes the figher defends against in whole UFC career

Type:

int

property takedown_defense

The percentage of takedowns the figher defends against in whole UFC career

Type:

int

property knockdown_avg

The amount of knockdowns the figher lands per a 15 minute window

Type:

float

property average_fight_time

The average amount of time the fighter spends in octagon per fight

Type:

str

property sig_str_via_standing

The amount of significant strikes the fighter has thrown in a standing position

Type:

int

property sig_str_percentage_via_standing

The percentage of significant strikes the fighter has thrown in a standing position

Type:

int

property sig_str_via_clinch

The amount of significant strikes the fighter has thrown in a clinch position

Type:

int

property sig_str_percentage_via_clinch

The percentage of significant strikes the fighter has thrown in a clinch position

Type:

int

property sig_str_via_ground

The amount of significant strikes the fighter has thrown in a ground position

Type:

int

property sig_str_percentage_via_ground

The percentage of significant strikes the fighter has thrown in a ground position

Type:

int

property sig_str_to_head

The amount of significant strikes the fighter has thrown to the head

Type:

int

property sig_str_percentage_to_head

The percentage of significant strikes the fighter has thrown to the head

Type:

int

property sig_str_to_body

The amount of significant strikes the fighter has thrown to the body

Type:

int

property sig_str_percentage_to_body

The percentage of significant strikes the fighter has thrown to the body

Type:

int

property sig_str_to_leg

The amount of significant strikes the fighter has thrown to the leg

Type:

int

property sig_str_percentage_to_leg

The percentage of significant strikes the fighter has thrown to the leg

Type:

int

class ufcpy.Champion

Bases: object

all_names()

List[str]: All of the current champions names

all_objects()

List[Fighter]: All of the current champions in Fighter objects

property womens_strawweight

The current Women’s Strawweight champion

Type:

Fighter

property womens_flyweight

The current Women’s Flyweight champion

Type:

Fighter

property womens_bantamweight

The current Women’s Bantamweight champion

Type:

Fighter

property womens_featherweight

The current Women’s Featherweight champion

Type:

Fighter

property flyweight

The current Flyweight champion

Type:

Fighter

property bantamweight

The current Bantamweight champion

Type:

Fighter

property featherweight

The current Featherweight champion

Type:

Fighter

property lightweight

The current Lightweight champion

Type:

Fighter

property welterweight

The current Welterweight champion

Type:

Fighter

property middleweight

The current Middleweight champion

Type:

Fighter

property lightheavyweight

The current Light Heavyweight champion

Type:

Fighter

property heavyweight

The current Heavyweight champion

Type:

Fighter

Exception Classes

class ufcpy.UFCPyError(msg)