Skip to content

A Python library for weaving multiple API responses into unified data structures with automatic field mapping and conflict resolution

Notifications You must be signed in to change notification settings

thevamp47/apiloom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

apiloom

A Python library for weaving multiple API responses into unified data structures with automatic field mapping and conflict resolution.

apiloom simplifies aggregating data from multiple REST APIs by providing declarative schema mapping, automatic type conversion, and intelligent field merging to reduce boilerplate code when building composite data views.

Installation

git clone https://github.com/yourusername/apiloom.git
cd apiloom
pip install -e .

Or install from PyPI:

pip install apiloom

Quick Start

from apiloom import Loom, Schema

# Define your API schemas
user_schema = Schema({
    'name': {'source': 'user.full_name', 'type': 'string'},
    'email': {'source': 'user.email_address', 'type': 'string'},
    'age': {'source': 'profile.age', 'type': 'int'}
})

# Create a Loom instance
loom = Loom(cache_ttl=300)

# Weave multiple API responses
result = loom.weave([
    {'url': 'https://api.example.com/user/123'},
    {'url': 'https://api.example.com/profile/123'}
], schema=user_schema)

print(result)

Features

  • Declarative Schemas: Define API mappings using YAML/JSON
  • Automatic Type Coercion: Convert fields to specified types
  • Conflict Resolution: Intelligent merging strategies for duplicate fields
  • Response Caching: Built-in TTL-based caching layer
  • Retry Logic: Exponential backoff for failed requests

Documentation

See docs/ for detailed documentation and examples.

About

A Python library for weaving multiple API responses into unified data structures with automatic field mapping and conflict resolution

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages