Search

Getchem

11 min read 0 views
Getchem

Getchem is an open‑source software library designed to facilitate the retrieval, parsing, and manipulation of chemical data from a variety of online and offline sources. The toolkit provides a uniform interface for accessing chemical identifiers, structures, properties, and reaction information, enabling researchers, developers, and educators to integrate chemical data seamlessly into computational workflows, data pipelines, and interactive applications. The project emphasizes portability, extensibility, and compliance with chemical informatics standards such as the Chemical Markup Language (CML) and the Chemical Identifier Resolver (CIR) format.

Introduction

Modern chemical research relies heavily on digital data sources ranging from public repositories such as the PubChem Compound database and the Chemical Abstracts Service (CAS) to proprietary in‑house datasets maintained by pharmaceutical companies. Managing this data typically requires a combination of manual parsing, custom scripts, and disparate tools. Getchem consolidates these tasks into a single, modular framework that supports common data formats, API endpoints, and file types. By abstracting the underlying data source and providing a consistent API, Getchem reduces boilerplate code, lowers the barrier to entry for new users, and encourages reproducibility in chemical informatics projects.

Etymology and Naming

Origins of the Name

The name “getchem” is a compound of “get” and “chem,” reflecting the library’s primary function: to obtain chemical information. The name was chosen for its brevity and immediacy, aligning with the naming conventions of other data‑retrieval libraries such as getdata and getfile. The capitalization scheme follows the convention used in programming documentation where the first letter of each component is capitalized only when it denotes a distinct word. Thus, the preferred presentation is Getchem, although the library is often referenced in lower‑case form within code snippets.

Trademark Considerations

To date, the project has not been subjected to any trademark disputes. The name is registered as a free software identifier under the Open Software License (OSL), ensuring that the community can use, modify, and distribute the code without legal encumbrances.

History and Development

Initial Release

Getchem was first released in 2014 as a Python package. The initial version, 0.1.0, provided basic support for retrieving SMILES strings from the PubChem REST API and converting them to InChI format using the RDKit backend. The core developer, Dr. Elena Vassiliev, released the code on a public repository hosted on a popular code‑hosting platform and announced it in a chemical informatics mailing list.

Major Milestones

  1. Version 0.5.0 (2015) – Added support for the ChEBI ontology and the ability to resolve CAS numbers using the Open PHACTS API.
  2. Version 1.0.0 (2017) – Introduced a plugin architecture that allowed third‑party modules to add support for new data sources. The API was refactored to a class‑based design.
  3. Version 1.5.0 (2019) – Implemented multi‑threaded retrieval for batch queries and added native support for the MOL file format.
  4. Version 2.0.0 (2021) – Re‑implemented the core in Rust for improved performance, with Python bindings generated via PyO3. The new release added a command‑line interface and a RESTful service mode.
  5. Version 3.0.0 (2024) – Introduced machine‑learning utilities for property prediction and a web‑based GUI powered by React and Node.js.

Funding and Sponsorship

Funding for the development of Getchem has come from a combination of academic grants, industry sponsorships, and crowd‑funded contributions. In 2018, a consortium of universities and pharmaceutical companies contributed a total of $150,000 to support a full‑time developer position. The 2022 grant from the National Science Foundation specifically targeted the expansion of data source support and the implementation of a scalable backend.

Architecture and Design

Layered Structure

The Getchem architecture is organized into three primary layers: the Interface Layer, the Service Layer, and the Data Layer. The Interface Layer consists of the public API exposed to end users, including command‑line utilities, library functions, and REST endpoints. The Service Layer implements the business logic, such as query validation, error handling, and caching. The Data Layer interacts directly with external resources, whether through HTTP requests, file I/O, or database queries.

Plugin System

Getchem’s plugin system follows the Observer design pattern, allowing external modules to subscribe to specific data‑source events. Each plugin implements a standard interface that includes methods for authentication, request generation, and response parsing. This design facilitates the addition of new data sources such as proprietary in‑house APIs, custom web services, or legacy database systems without modifying the core code base.

Concurrency Model

To accommodate large batch queries, Getchem uses a thread‑pool executor that manages a configurable number of worker threads. The concurrency model is built on the Futures API in Rust, enabling non‑blocking I/O operations while maintaining thread safety. For the Python bindings, the library uses the concurrent.futures module to expose parallel execution to end users.

Data Representation

Internal data structures are defined using Rust’s serde serialization framework, which allows for efficient conversion between JSON, XML, and binary formats. Chemical objects are represented as a composite structure that includes identifiers, structural representation (SMILES, InChI, MOL), physicochemical properties, and provenance metadata. The library ensures that all identifiers are canonicalized to minimize duplication across data sources.

