Download the PHP package scholarly/providers without Composer
On this page you can find all versions of the php package scholarly/providers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download scholarly/providers
More information about scholarly/providers
Files in scholarly/providers
Package providers
Short Description Unified PHP SDK for scholarly data providers with adapters, caching, and graph exporter.
License MIT
Homepage https://github.com/mbsoft31/scholarly-providers
Informations about the package providers
scholarly/providers
Unified PHP SDK for scholarly data providers (OpenAlex, Semantic Scholar, Crossref) with a clean contracts layer, robust HTTP client with retries and caching, and a graph exporter powered by mbsoft/graph-core and mbsoft/graph-algorithms.
โจ Features
- ๐ Provider adapters: OpenAlex, Semantic Scholar (S2), Crossref
- ๐งฉ Clean contracts:
Query,Paginator,ScholarlyDataSource - ๐ Resilient HTTP: jittered backoff, retry-after handling, 4xx/5xx classification
- ๐ง Normalization utils: DOI, arXiv, PubMed, ORCID helpers
- ๐๏ธ Caching: PSR-16 and PSR-6 support via a simple
CacheLayer - ๐ Graph export: citation and collaboration graphs as mbsoft/graph
Graph - ๐งช Well-tested: Pest test suite, static analysis with PHPStan
- ๐งฐ Framework-friendly: Laravel service provider + facade
๐ Requirements
- PHP 8.3+
- ext-json, ext-curl
- PSR-18 HTTP client and PSR-17 factories (or use Symfony HttpClient + Nyholm PSR-7)
๐ฆ Installation
Install via Composer:
Optional (Laravel): package discovery registers Scholarly\Laravel\ScholarlyServiceProvider. If you disable discovery, register it manually in config/app.php.
๐ Quick Start
PSR-first design: inject your own PSR-18 client, PSR-17 factories, PSR-16/PSR-6 cache, or PSR-3 logger via AdapterFactory::make([...], $container).
๐ Advanced Features
- Caching: wrap a PSR-16 or PSR-6 store with
CacheLayerand pass to the exporter to reuse reference/citation lookups between runs. - Retries & backoff: the client honors
Retry-Afterheaders and applies jittered exponential backoff for transient errors. - Batching & pagination: iterate
Paginatorinstances (searchWorks,listReferences,listCitations) or usebatchWorksByIds. - Identifier helpers:
getWorkByDoi,getWorkByArxiv,getWorkByPubmed,getAuthorByOrcidnormalize inputs and handle not-found paths.
๐งฑ Architecture
src/Contracts:Queryvalue object,Paginator,ScholarlyDataSourcecontractsrc/Core: HTTP client, backoff, cache layer, identity normalizationsrc/Adapters: OpenAlex, S2, Crossref implementations and paginatorssrc/Exporter: Graph exporter building mbsoft/graphGraphinstancessrc/Factory: Adapter factory, configuration objects, Laravel bindingssrc/Laravel: Service provider and facade
See docs/ for architecture notes, provider specifics, and Laravel usage.
โ๏ธ Configuration
Environment variables (or publish config/scholarly.php in Laravel):
SCHOLARLY_DEFAULT_ADAPTER(e.g.,openalex)SCHOLARLY_CACHE_STORE(Laravel) or provideCacheInterface/CacheItemPoolInterfaceSCHOLARLY_HTTP_TIMEOUT(seconds)- Provider settings:
OPENALEX_MAILTO,S2_API_KEY,CROSSREF_MAILTO
Graph exporter query flags:
work_ids(seed set),limit(page sizes),max_works(author graph cap),min_collaborations(edge threshold)
๐งฐ Laravel Usage
Publish config if needed:
๐งช Testing
Run the test suite:
With coverage:
Static analysis and coding style:
Fixtures for provider responses live under tests/Fixtures/. Guard any live API tests with SCHOLARLY_LIVE_TESTS=1.
๐ Documentation
- Start here:
docs/index.md - Quick start guide:
docs/getting-started.md - Contracts reference:
docs/contracts.md - Graphs & algorithms:
docs/graph.md - Adapters:
docs/adapters/openalex.md,docs/adapters/s2.md,docs/adapters/crossref.md - Extending:
docs/extending.md
Hosted docs (GitHub Pages): https://mbsoft31.github.io/scholarly-providers/
๐ฏ Use Cases
- Research discovery and enrichment workflows
- Building literature citation graphs for analysis/visualization
- Author collaboration network analysis
- Data pipelines integrating multiple scholarly sources via one API
๐ค Contributing
Contributions are welcome! Please open an issue or PR.
- Fork the repository
- Create your feature branch (
git checkout -b feat/awesome) - Ensure quality gates pass (
composer quality) - Push and open a Pull Request
๐ License
This library is open-sourced software licensed under the MIT license.
๐ See Also
All versions of providers with dependencies
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.1
psr/log Version ^3.0
psr/cache Version ^3.0
psr/simple-cache Version ^3.0
ext-json Version *
ext-curl Version *
mbsoft31/graph-core Version ^1.0
mbsoft31/graph-algorithms Version ^1.0