skillfed

pyactiveresource

ActiveResource for Python

pyactiveresource v2.2.2 813.6K downloads/30d#4,996 on PyPI102
Permissive license MIT License Active released

What it is and what it does

PyActiveResource is a Python port of Rails' ActiveResource library, providing an object-relational mapping layer for REST web services. Instead of writing HTTP requests manually, you define model classes that inherit from ActiveResource, set a REST endpoint URL, and then use familiar ORM-style methods (find, create, save, delete) to interact with remote resources. The library handles JSON serialization, HTTP verb routing (GET for retrieval, POST for creation, PUT for updates, DELETE for removal), and automatic object construction from JSON responses.

The package is designed to reduce boilerplate when working with RESTful APIs that follow standard conventions. It converts JSON responses into Python objects with attributes matching the JSON keys, handles nested objects automatically, and supports query parameters and custom headers for authentication. However, the codebase is mature but aging—last released in 2021 with classifiers targeting Python 2.6–3.4—so it may require verification or updates to work smoothly on modern Python versions.

Use it for:

  • Building a Python client for a REST API where resources map cleanly to object models.
  • Rapid prototyping of integrations with remote REST services without writing raw HTTP code.
  • Migrating from Rails ActiveResource to Python while maintaining similar ORM-style patterns.
  • Simplifying CRUD operations against a remote REST endpoint with automatic JSON marshalling.
  • Creating a Python wrapper around a convention-based REST API with minimal boilerplate.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyActiveResource maps Python classes to remote REST resources, allowing you to interact with RESTful web services using object-oriented syntax similar to database ORM patterns.

Yes, with conditions. PyActiveResource is a mature, permissively licensed library for REST ORM use cases, and it has active GitHub maintenance. However, install friction is high due to the source distribution and outdated Python version classifiers. Before installing, verify that it works on your target Python version and that your REST API follows the conventions the library expects. If your API is non-standard, consider alternatives.

Install

pyactiveresource on PyPI

pip

pip install pyactiveresource

uv

uv add pyactiveresource

poetry

poetry add pyactiveresource

Installing pyactiveresource

Before you install

Installation friction is high: the package has no runtime dependencies but relies on a source distribution (tar.gz), and the codebase targets Python 2.6–3.4 classifiers while the last release was in 2021. Maintenance is active on GitHub, though the gap between last release and current date suggests limited recent updates.

License in practice

MIT License (permissive) means you can use, modify, and distribute this package freely in commercial and private projects, with minimal restrictions beyond attribution.

Quickstart

pip install pyactiveresource

from pyactiveresource import activeresource as ar

class Person(ar.ActiveResource):
    _site = 'http://api.example.com:3000/people'

person = Person.find(1)
print(person.first)

The package targets Python 2.6–3.4; compatibility with modern Python versions is not documented and may require testing or updates.

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.4 despite classifier limits.
  • Current state of dependency compatibility and whether the source distribution installs cleanly on modern systems.
  • Whether authentication mechanisms beyond custom headers are supported.

Package facts

License MIT License (permissive)
Python support not specified
Install friction high — source build required
Runtime dependencies none
Maintenance actively maintained — 2,017 days since the last release
Last repo commit
First released
Downloads 813,595/month — #4,996 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pyactiveresource-2.2.2.tar.gz

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.6Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Programming Language :: Python :: 3.4Topic :: Software DevelopmentTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules

Tags

REST API object mappingActiveResource for PythonREST ORM libraryHTTP resource mappingRESTful web service client
rest-clientormhttp-mapping

More Software Development packages