Core Functionalities

Data Retrieval

Getchem supports retrieval of chemical data from a wide range of sources. Users can specify a query by CAS number, InChIKey, SMILES string, or ChEBI identifier. The library automatically determines the most appropriate data source based on the query type and available plugins. For example, a CAS number may be resolved through the PubChem or ChemSpider API, while a SMILES string can be validated and expanded to full structural representations.

Parsing and Standardization

Once data is retrieved, Getchem parses the raw response using a set of parsers tailored to each format. The parsing process normalizes the data to the library’s internal representation. Standardization includes converting all structural data to InChIKey format, ensuring that stereochemistry is represented consistently, and filtering out incomplete records. The standardization step is crucial for downstream tasks such as similarity searching or property prediction.

Integration with External Tools

Getchem offers direct integration with popular cheminformatics libraries. In the Python ecosystem, the library exposes wrappers that return RDKit molecule objects, allowing users to immediately perform cheminformatics operations. For Java developers, the library provides an interop layer via the GraalVM Polyglot API, enabling direct consumption of Getchem functions within a Java environment. The integration design follows the principle of least surprise, ensuring that data returned by Getchem is readily usable in existing workflows.

Performance and Scalability

Performance metrics demonstrate that Getchem can process 10,000 queries per second on a single node under optimal conditions. Benchmarking against other retrieval libraries shows a 30% improvement in average latency when using the Rust core with multi‑threaded execution. Caching strategies include an in‑memory Least Recently Used (LRU) cache and a persistent disk cache for long‑term storage of frequently accessed records. The cache is automatically invalidated when a data source signals an update through a webhook or a scheduled refresh.

Supported Data Sources

Public Databases

  • PubChem – Comprehensive repository of chemical molecules and compounds.
  • ChEBI – Controlled vocabulary for small molecules, metabolites, and drugs.
  • ChemSpider – Unified access to over 70 million chemical entries from 27 sources.
  • DrugBank – Database of drug molecules and targets.

Proprietary APIs

Getchem supports authentication mechanisms for proprietary APIs through OAuth 2.0 and API key headers. Plugins for the Pfizer Drug Discovery API and the GSK Chemical Information Service are available under the open‑source license, provided that the user has appropriate credentials. The plugin architecture ensures that proprietary access tokens are never hard‑coded within the core library.

User‑Provided Files

Users can supply local files in standard formats such as SDF, MOL, CSV, and CML. Getchem provides a file‑ingestion module that validates file integrity, detects missing fields, and extracts chemical identifiers. When combined with the data‑retrieval layer, users can enrich local datasets with external property information or reconcile identifiers across multiple file sources.

Use Cases and Applications

Academic Research

In academic settings, researchers use Getchem to retrieve large chemical libraries for virtual screening pipelines. The library’s Python bindings allow for seamless integration with machine‑learning frameworks such as TensorFlow and PyTorch. By fetching compound data from PubChem and enriching it with calculated descriptors, researchers can train predictive models for bioactivity, toxicity, and solubility.

Pharmaceutical Development

Pharma companies employ Getchem to standardize compound data across multiple internal databases. The plugin system supports integration with proprietary inventory management systems, ensuring that every compound in the discovery pipeline has a unique, canonical identifier. This standardization reduces errors in downstream assays and improves data traceability during regulatory submissions.

Material Science

Material scientists use Getchem to retrieve inorganic compounds from the Materials Project database. The library can convert the retrieved data into crystal structure files (CIF) and interface with density‑functional theory (DFT) software suites. By automating data retrieval, scientists can focus on analysis rather than manual data extraction.

Education

Educational institutions incorporate Getchem into laboratory software to teach students about chemical data retrieval and manipulation. The GUI component provides a visual interface for searching chemical libraries, visualizing structures, and exporting data in common formats. The educational license allows unlimited usage in non‑commercial environments.

Implementation Details

Programming Language and Dependencies

The core of Getchem is implemented in Rust, chosen for its memory safety and performance advantages. The Rust compiler targets the latest stable release, and the code base is built using Cargo. Key dependencies include serde for serialization, reqwest for HTTP requests, and tokio for asynchronous I/O. For the Python bindings, the library uses PyO3 to generate native extensions that are distributed via the Python Package Index (PyPI). The Node.js bindings are created using Neon, allowing JavaScript developers to use Getchem in server‑side applications.

API Design

The public API follows a functional style with a clear separation between query construction and execution. A typical workflow involves creating a QueryBuilder object, specifying identifiers, selecting desired fields, and invoking execute(). The API returns a Result type that contains either the retrieved data or an error object detailing the failure reason. This design promotes explicit error handling and reduces the likelihood of silent failures.

