Skip to content

apsalverda/ebird-hotspot-menu-bar-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

eBird recent hotspot observations

Introduction

This script uses your eBird API key and the location code for a specific hotspot to display a list of recent observations.

The output is nicely formatted to include total species count, total count for today, total count prior to today, and checklist timestamps.

To make the app work for your hotspot of choice, you'll need to edit the constants EBIRD_LOCATION and EBIRD_LOCATION_NAME in the file main.py. See comments in that file for help finding the location code for your favorite hotspot.

macOS menu bar

The script's output can easily be turned into a macOS menu bar icon using Platypus. This allows you to quickly check live, recent observations for your favorite hotspot straight from the menu bar. See detailed instructions for creating the macOS app underneath the screenshot below.

Screenshot

desktop-screenshot-smaller

Creating the macOS menu bar app

Follow these instructions to create the menu bar app. Feel free to reach out if you need help.

1. Create a virtual environment with the required Python packages

  1. Make sure you have cloned or downloaded the repo on your machine
  2. Open the Terminal application, then navigate to the repo folder
  3. Execute these commands in the repo folder to create a virtual environment with the required Python packages
python -m venv .venv
source .venv/bin/activate
pip install requests keyring
  1. (Optional) Check to make sure the packages have been installed
pip list

2. Download and install Platypus

  1. Download and install Platypus, developed by Sveinbjorn Thordarson
  2. Open Platypus

3. Create the macOS menu bar app using Platypus

  1. Choose an App Name (for instance, "eBird BYT")
  2. Under Script Path, click button Select Script
  3. Navigate to and select the file "main.py" in the repo folder on your machine
  4. Copy the information you now see for Script Path and paste it into the empty box next to Script Type
  5. At the end of the string, remove "main.py" and replace it with ".venv/bin/python"
  6. In the dropdown menu for Interface, select "Stats Menu"
  7. Click on Status Item Settings (also in the Interface section)
  8. Set Status Item to "Icon"
  9. Next to the icon, click Select
  10. Select the file "feather.svg" in the repo folder
  11. Click Apply
  12. Click Create App
  13. Enter a name for your App and select Create to save it.

Below is just an example of what the relevant information looks like on my machine. You will need to fill out different information, specific to your machine.

image

You can now open the app and should see the feather icon appear in your menu bar.

Adding your eBird API key to the macOS keychain

1. Obtain your eBird API key

Navigate to this page to create or obtain your personal eBird API key.

2. Store youre eBird API key

For the app to work, you will need to store your eBird API Key as a password item named ebird-api-key in your macOS keychain. You can do this in two ways:

Option 1: Using the Keychain Access app

  1. Open the Keychain Access app on your Mac
  2. Create a new password item named ebird-api-key
  3. Enter your eBird API key as the password

Option 2: Using Python

Run this command in Python, after replacing the placeholders your_mac_username with your macOS username, and your_ebird_api_key with your eBird API key.

import keyring
keyring.set_password("ebird-api-key", your_mac_username, your_ebird_api_key)

About

🪶 Retrieve recent hotspot observations using eBird API

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages