Skip to main content

Dronefly Miner

This library supports fast local taxon name searches against a database built from iNaturalist DWC-A exports using pyinaturalist-convert.

It is used by Dronefly bot to support taxon name autocompletion.

By using a local database instead of the iNaturalist API, Dronefly bot is able to keep up with moderate to heavy demand without exceeding iNat API rate limits.

Requirements

  • Sufficient disk space for the files, about 300GB total if you perform full builds (highly recommended):
    • ~/.local/share/pyinaturalist/*
      • ~250GB iNaturalist DWC-A export files & derived work files
    • ~/.local/share/dronefly-miner/observations.db
      • ~50GB database built from those files
  • A full build takes a few hours on the developer's system, whereas a regular build takes minutes.
    • System: Ryzen 7 255, 32GB ram, and nvme ssd
    • Network: 1Gbps residential FTH

Build the database

  1. Install uv from https://docs.astral.sh/uv
  2. Perform an initial full run of the database with:
uvx run dronefly-miner build --full

Confirm that the build is successful and restart the bot to test autocompletion with /taxon show taxon:. Upon first use, the results may be empty. Once the database connection is primed, autocompletions should be fairly quick.

Schedule the database updates

Frequency of database updates is up to you. Consider the following:

  • Files for either data set will only be downloaded if newer versions are available.
  • The iNaturalist taxonomy DWC-A archive is updated monthly.
    • This fairly small data set that loads quickly and should not interrupt bot functions while loading.
  • The iNaturalist observations DWC-A archive is updated weekly.
    • This is a massive data set that takes a long time to load and disrupts autocompletions while loading.

In order to update the taxonomy as soon as iNaturalist publishes a new data set, but without minimal disruption to users, we recommend nightly builds without --full:

uvx dronefly-miner build

The more costly full build should be performed at most weekly, and monthly is probably sufficient:

uvx dronefly-miner build --full

Full builds can be skipped entirely, but relevance ranking will suffer. A compromise that might work for you is to schedule less frequent full builds, or leave it as a manual step on an as-needed basis. Any new taxa added to the taxonomy will be downranked in the results without updates to the aggregated observation counts, but for the most part, relevance won't suffer much from working off of outdated observation counts.

Database updates place a lot of demand on CPU. To give other processes on the system during database updates, reduce priority, e.g.

nice -n 19 uvx dronefly-miner build --full

Example scheduled job configuration

Dronefly runs on the redbot account. The taxonomy is updated at midnight nightly, and the observation counts are updated at half past midnight monthly:

$ crontab -l
# m h dom mon dow   command
  0 0   *   *   1   /bin/nice -n 19 /home/redbot/.local/bin/uvx dronefly-miner build
 30 0   1   *   *   /bin/nice -n 19 /home/redbot/.local/bin/uvx dronefly-miner build --full

Metadata

Release files for dronefly-miner 0.2.0

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

Source distribution (sdist)

Source distribution for dronefly-miner 0.2.0
File Size Uploaded
dronefly_miner-0.2.0.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dronefly-miner 0.2.0
File Interpreter ABI Platform
dronefly_miner-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.1 kB

Release files / dronefly_miner-0.2.0.tar.gz

Download URL dronefly_miner-0.2.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
9d8e5a4e02f886b465bd0364eadb50dd05a77e08c4d36ed8457b4486ccd30286
BLAKE2b-256 checksum
How to use checksums
49dd57fd5dfd5847619f55242cef4281060ee8de51d4e62a6236639e2df2ff2f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / dronefly_miner-0.2.0-py3-none-any.whl

Download URL dronefly_miner-0.2.0-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ccfa3e17af108d30c068e379b898a1e6992e8be93affaa8bb8520a8dc74a36a6
BLAKE2b-256 checksum
How to use checksums
719c2e72b94db0a803aae2748ef3bf3fe963881502d226913b558826ed3586a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.29 {"installer":{"name":"uv","version":"0.11.29","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

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