Skip to main content

Unofficial Python client for downloading and exploring FlyBase datasets.

Project description

FlyBase Downloads (FBD)

FlyBase Downloads (FBD) is a lightweight Python library that provides programmatic access to selected datasets from FlyBase, allowing researchers to search, download, and load biological datasets directly into Python objects (e.g. pandas DataFrames) for analysis, exploration, and machine learning workflows.

Offline mode note: FBD can reuse previously downloaded datasets through its local cache when calling download_file(). Offline support currently applies only to cached dataset downloads, metadata and browsing features such as categories, search, descriptions, and column descriptions still require a network connection.

Important: This is an unofficial library.
All data is retrieved directly from FlyBase, and availability depends entirely on FlyBase’s public resources.


Purpose

This library is designed for:

  • Academic and educational use
  • Bioinformatics analysis
  • Data exploration in Jupyter notebooks
  • Machine learning and data science pipelines

It is not intended for high-frequency or automated bulk downloading.


Installation and Import

pip install flybasedownloads
from FBD.fbd import FBD

Basic Usage

List available categories

fbd = FBD()
categories = fbd.get_categories()
print(categories)

List datasets by category

fbd = FBD()
files_by_cat = fbd.get_files_by_category("Genes")
print(files_by_cat)

Search for a dataset (exact or partial match)

Exact match

fbd = FBD()
dataset = fbd.search_file("gene_genetic_interactions")
print("Selected dataset:", dataset)

Partial matches

fbd = FBD()
matches = fbd.search_file("gene")
print("Possible datasets:")
for m in matches:
    print("-", m)

Download datasets

Initialize with a dataset and download directly

fbd = FBD("gene_genetic_interactions")
df = fbd.download_file()

Download multiple datasets sequentially

fbd = FBD()
fbd.set_dataset("antibody_information")
df1 = fbd.download_file()
fbd.set_dataset("gene_genetic_interactions")
df2 = fbd.download_file()

Dataset metadata

Retrieve column descriptions

column_info = fbd.get_column_descriptions(
    columns=[
        "Starting_gene(s)_symbol",
        "Ending_gene(s)_symbol",
        "Interaction_type"
    ]
)
print(column_info)

Example: preparing data for ML

X = df[[
    "Starting_gene(s)_symbol",
    "Ending_gene(s)_symbol"
]]

y = df["Interaction_type"]

Rate limiting & responsible use

To protect shared infrastructure and respect FlyBase resources, downloads are rate-limited by default. -The download limit is enforced internally -The library is intended for academic use only -Bulk or automated scraping is strongly discouraged

Advanced users can modify the download limits via the Config class and config.json, but: We strongly ask users NOT to bypass rate limits, as this project does not have the infrastructure to support large-scale or abusive usage.

Data source & disclaimer

-All datasets are retrieved directly from FlyBase -This library is not affiliated with FlyBase -Dataset availability may change over time -Some datasets may become unavailable or updated without notice

If you need guaranteed access or bulk data, please use FlyBase’s official distribution channels. Official FlyBase Downloads Overview: FlyBase:Downloads_Overview


Citation

If you use this library in academic work, please cite FlyBase as the original data source.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flybasedownloads-4.1.2.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flybasedownloads-4.1.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file flybasedownloads-4.1.2.tar.gz.

File metadata

  • Download URL: flybasedownloads-4.1.2.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for flybasedownloads-4.1.2.tar.gz
Algorithm Hash digest
SHA256 b3da6d454056dfbafc2ba86cf4ca9db4d7a22ac4a834d2ee4564250770cfbc09
MD5 257f33c900916b6b697c8b666c35f4e9
BLAKE2b-256 6ec52784c6505cc4f425064e13a3a71c62bb64807ccf18b807faac672c9fff0b

See more details on using hashes here.

File details

Details for the file flybasedownloads-4.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for flybasedownloads-4.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 99528d7dd2206aced2831dc67c8cabd90af76b15a740613ca6e3943ccdef92d4
MD5 8bf9ea2dd347ac4c81bfbb1b60cb40bd
BLAKE2b-256 23bc51346c04fa05c9a4306b4513378a45d18964a66cc91170e942143e02c380

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page