Skip to main content

FIFA member associations codes query and search.

Project description

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.

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

fifacodes-0.1.4.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

fifacodes-0.1.4-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file fifacodes-0.1.4.tar.gz.

File metadata

  • Download URL: fifacodes-0.1.4.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.0 Linux/6.5.0-1016-azure

File hashes

Hashes for fifacodes-0.1.4.tar.gz
Algorithm Hash digest
SHA256 922af8b75aff3dc1d11879c53f4c64e5dfd26b38f99ed5dc311d33da19913839
MD5 22dc36e46deea6ff35829a696b6454d5
BLAKE2b-256 c76842b83328af8d36644eb4b7bda010383115c164cc881d8d58947e3b821a8d

See more details on using hashes here.

File details

Details for the file fifacodes-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: fifacodes-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 6.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.11.0 Linux/6.5.0-1016-azure

File hashes

Hashes for fifacodes-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7d4ced2d95ea87acb0458d8dfd99b94e89f2b844efc77c15a668b878959c0dd8
MD5 a4fb49f40dea5a7727da2e3db9ef0fad
BLAKE2b-256 726f11e7e81ed93df2080bb60e25607e9dc383da6087a3f09041d80ba53d3db9

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