Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

django-ixp-tracker

PyPI Tests Changelog License

Library to retrieve and manipulate data about IXPs

Installation

Install this library using pip:

pip install django-ixp-tracker

Usage

  1. Add to your INSTALLED_APPS setting like this:
   INSTALLED_APPS = [
   ...,
   "ixp_tracker",
   ]

Note: this app has no web-facing components so you don't need to add anything to urls.py etc

  1. Run python manage.py migrate to create the models.
  2. Add the relevant settings to your config. IXP_TRACKER_PEERING_DB_URL will use a default if you don't provide a value so you probably don't need that. But you will need to set IXP_TRACKER_PEERING_DB_KEY to authenticate against the API.
  3. Add IXP_TRACKER_DATA_LOOKUP_FACTORY to config with the path to your factory (see below).
  4. Run the management command to import the data: python manage.py ixp_tracker_import (This will sync the current data, if you want historical data you need to backfill first)

ASN country and status data

The lib uses an external component to look up the country of registration (why?) and the status of an ASN. This status is used for the logic to identify when members have left an IXP.

If you don't provide this service yourself, it will default to a noop version. This will mean you will get no country of registration data and the marking of members having left an IXP will not be as efficient.

In order to implement such a component yourself, you should implement the Protocol ixp_tracker.data_lookup.AdditionalDataSources and provide a factory function for your class.

Backfilling data

You have the option of backfilling data from archived PeeringDb data. This can be done by running the import command with the --backfill option for each month you want to backfill:

python manage.py ixp_tracker_import --backfill <YYYMM>

The backfill currently process a single month at a time and will look for the earliest file for the relevant month at https://publicdata.caida.org/datasets/peeringdb/

IMPORTANT NOTE: due to the way the code tries to figure out when a member left an IXP, you should run the backfill strictly in date order and before syncing the current data.

IXP stats

The import process also generates monthly stats per IXP and per country. These are generated as of the 1st of the month used to import the data.

Running programmatically

If you'd like to run the import from code, rather than from the management command, you can call importers.import_data() and stats.generate_stats() directly.

It's not recommended to call any other functions yourself.

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd django-ixp-tracker
python -m venv .venv
source .venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

We use pre-commit for linting etc on push. Run:

pre-commit install

from the repo top-level dir to set it up.

Releases

For now, releasing a new version is manual and can be done by running the following commands from the repo:

python -m build
python -m twine upload --repository pypi dist/*

Peering Db libraries

PeeringDb provide their own vanilla Python and Django libs, but we have decided not to use these.

Both libs are designed to keep a local copy of the current data and to keep that copy in sync with the central copy via the API.

As we need to keep a historical record (e.g. for IXP growth stats over time), we would have to provide some sort of wrapper over those libs anyway.

In addition to that, the historical archives of PeeringDb data use flat lists of the different object types in json. We can retrieve the data from the API directly in the same way, so it makes it simpler to implement.

Metadata

Release files for django-ixp-tracker 2rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-ixp-tracker 2rc1
File Size Uploaded
django_ixp_tracker-2rc1.tar.gz 50.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-ixp-tracker 2rc1
File Interpreter ABI Platform
django_ixp_tracker-2rc1-py3-none-any.whl Python 3 none any Details

Total release size: 100.3 kB

Release files / django_ixp_tracker-2rc1.tar.gz

Download URL django_ixp_tracker-2rc1.tar.gz
Size 50.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bcb01816a612d4fe7743b3f5c135ec1d7eae4ea0d4533653273f4450b1c23c57
BLAKE2b-256 checksum
How to use checksums
455fff161bad3f47c2b807135199a3802a27dca738c7b667b1a9b60e0de6377c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / django_ixp_tracker-2rc1-py3-none-any.whl

Download URL django_ixp_tracker-2rc1-py3-none-any.whl
Size 49.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa3190df5753cf595964291f0080f009bcef905a4fb00c9dcd5640a23e5bfef4
BLAKE2b-256 checksum
How to use checksums
04f730b4e3256c625760e970d03ac3e8361772fa8a227b3a20130fb53803cbb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

3.2.0

2 release files

3.1.0

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.0

2 release files

This release

2rc1 This release

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.15

2 release files

0.14

2 release files

0.13

2 release files

0.12

2 release files

0.11

2 release files

0.10

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page