Security News
Introducing the Socket Python SDK
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
UFC API is a lightweight web crawler built in Python to retrieve data on UFC fighters and events.
You can install UFC API using pip:
pip install ufc_api
Usage is simple. To get stats on a particular fighter returned as a json:
>>> from ufc-api import get_fighter
>>> get_fighter('Jon Jones')
>>> {'name': 'Jon Jones',
'nickname': 'Bones',
'nationality': 'United States',
'birthplace': 'Rochester, New York',
'birthdate': 'Jul 19, 1987',
'age': '35',
'height': '6\'4"',
'weight': '248 lbs',
'association': 'Jackson-Wink MMA',
'weight_class': 'Heavyweight',
'wins': {'total': '27',
'ko/tko': '10',
'submissions': '7',
'decisions': '10',
'others': '0'},
'losses': {'total': '1',
'ko/tko': '0',
'submissions': '0',
'decisions': '0',
'others': '1'},
'fights': [{'name': 'UFC 285 - Jones vs. Gane',
'date': 'Mar / 04 / 2023',
'url': 'https://www.sherdog.com/events/UFC-285-Jones-vs-Gane-95232',
'result': 'win',
'method': 'Submission (Guillotine Choke)',
'referee': 'Marc Goddard',
'round': '1',
'time': '2:04',
'opponent': 'Ciryl Gane'},
...
To get data on an event, the usage is similar:
>>> from ufc-api import get_event
>>> get_event('UFC 280')
>>> {'name': 'UFC 280: Oliveira vs. Makhachev',
'date': '2022-10-22',
'location': 'Yas Island/Yas West United Arab Emirates',
'venue': 'Etihad Arena',
'fights': [{'weightclass': 'Lightweight Title',
'red corner': {'name': 'Charles Oliveira',
'ranking': 'Unranked',
'odds': '+165',
'link': 'https://www.ufc.com/athlete/charles-oliveira',
'result': 'Loss'},
'blue corner': {'name': 'Islam Makhachev',
'ranking': 'Unranked',
'odds': '-195',
'link': 'https://www.ufc.com/athlete/islam-makhachev',
'result': 'Win'},
'round': '2',
'time': '3:16',
'method': 'Submission'},
{'weightclass': 'Bantamweight Title',
'red corner': {'name': 'Aljamain Sterling',
'ranking': 'Unranked',
'odds': '-175',
'link': 'https://www.ufc.com/athlete/aljamain-sterling',
'result': 'Win'},
'blue corner': {'name': 'TJ Dillashaw',
'ranking': 'Unranked',
'odds': '+150',
'link': 'https://www.ufc.com/athlete/tj-dillashaw',
'result': 'Loss'},
'round': '2',
'time': '3:44',
'method': 'KO/TKO'},
{'weightclass': 'Bantamweight',
'red corner': {'name': 'Petr Yan',
'ranking': 'Unranked',
'odds': '-275',
'link': 'https://www.ufc.com/athlete/petr-yan',
'result': 'Loss'},
'blue corner': {'name': "Sean O'Malley",
'ranking': 'Unranked',
'odds': '+230',
'link': 'https://www.ufc.com/athlete/sean-omalley',
'result': 'Win'},
'round': '3',
'time': '5:00',
'method': 'Decision - Split'},
...
FAQs
A web crawler and parser for data on UFC fighters and events
We found that ufc-api demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The initial version of the Socket Python SDK is now on PyPI, enabling developers to more easily interact with the Socket REST API in Python projects.
Security News
Floating dependency ranges in npm can introduce instability and security risks into your project by allowing unverified or incompatible versions to be installed automatically, leading to unpredictable behavior and potential conflicts.
Security News
A new Rust RFC proposes "Trusted Publishing" for Crates.io, introducing short-lived access tokens via OIDC to improve security and reduce risks associated with long-lived API tokens.