https://github.com/manucabral/fifa-ranking
pyfifa | A easy-to-use wrapper lib for fetching fifa ranking and more
https://github.com/manucabral/fifa-ranking
fifa fifa-api fifaranking fifaworldcup fifawrapper football football-analytics football-data rankingfifa scraping scrapper
Last synced: 5 months ago
JSON representation
pyfifa | A easy-to-use wrapper lib for fetching fifa ranking and more
- Host: GitHub
- URL: https://github.com/manucabral/fifa-ranking
- Owner: manucabral
- License: mit
- Created: 2023-12-02T21:21:29.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-21T20:25:32.000Z (almost 2 years ago)
- Last Synced: 2025-01-30T23:41:19.391Z (over 1 year ago)
- Topics: fifa, fifa-api, fifaranking, fifaworldcup, fifawrapper, football, football-analytics, football-data, rankingfifa, scraping, scrapper
- Language: Python
- Homepage:
- Size: 32.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pyfifa
A lightweight and easy-to-use wrapper that allows you to extract data from FIFA.com and more.
### Installation
From PyPI
> No available.
From source code (clone it)
```bash
git clone https://github.com/manucabral/pyfifa.git
```
From GithubCLI
```bash
gh repo clone manucabral/pyfifa
```
### Usage
Using the ranking.
```py
import pyfifa
ranking = pyfifa.Ranking()
for item in ranking.items():
print(item.rank, item.name)
```
Extra: change lang and limit items.
```py
ranking = pyfifa.Ranking(lang="fr", limit=5)
```
Exporting (json or csv)
```py
ranking.export(extension="json", filename="ranking")
```
Fetching ranking ids.
```py
import pyfifa
for rankingId in pyfifa.ranking_ids():
print("ID", rankingId.value, "Date", rankingId.date)
```
Fetching a certain ranking id.
```py
import pyfifa
rankingIds = pyfifa.ranking_ids()
# Get the first FIFA ranking id
lastRankingId = rankingIds[-1]
ranking = pyfifa.Ranking(id=lastRankingId)
```
### Constributions
All constributions, bug reports or fixes and ideas are welcome.