Skip to main content

fifacodes

FIFA member associations codes query and search.

A mapping of FIFA member associations codes to member associations names.

The default data is sourced from Wikipedia.

Installation

pip install fifacodes

Usage

You can query like using dict:

>>> from fifacodes import Members
>>> members = Members()
>>> members.get('ENG')
Member(code='ENG', name='England')
>>> len(members)
211
>>> list(members.items())[0]
('AFG', Member(code='AFG', name='Afghanistan'))

Query by name:

>>> members['England']
Member(code='ENG', name='England')

Search for a member by name or code, the search uses fuzzy string matching to find potential results.

>>> members.search('argtl')
[Member(code='ARG', name='Argentina'), Member(code='ARM', name='Armenia'), Member(code='ARU', name='Aruba')]

Results can be adjusted using parameters:

>>> members.search('Fran', limit=2, score_cutoff=70, case_sensitive=True)
[Member(code='FRA', name='France'), Member(code='IRN', name='Iran')]

Search for a member by name or code and return the first result.

>>> members.search_one('Argent')
Member(code='ARG', name='Argentina')

Data Update

To update default.csv run scrape.py, If there are codes corresponding to other member names, add them to custom.csv.

View source code for detailed usage.

Metadata

Release files for fifacodes 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fifacodes 0.1.4
File Size Uploaded
fifacodes-0.1.4.tar.gz 5.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fifacodes 0.1.4
File Interpreter ABI Platform
fifacodes-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 11.5 kB

Release files / fifacodes-0.1.4.tar.gz

Download URL fifacodes-0.1.4.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
922af8b75aff3dc1d11879c53f4c64e5dfd26b38f99ed5dc311d33da19913839
BLAKE2b-256 checksum
How to use checksums
c76842b83328af8d36644eb4b7bda010383115c164cc881d8d58947e3b821a8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.0 Linux/6.5.0-1016-azure

Release files / fifacodes-0.1.4-py3-none-any.whl

Download URL fifacodes-0.1.4-py3-none-any.whl
Size 6.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7d4ced2d95ea87acb0458d8dfd99b94e89f2b844efc77c15a668b878959c0dd8
BLAKE2b-256 checksum
How to use checksums
726f11e7e81ed93df2080bb60e25607e9dc383da6087a3f09041d80ba53d3db9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.11.0 Linux/6.5.0-1016-azure

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page