Skip to main content

intermine314

CI PyPI version Python versions supported License: MIT

Modern InterMine client for Python 3.14+ with:

  • query execution (Service + Query)
  • parallel export with bounded memory (ParallelOptions)
  • ELT workflows to Parquet, DuckDB, and Polars (fetch_from_mine)
  • Tor-safe transport defaults (socks5h:// policy in strict Tor mode)

Repository: https://github.com/karikris/intermine314

Install

pip install intermine314

Optional extras:

pip install "intermine314[speed]"   # orjson
pip install "intermine314[proxy]"   # PySocks
pip install "intermine314[analytics]"   # Polars + DuckDB exports

Quick Start

from intermine314.service import Service

service = Service("https://maizemine.rnet.missouri.edu/maizemine/service")
query = service.select("Gene.primaryIdentifier", "Gene.symbol")

for row in query.rows(size=5):
    print(row)

Parallel export uses ParallelOptions only:

from intermine314.query.builder import ParallelOptions

query.to_parquet(
    "/tmp/genes_parts",
    batch_size=5000,
    parallel_options=ParallelOptions(
        max_workers=8,
        profile="large_query",
        ordered="unordered",
        inflight_limit=8,
        max_inflight_bytes_estimate=64 * 1024 * 1024,
    ),
)

API Migration Notes

Compatibility aliases were removed to keep the runtime API minimal and explicit:

  • service.query(...) -> use service.select(...)
  • Service.get_mine_info(...) -> use Registry(...).info(...)
  • Service.get_all_mines(...) -> use Registry(...).all_mines(...)
  • Query aliases removed: filter, add_column*, add_views, order_by, all, size, summarize, c Use canonical Query methods (where, add_view, add_sort_order, count, column).

Minimal high-level ELT workflow:

from intermine314 import fetch_from_mine

result = fetch_from_mine(
    mine_url="https://maizemine.rnet.missouri.edu/maizemine/service",
    root_class="Gene",
    views=["Gene.primaryIdentifier", "Gene.symbol"],
    parquet_path="/tmp/genes.parquet",
    page_size=2_000,
    max_workers=8,
    inflight_limit=8,
    max_inflight_bytes_estimate=64 * 1024 * 1024,
)

managed_result = fetch_from_mine(
    mine_url="https://maizemine.rnet.missouri.edu/maizemine/service",
    root_class="Gene",
    views=["Gene.primaryIdentifier", "Gene.symbol"],
    parquet_path="/tmp/genes.parquet",
    max_workers=8,
    managed=True,
)
with managed_result["duckdb_connection"] as con:
    count = con.execute(
        f'SELECT COUNT(*) FROM "{managed_result["duckdb_table"]}"'
    ).fetchone()[0]
    print(count)

Development

make lint
make test
make docs

Repository-only support directories:

  • docs/, samples/, and scripts/ are for development and examples.
  • They are intentionally excluded from published package artifacts.

Test Modes

Default pytest runs the offline invariant suite (fast and deterministic):

  • Tor strict DNS-safe proxy enforcement (socks5h:// requirement).
  • Streaming response closure on early iterator termination.
  • Session ownership lifecycle (close() closes only owned resources).
  • Executor lifecycle closure under early parallel termination.
  • Runtime defaults validation for parallel/query behavior.
  • Storage policy single-source checks (Parquet compression + DuckDB identifier validation).
  • DuckDB managed connection lifecycle closure.

Live network smoke tests are opt-in by filename (live_*.py):

INTERMINE314_RUN_LIVE_TESTS=1 pytest -q tests/live_*.py

Benchmark commands and benchmark-specific docs live in benchmarks/README.md. Benchmarks are runner-script based (python -m benchmarks...); benchmark pytest globs are not part of CI or the default test workflow.

License

MIT (see LICENSE).

Metadata

Release files for intermine314 0.1.8

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

Source distribution (sdist)

Source distribution for intermine314 0.1.8
File Size Uploaded
intermine314-0.1.8.tar.gz 51.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for intermine314 0.1.8
File Interpreter ABI Platform
intermine314-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 112.7 kB

Release files / intermine314-0.1.8.tar.gz

Download URL intermine314-0.1.8.tar.gz
Size 51.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0b1017d2677d253ff51d21093306dbfc721d902ebae9913fa47083b7fde0d15b
BLAKE2b-256 checksum
How to use checksums
c5fac5bf0bfa503b58d1423f1211ef6f56836a9a9c3355cb1d5b2f1357a62ae2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release files / intermine314-0.1.8-py3-none-any.whl

Download URL intermine314-0.1.8-py3-none-any.whl
Size 61.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b18f41dd3327352cf65440d75415f76e6acd7244376e228b66e5437cdaad12fa
BLAKE2b-256 checksum
How to use checksums
9d52cf82fda2559affbc3252b6faf3f032c0c08067f6d9b9760bb60dfbe61bc5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.1

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