bird-colony is a Django application the Meliza Lab uses to manage its zebra finch colony and keep breeding records. You may find it useful, even if you work with non-avian species.
Features:
- Animals have globally unique identifiers and can optionally have colored and numbered leg bands (one band per animal). This means they keep their identities even if you have to reband them.
- Record events over the lifespan of each animal, from egg to grave. Events can be linked to locations, so you can find where an animal is or was on a certain date. Events can also be linked to measurements like weight so you can track these over time or use them to make breeding decisions.
- Track pairings, pedigrees, and breeding success statistics. You can export a complete pedigree for all living birds in the colony and compute relatedness using external software like the R pedigree package.
- Useful forms for entering data, including periodic nest checks. Easy to track when eggs are laid and hatch and associate them with the correct parents.
- Associate biological samples with animals and track their physical location.
You’ll need to have a basic understanding of how to use
Django. bird-colony is licensed
for you to use under the BSD License. See COPYING for details
- Requires Python 3.10+. Runs on Django 4.2 LTS and 5.2 LTS.
- Install the package using pip:
pip install django-bird-colony. - Add
birdsand some dependencies to your INSTALLED_APPS setting like this:
INSTALLED_APPS = (
...
'widget_tweaks', # For form tweaking
'rest_framework',
'django_filters',
'fullurl',
'birds',
)- Include birds in
urlpatternsin your projecturls.py. Some of the views link to the admin interface, so make sure that is included, too:
path("birds/", include("birds.urls")),
path("admin/", admin.site.urls),- Run
python manage.py migrateto create the database tables. If this is a new django install, runpython migrate.py createsuperuserto create your admin user. - Run
python manage.py loaddata bird_colony_starter_kitto create some useful initial records. - Start the development server (
python manage.py runserver) and visit http://127.0.0.1:8000/admin/birds/ to set up your colony, as described in the next section. - Visit http://127.0.0.1:8000/birds/ to use views.
Make sure to consult the Django documentation on deployment if you are at all concerned about security.
This is a work in progress. Before you start entering birds and events, you need to set up some tables using the Django admin app.
- Edit species records in the
Speciestable. Thebird_colony_starter_kitfixture will create a record for zebra finches. Thecodefield is used to give animals their names, so if you have zebra finches and usezebfas your code, your birds will be namedzebf_red_1and so forth. - Edit and add locations to the
Locationstable. You need to have at least one location created. The main use for this field is to allow you to find where a bird is by looking at the last event. - Edit and create new event types in the
Status codestable. Common event types includelaid,hatched,added,moved,died,used for anatomy, etc. For each status code, indicate whether it adds or removes a bird from the colony. Addition event types include eggs being laid, births, and transfers, which are handled differently. Removal event types include expected and unexpected deaths. Unexpected deaths are important to tabulate when looking at family history and breeding success. When you create an event that removes a bird, it will appear as no longer alive. Thehatchedevent is special, because if you add a bird to the database using theAdd new birdview using this code, the system will require you to enter the bird’s parents. (If you don’t know the bird’s parents, you can always create it manually in the admin interface)
- If your bands are colored, add your colors to the
Colorstable. This will affect the short name for your animals. - If you’re going to be adding samples to the databse, add or edit
Sample locationsandSample typesin the admin interface. - Add additional users to the database. This is particularly useful if you want to allow specific users to reserve animals.
- If you want to change some of the boilerplate text on the entry
forms, you’ll need to install the app from source. The templates are
found under
birds/templates/birdsin the source directory.
Recommend using uv for development.
Run uv sync to create a virtual environment and install
dependencies. uv sync --no-dev --frozen for deployment.
Testing: uv run pytest. Requires a test database, will use settings
from inventory/test/settings.py.
In the 0.4.0 release, the primary key for animal records became the animal’s uuid. To migrate from previous version, data must be exported as JSON under the 0.3.999 release and then imported under 0.4.0