Skip to main content

apiron helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.

Project description

apiron

PyPI version Supported Python versions Build status Documentation Status Contributor Covenant

apiron helps you cook a tasty client for RESTful APIs. Just don't wash it with SOAP.

Pie in a cast iron skillet

Gathering data from multiple services has become a ubiquitous task for web application developers. The complexity can grow quickly: calling an API endpoint with multiple parameter sets, calling multiple API endpoints, calling multiple endpoints in multiple APIs. While the business logic can get hairy, the code to interact with those APIs doesn't have to.

apiron provides declarative, structured configuration of services and endpoints with a unified interface for interacting with them.

Defining a service

A service definition requires a domain and one or more endpoints with which to interact:

from apiron import JsonEndpoint, Service

class GitHub(Service):
    domain = 'https://api.github.com'
    user = JsonEndpoint(path='/users/{username}')
    repo = JsonEndpoint(path='/repos/{org}/{repo}')

Interacting with a service

Once your service definition is in place, you can interact with its endpoints:

response = GitHub.user(username='defunkt')
# {"name": "Chris Wanstrath", ...}

response = GitHub.repo(org='github', repo='hub')
# {"description": "hub helps you win at git.", ...}

To learn more about building clients, head over to the docs.

Contributing

We are happy to consider contributions via pull request, especially if they address an existing bug or vulnerability. Please read our contribution guidelines before getting started.

License

This package is available under the MIT license. For more information, view the full license and copyright notice.

Copyright 2018-2025 Ithaka Harbors, Inc.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

apiron-9.1.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

apiron-9.1.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file apiron-9.1.0.tar.gz.

File metadata

  • Download URL: apiron-9.1.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for apiron-9.1.0.tar.gz
Algorithm Hash digest
SHA256 18d73aecc280af61c23eb2c0031c482a386e8ace5fa8d8d27dac234c02c0d294
MD5 7106fcb0417d8e7c6bf54c20ef196d29
BLAKE2b-256 7c584e9158648251ddb54519d3b716014e76d3f9843e189819fa356b5ac16e1f

See more details on using hashes here.

Provenance

The following attestation bundles were made for apiron-9.1.0.tar.gz:

Publisher: main.yml on ithaka/apiron

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file apiron-9.1.0-py3-none-any.whl.

File metadata

  • Download URL: apiron-9.1.0-py3-none-any.whl
  • Upload date:
  • Size: 14.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for apiron-9.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86ffdbb9c5396279b3b13dd99136a06bc810c7e046173134abadd537af72f06a
MD5 51bd054c7526943404f5b9aef07d0a55
BLAKE2b-256 3602631c842ca690fce7618c678c5ebf048a37ba956a8d2d15cbe2cc0bfa8008

See more details on using hashes here.

Provenance

The following attestation bundles were made for apiron-9.1.0-py3-none-any.whl:

Publisher: main.yml on ithaka/apiron

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page