Download the PHP package gosuperscript/schema-lookup without Composer
On this page you can find all versions of the php package gosuperscript/schema-lookup. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download gosuperscript/schema-lookup
More information about gosuperscript/schema-lookup
Files in gosuperscript/schema-lookup
Package schema-lookup
Short Description A PHP library for querying CSV/TSV files with streaming, dynamic filtering, aggregate functions, and range-based banding.
License proprietary
Informations about the package schema-lookup
Lookup Resolver
A high-performance PHP library for querying CSV/TSV files with streaming, dynamic filtering, aggregate functions, and range-based banding.
Features
- Memory-Efficient Streaming: O(1) memory complexity - processes records one-at-a-time
- Seven Aggregate Functions:
first,last,min,max,count,sum,avg,all - Explicit Filter API:
ValueFilterandRangeFilterfor clear, self-documenting code - Range-Based Banding: Support for scenarios like tax brackets, premium tiers, shipping rates
- Dynamic Filter Resolution: Use nested lookups and symbols as filter values
- Strongly-Typed Value Objects: Enhanced type safety with immutable aggregates
- Early Exit Optimization:
firstaggregate stops reading after first match (465x faster) - Flexible Storage: Support for local files, S3, and other storage backends via Flysystem
- PHP 8.4 Compatible: Full compatibility with latest PHP features
Installation
Quick Start
Using Different Storage Backends
The library uses Flysystem for filesystem abstraction, enabling you to read CSV files from various storage backends. The filesystem adapter is configured on the LookupResolver, allowing you to set the right filesystem adapter at runtime.
Local Filesystem
Amazon S3
Reusing an Expression with Different Inputs
Expression wraps a source together with the resolver and any named
Definitions, and lets you invoke
it like a function with per-call bindings. This is handy when the same
lookup shape is reused with different symbol values:
Other Storage Options
Flysystem supports many adapters including:
- FTP/SFTP
- Azure Blob Storage
- Google Cloud Storage
- In-memory filesystem
- And many more...
See the Flysystem documentation for more options.
Requirements
- PHP 8.4+
- league/csv ^9.27.0
- league/flysystem ^3.0
- gosuperscript/monads
Documentation
For detailed documentation, examples, and API reference, see the main README.md file.
Testing
Benchmarking
Performance Characteristics
- Memory: ~6.86MB constant usage regardless of file size
- Early Exit: First aggregate is 465x faster than full scan
- Scalability: Linear time scaling with row count
- Validated: Comprehensive benchmarks with files up to 100k rows
License
Proprietary
Credits
Developed by GoSuperscript
Rebased on latest main
All versions of schema-lookup with dependencies
gosuperscript/axiom Version ^0.6.0
gosuperscript/monads Version ^1.0.0
league/csv Version ^9.27.0
league/flysystem Version ^3.0