Endangered Species Tracker is a Python tool that provides real-time information on endangered species around the world using the IUCN Red List API. It allows users to search for species and retrieve data on their conservation status, population trends, and habitat.
This project is part of Hacktoberfest 2024, encouraging contributors to enhance the platform and raise awareness about endangered species.
- Track endangered species with real-time data from the IUCN Red List API.
- Provide information on species conservation status, population trends, and habitats.
- Foster open-source collaboration during Hacktoberfest 2024.
- Python developers (beginner to intermediate).
- Environmental and conservation enthusiasts.
- Hacktoberfest participants interested in contributing to a meaningful cause.
- Search for species by name.
- Display species' conservation status (e.g., Vulnerable, Endangered).
- Show population trends and habitat information.
- Fetch real-time data from the IUCN Red List API.
- Python 3.7 or higher
- Basic knowledge of APIs and JSON
Install the required dependencies:
pip install -r requirements.txt
For testing, install pytest
:
pip install pytest
- Get a free API key from the IUCN Red List website.
- Create a
.env
file in the project root and add your API key:
IUCN_API_KEY=your-api-key-here
- Clone the repository:
git clone https://github.com/pycon-rwanda/Endangered-Species-Tracker
cd Endangered-Species-Tracker
- Run the tracker:
python tracker.py
Search for a species:
Enter species name: Panthera leo
Example output:
Conservation Status: Vulnerable
Population Trend: Decreasing
Habitat: Savannas, grasslands, forests
Contributions are welcome! Please refer to the CONTRIBUTING.md file for guidelines on how to get involved.
This project uses the IUCN Red List API. To retrieve species data, make a request as shown below:
import requests
from decouple import config
from dotenv import load_dotenv
load_dotenv()
API_KEY = config("IUCN_API_KEY")
species_name = 'Panthera leo'
url = f'https://apiv3.iucnredlist.org/api/v3/species/{species_name}?token={API_KEY}'
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(data)
else:
print("Error: Unable to fetch data.")
endangered-species-tracker/
│
├── tracker.py # Main script
├── README.md # Project documentation
├── CONTRIBUTING.md # Contribution guidelines
├── requirements.txt # Python dependencies
├── .env.example # API key placeholder
└── tests/ # Unit tests
This project is licensed under the MIT License. See the LICENSE file for details.