Skip to main content
Pre-release

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

BioReqs: Bioinformatic Requisitions

PyPI Python Version License

bioreqs is a Python library that defines lightweight client interfaces for a number of publicly accessible, bioinformatics-focused web APIs, including those from organizations like the National Center for Biotechnology Information (NCBI). In so doing, it provides users with programmatic access to essential bioinformatics data without also requiring them to have an overt familiarity with their underlying API schemata.

Quick Start

If you're using a dependency manager like uv or poetry and plan to invoke bioreqs clients from within a project context, simply add it to your pyproject.toml dependency list:

  • poetry: poetry add bioreqs
  • uv: uv add bioreqs

On the other hand, if you're using vanilla pip but still want to work out of a virtual environment (as you should!), do:

python -m venv rqenv           # Create a new virtual environment named `rqenv`.
source ./rqenv/bin/activate    # Activate the `rqenv` virtual environment.
pip install --upgrade pip      # Upgrade to the latest version of `pip`.
pip install bioreqs       # Install the `bioreqs` package.

Finally, if you only want to use it interactively — or in a script meant to be invoked by your system-level Python interpreter — you can simply do:

# Assuming the system-level `pip` binary is in your `PATH` environment variable:
pip install --upgrade pip      # Upgrade to the latest version of `pip`.
pip install bioreqs       # Install the library system-wide.

Each of the package's modules corresponds to an individual organization and implements the relevant API client(s) for that organization. As a convenience, all clients are also surfaced at the package level, making them directly available in the bioreqs namespace. Thus, for example, to initialize a client object for the NCBI's popular Entrez E-utilities web API, the following code suffices:

# Import the Entrez E-utilities API client.
# from bioreqs.ncbi import Entrez
#
# Or, equivalently:
from bioreqs import Entrez

# Initialize the client, providing a valid email address, as required.
client = Entrez("email@example.com")

Clients

Presently, bioreqs provides only the above introduced client for the Entrez E-utilities web API, but it will hopefully tout a much more robust client library soon enough.

Entrez E-utilities (NCBI)

Use bioreqs.ncbi.Entrez and its instance methods to interact with the E-utilities web API. Since the NCBI requires one to include their email address when querying these endpoints, you should call Entrez with yours as the first argument. Alternatively, you can set your system's NCBI_EMAIL environment variable to store your email address; Entrez automatically detects it.

from bioreqs import Entrez

# Assuming the `NCBI_EMAIL` environment variable is set to your email address,
# this is a valid invocation of the `Entrez` constructor.
client = Entrez()

After creating and storing an instance of the API client (client, in the example above), you call instance methods on that object to query specific endpoints:

# Get the RefSeq for human COL5A2 as a FASTA-formatted string via its accession.
COL5A2_ACCESSION = "NM_000393.5"
COL5A2_REFERENCE = client.get_refseq(COL5A2_ACCESSION)
print(COL5A2_REFERENCE)  # Print the FASTA output.

# Download the FASTA-formatted RefSeq data for human kallikrein-related
# peptidase 15 via its accession, and write it to disk, storing the returned
# output path, if successful.
KLK15_ACCESSION = "NM_001277081.2"
ouput_path = client.save_refseq(KLK15_ACCESSION)

Metadata

Release files for bioreqs 0.1.0.dev3

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

Source distribution (sdist)

Source distribution for bioreqs 0.1.0.dev3
File Size Uploaded Provenance Actions
bioreqs-0.1.0.dev3.tar.gz 5.5 kB Without provenance Details for bioreqs-0.1.0.dev3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bioreqs 0.1.0.dev3
File Interpreter ABI Platform Actions
bioreqs-0.1.0.dev3-py3-none-any.whl Python 3 none any Details for bioreqs-0.1.0.dev3-py3-none-any.whl

Total release size: 12.1 kB

Release files / bioreqs-0.1.0.dev3.tar.gz

Download URL bioreqs-0.1.0.dev3.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
63d41b4c3d2c846565b4e4a239b9dfbc16d7bb0600d13f72f9817a53ad858d0d
BLAKE2b-256 checksum
How to use checksums
84ba77300427805603e4a93c13ed7ed69f1474624632584802dca4ae0dd8b6fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / bioreqs-0.1.0.dev3-py3-none-any.whl

Download URL bioreqs-0.1.0.dev3-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f619163056bbc78510000a2ce22d553ffd1433be854e6269590f5036b8adf487
BLAKE2b-256 checksum
How to use checksums
a792ed1493a6bc1d55bb498ad06dbc6440f1abb467ec08e9bf12d0b22b8ca04e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Amazon Linux","version":"2023","id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bioreqs 0.1.0.dev3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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