Etienne Benson

polar bears in the federal register

14 February 2011 - comments (0)

Polar Bear Feed

What it is: An automatically updated chronological list of U.S. Federal Register items that mention polar bears from 1994 to the present. It also provides dynamically generated visualizations of data, including charts of permit applications for imports of polar bear trophies from Canada between 1997 and 2008.

How it works: The application builds a local database by using the Federal Register 2.0 API to search for the terms “polar bear” or “polar bears” in the full text of notices, rules, and other items in the Federal Register. It makes the results available over the web as a browsable list, as an RSS feed, and as a detail view of each item, and it dynamically generates charts and maps based on the local database.

What it’s good for: Environmentalists, animal protectionists, trophy hunters, and others can use the feed to easily keep track U.S. federal government actions relating to polar bears, including the drafting of new rules and regulations and the issuance of permits.

Some background: Polar bears have been a hot topic lately, and it’s not just because of Knut, may he rest in peace. Ursus maritimus is one of the species that has come to symbolize the threat of global climate change. In the United States, that means controversy. In 2008, the U.S. Fish and Wildlife Service took the historic step of listing the polar bear as “threatened” under the Endangered Species Act of 1973 because of the likelihood that global warming would lead to shrinking habitats for the species — specifically, less ice. The decision was highly contested and remains so.

One of the most immediate consequences of the ESA listing was the end of a program under which American hunters had been allowed to import trophies of polar bears killed in Canada. Killing polar bears for sport and importing polar bear parts for personal use (e.g., as trophies) had been illegal in the United States since 1972, when the species was protected by the Marine Mammal Protection Act, an important predecessor of the ESA. (Alaska Natives were still free to kill bears under certain conditions.) In Canada, in contrast, where the majority of the world’s polar bears reside, hunting had been regulated but legal. Amendments to the MMPA in 1994 opened up a loophole allowing American hunters to bring back their prizes. Advocates of the measure argued that Canada’s polar bear population was large and well-managed, and that license and guide fees would help support arctic communities and polar bear conservation.

The 2008 “threatened” listing shut the door on trophy imports, including the import of parts from bears who had already been killed by American hunters. Ever since, the Safari Club International, the Boone and Crockett Club, the National Rifle Association, and other hunting advocates have been trying to roll back the decision, or at least to allow trophies from animals that had been killed before the listing to be imported, while the Natural Resources Defense Council, the Humane Society of the United States, and other environmental and animal welfare/rights groups have defended the ban on importation. Recent court decisions have supported the ban, but it’s likely that the issue will continue to be controversial as long as trophy hunting of polar bears is legal in Canada.

It thus seems like an opportune time to revisit the history of federal protections for polar bears in the United States. Fortunately, there’s a new tool that makes it easier than ever before to get at some of the crucial primary sources: namely, all of the material about federal regulatory actions — including information about every single permit issued to an American trophy hunter under the import program — that has been published in the Federal Register since it first went electronic in 1994.

Federal Register 2.0, as it’s called, has a nice web interface for casually browsing or searching, but — even more importantly from the standpoint of open government — it also opens up an Application Programming Interface (API) to anyone who wants to write his or her own app using its data.

I’ve taken advantage of FR2.0 API to create a tool that automatically grabs all Federal Register items that mention polar bears, displays them in a nicely formatted list, lets you browse forward and backward in time, and links back to the full text on the official Federal Register site. To check out the Polar Bear Feed in a new tab or window, click here.  The app also exposes an RSS feed here, to be subscribed to with Google Reader or your favorite feed reader. And there’s a dynamically generated chart of the number of polar-bear-related Federal Register items per year from 1994 to the present  and a map of trophy import permit applications.  This is all, I hasten to add, experimental and liable to break at any time.

At the moment the Polar Bear Feed is quite rudimentary, but eventually it or something like it could offer a much richer functionality  — including, for example, links to other related content, more tools for analysis, mapping, and visualization, or opportunities for annotation and discussion. In the meantime it serves as a kind of proof of concept, with a few small bells and whistles. I suspect this kind of tool will become increasingly important for both scholars and citizens as more and more government data not only goes digital but also goes open, i.e., easily accessible for downloading and re-presenting according to open standards.

The technical details: The app builds a local database of polar bear-related FR notices, which is updated somewhat intelligently every time the page is loaded; i.e., it only searches for new items and checks to make sure it’s not creating duplicates in the local database. (One consequence is that if new items were to be added to the FR source with earlier publication dates than the latest item in the database, the app wouldn’t find them. This isn’t supposed to happen.) It was written with the Django web application framework, which is based on the Python language. Version control is managed with git and GitHub. In the spirit of FLOSS, the code can be viewed and downloaded here. Deployment is through Heroku, using virtualenv and pip to establish the Django/Python environment, South to handle database migrations, and git to push the code up to the Heroku servers. The database backend is Postgres. Charts are generated using Google Chart API, with request URLs generated either manually or with the help of pygooglechart. A tiny bit of client-side JavaScript with the jQuery library is used to hide/show data on the trophy page. The local development platform is Ubuntu Linux 11.10. If you’re developing with Ruby on Rails, the FR2.0 team has made things easier by providing an API available as the federal_register gem.