Installation

Installation

Requirements

  • Python 3.8 or higher
  • Internet connection for accessing swimrankings.net

Install from PyPI

pip install swimrankings

Install from Source

If you want to install the latest development version:

# Clone the repository
git clone https://github.com/MauroDruwel/Swimrankings.git
cd Swimrankings
 
# Install in development mode
pip install -e .

Development Installation

For development work, install with development dependencies:

# Clone the repository
git clone https://github.com/MauroDruwel/Swimrankings.git
cd Swimrankings
 
# Install development dependencies
pip install -r requirements-dev.txt
 
# Install in development mode
pip install -e .

Verify Installation

To verify that the installation was successful, try importing the library:

from swimrankings import Athletes
 
# Test with a simple search
try:
    athletes = Athletes(name="Test")
    print("✅ SwimRankings library installed successfully!")
except Exception as e:
    print(f"❌ Installation issue: {e}")

Dependencies

The library requires the following packages:

  • requests: For HTTP requests to swimrankings.net
  • beautifulsoup4: For HTML parsing
  • lxml: Fast XML/HTML parser

These are automatically installed when you install the library.

Troubleshooting

Import Errors

If you get import errors, make sure you've installed the library correctly:

pip show swimrankings

Network Issues

The library requires internet access to fetch data from swimrankings.net. If you're behind a corporate firewall, you may need to configure proxy settings:

import requests
 
# Configure proxy if needed
proxies = {
    'http': 'http://your-proxy:port',
    'https': 'https://your-proxy:port'
}
 
# The library doesn't currently support proxy configuration directly
# You may need to set environment variables

Python Version Issues

Make sure you're using Python 3.8 or higher:

python --version

If you have multiple Python versions installed, you might need to use python3 or pip3 instead.