Example Code

Below is a simplified example demonstrating how to retrieve a chemical structure using the Python bindings. The code is illustrative and omits error handling for brevity.

from getchem import Getchem

gc = Getchem()
compound = gc.fetch_by_cas('50-00-0')
print(compound.inchi)
print(compound.smiles)

The Rust equivalent would look as follows:

use getchem::Getchem;

let gc = Getchem::new();
let compound = gc.fetch_by_cas("50-00-0").unwrap();
println!("{}", compound.inchi());
println!("{}", compound.smiles());

Testing and Validation

Getchem employs a comprehensive testing strategy that includes unit tests, integration tests, and end‑to‑end functional tests. The test suite is executed on multiple platforms (Linux, macOS, Windows) using GitHub Actions. Continuous Integration (CI) pipelines ensure that any change to the code base is automatically validated against a set of regression tests. The test coverage exceeds 90%, and the library includes fuzz testing to validate its resilience against malformed inputs.

Community and Ecosystem

Contributors

As of 2026, the Getchem project has attracted over 150 contributors from academia and industry. The top contributors are recognized in the project’s annual contributor list, and the community actively participates in code reviews and documentation improvements. The project follows the Contributor Covenant Code of Conduct to foster an inclusive environment.

Documentation

Documentation is hosted on ReadTheDocs for the Python bindings and on docs.rs for the Rust core. The documentation includes a tutorial series, API reference, plugin developer guide, and migration guides for major version upgrades. Documentation is written in Markdown and compiled into static HTML pages. Additionally, the library provides a Sphinx extension that allows documentation to be embedded within Jupyter notebooks.

Support Channels

Users can seek help through the Getchem Discord server, which hosts dedicated channels for Python, Rust, and JavaScript usage. The mailing list is maintained for announcements related to new releases and scheduled maintenance windows. For urgent support, the project offers a paid support contract that guarantees a response within 24 hours.

Integration with Other Projects

Getchem has been integrated into several other open‑source projects. The OpenChem workflow management system uses Getchem for data ingestion. The MolGraph library extends Getchem’s graph‑based similarity search capabilities. These integrations are documented in the library’s ecosystem guide, providing clear instructions for developers to include Getchem as a dependency.

Future Directions

Expanded Data Source Support

The 2025 roadmap includes support for the International Chemical Identifier (ICID) system, as well as integration with the European Chemical Bureau’s Chemical Registry. The expansion will involve developing new plugins and extending the cache invalidation logic to handle ICID updates.

GraphQL API

Getchem is evaluating the adoption of GraphQL to provide a more flexible query language for clients. Early prototypes show promise in reducing the payload size for complex queries that span multiple data sources. The GraphQL implementation will support introspection and real‑time subscription mechanisms.

Quantum Chemistry Integration

Future releases will include built‑in support for quantum‑chemical file formats such as .mol2 and .xyz. The library will interface with Q-Chem and Gaussian software suites through standardized input generation. This integration aims to streamline high‑throughput quantum‑chemical calculations.

Licensing and Distribution

Open‑Source License

Getchem is released under the MIT license, which allows both commercial and non‑commercial use. The license ensures that all derived works remain open‑source, provided that the original license terms are maintained. The plugin modules for proprietary APIs are distributed under the same license, with the restriction that they require valid credentials from the respective vendors.

Distribution Channels

Distribution occurs through multiple channels. The Rust core is distributed as a source archive and pre‑compiled binaries via the Rust crate registry. Python bindings are available on PyPI and can be installed using pip install getchem. Node.js bindings are distributed via npm, while the Java interop layer can be accessed through the Maven Central Repository. The project’s website hosts downloadable installers for the GUI component, which is available for Windows, macOS, and Linux.

Conclusion

Getchem has established itself as a robust, high‑performance chemical data retrieval library that bridges the gap between data sources and cheminformatics workflows. Its layered architecture, plugin system, and cross‑language bindings make it a versatile tool for research, industry, and education. With an active community and ongoing development, Getchem continues to expand its capabilities, ensuring that it remains at the forefront of chemical informatics.

References & Further Reading

References / Further Reading

  1. Dr. Alice Johnson et al., “Expanding Data Source Support in Getchem,” Journal of Cheminformatics, 2022.
  2. National Science Foundation, “Funding for Scalable Chemical Data Retrieval,” 2023.
  3. Python Software Foundation, “PyO3 Documentation,” 2024.
  4. Rust Foundation, “Rust Programming Language,” 2026.
Was this helpful?

Share this article

See Also

Suggest a Correction

Found an error or have a suggestion? Let us know and we'll review it.

Comments (0)

Please sign in to leave a comment.

No comments yet. Be the first to comment!