Download the PHP package saurabhgayali/uniprot-php without Composer

On this page you can find all versions of the php package saurabhgayali/uniprot-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package uniprot-php

UniProt PHP Library

A production-ready PHP library for programmatic access to the UniProt REST API.

Status: Complete, tested, ready for production use.

License: LICENSE.md for full terms.

Features

Quick Start

Installation

No installation required! Just clone or download into your project:

Usage

Single Entry Retrieval

Search with Pagination

Automatic Pagination (Get All Results)

The library automatically handles cursor-based pagination. You can retrieve all results no matter how large:

How it works:

Manual Pagination (User-Friendly Display)

For web interfaces, use manual pagination with custom offset control. Select 10, 20, or 50 results per page:

getPaginatedResults() Features:

Developers only need to:

  1. Call the function with query and offset
  2. Display the results using the returned data
  3. Create UI for pagination buttons using pageLinks array

The function handles all the heavy lifting: counting results, calculating pages, generating links, and determining navigation.

Note: See PAGINATION_OPTIMIZATION.md for detailed performance metrics showing 95% reduction in API calls and 99.8% reduction in memory usage.

ID Mapping

Examples

Three standalone CLI examples are provided to demonstrate library usage:

Running Examples from Command Line

All examples include error handling and work with both cURL and stream transports:

What Each Example Shows:

Example File Demonstrates
Entry Retrieval get_entry.php Single and batch retrieval, field selection, format options
Search Pagination search_entries.php Complex queries, automatic pagination, batch processing
ID Mapping map_ids.php Job submission, polling, result retrieval

Example Code Structure:

Documentation

Testing

Quick Server for Testing

Serve the test pages locally using PHP's built-in web server:

Then open http://localhost:8880 in your browser.

Console Output:

Access these interactive test interfaces (from web/ folder):

Each page includes:

Note: Web folder files (web/index.php, web/*_test.php, web/search_async.html, web/search_api.php) are for local development only and are excluded from the GitHub repository (see .gitignore). They are not required for production use.

Test Files

Run the following from tests/ folder:

Tests verify:

Architecture

Key Design Decisions

  1. Interface-based HTTP clients - Supports multiple transports
  2. Automatic transport selection - Chooses best available (cURL → Streams)
  3. Iterator-based pagination - Natural foreach support for search results
  4. Async-aware ID mapping - Built-in polling mechanism
  5. Structured exceptions - Detailed error information including HTTP status
  6. No external dependencies - Works anywhere PHP 7.4+ runs
  7. Strict type hints - Full type safety throughout

System Requirements

Performance

Error Handling

All errors throw UniProtException with:

Shared Hosting Compatibility

This library is optimized for shared hosting:

See Shared Hosting Guide for details.

API Compliance

This library strictly follows the official UniProt REST API:

All endpoints and response structures match official documentation.

Limitations

Future Enhancements

Potential additions:

Contributing

This is a complete, production-ready library with:

All core functionality is implemented and tested.

License

This project is dual-licensed:

When using this library, you agree to comply with both licenses. The MIT License applies to the PHP code, while UniProt's CC BY 4.0 license applies to the data accessed through the API.

Related Resources

Support

For issues or questions:

  1. Check documentation
  2. Review examples
  3. See error handling guide
  4. Run smoke tests: php tests/basic_smoke_tests.php

Built for production. No TODOs. No placeholders. Complete implementation.


All versions of uniprot-php with dependencies

PHP Build Version
Package Version
Requires php Version >=7.4
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package saurabhgayali/uniprot-php contains the following files

Loading the files please wait ...