Registry / http-networking / apitools

apitools

JSON →
library0.1.4pypiunverified

Apitools (version 0.1.4) is a Python library designed to assist with JSON schema validation and interaction with REST APIs. It provides utilities for defining and validating data against JSON schemas and for creating client proxies for API interactions. The library has not seen updates since 2016, indicating it is no longer actively maintained.

pip install apitools
INSTALL
IMPORT
SIG · APITOOLS
A
apitools
http-networkingenv0.1.4
Install
2.6s avg
Import
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.3MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.6s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Schema
from apitools.jsonschema import Schema
validate
from apitools.jsonschema import validate
Dataproxy
from apitools.dataproxy import Dataproxy
Client
from apitools.client import Client

This example demonstrates defining a JSON schema, validating data against it using `apitools.jsonschema.validate`, and using `apitools.dataproxy.Dataproxy` for schema-aware access and validation when modifying data.

from apitools.jsonschema import Schema, validate from apitools.dataproxy import Dataproxy # Define a simple JSON schema my_schema = Schema({ "type": "object", "properties": { "name": {"type": "string"}, "age": {"type": "integer", "minimum": 0} }, "required": ["name", "age"] }) # Validate data against the schema valid_data = {"name": "Alice", "age": 30} invalid_data = {"name": "Bob", "age": -5} # age cannot be negative try: validate(valid_data, my_schema) print("Valid data:", valid_data) except Exception as e: print("Validation error for valid_data (should not happen):", e) try: validate(invalid_data, my_schema) print("Validation attempt for invalid_data:", invalid_data) except Exception as e: print("Validation error for invalid_data (expected):", e) # Expected: -5 is less than the minimum of 0 # Using Dataproxy for schema-aware data access proxy_data = Dataproxy(valid_data, my_schema) print(f"Proxy Name: {proxy_data.name}") print(f"Proxy Age: {proxy_data.age}") # Trying to set an invalid value (will raise ValidationError) try: proxy_data.age = -10 except Exception as e: print("Attempt to set invalid age via Dataproxy failed as expected:", e)
Debug
Known issues
breakingApitools has a strict dependency on an old version of `jsonschema` (`>=2.5.1`). This is incompatible with modern `jsonschema` versions (4.x+), which have significant API and behavioral changes. Installing `apitools` in an environment with a newer `jsonschema` will likely lead to dependency conflicts or runtime errors.
fix
Use a isolated virtual environment with specific `jsonschema<3` or pin `jsonschema==2.5.1` if using `apitools`. Consider migrating to an actively maintained library for JSON schema validation.
affects: 0.1.x
gotchaThe `apitools` library is abandoned; its last release was in 2016 and there have been no code updates since 2021. It is not maintained, meaning no bug fixes, security patches, or compatibility updates for newer Python versions or libraries will be provided.
fix
Be aware that using this library in new projects carries significant risk. Consider modern, actively maintained alternatives for JSON schema validation and API client generation.
affects: 0.1.x
gotchaDue to its age and lack of maintenance, `apitools` is unlikely to be fully compatible with recent Python versions (e.g., Python 3.8+). While it targets Python 2 and early Python 3, specific language features or dependency changes in newer Python versions may cause unexpected errors.
fix
Test thoroughly in your target Python environment. It is recommended to use `apitools` only in legacy environments (Python 3.6 or older) where it was originally designed to run.
affects: 0.1.x
Errors
Common errors & fixes
jsonschema.exceptions.ValidationError: ... is not valid under any of the given schemas
Data provided for validation does not conform to the defined JSON schema. This can be due to missing required properties, incorrect data types, or values outside specified constraints (e.g., `minimum`, `maxLength`).
fix
Review your data against the `Schema` definition. Ensure all `required` fields are present and data types/values match the schema constraints.
ImportError: cannot import name 'Schema' from 'apitools.jsonschema' (or similar for other symbols)
You are trying to import a symbol from an incorrect module path, or the `apitools` library is not correctly installed or accessible in your Python environment.
fix
Verify `apitools` is installed (`pip show apitools`). Ensure the import path is exact, e.g., `from apitools.jsonschema import Schema`.
AttributeError: 'Dataproxy' object has no attribute 'some_property'
You are trying to access a property on a `Dataproxy` object that is not defined in the JSON schema it was initialized with, or it's a misspelling.
fix
Check your JSON schema definition to ensure `some_property` is correctly defined under `properties`. `Dataproxy` strictly enforces schema-defined attributes.
TypeError: '<' not supported between instances of 'NoneType' and 'int'
This error often occurs in older validation libraries like `jsonschema` 2.x when a schema expects a specific type (e.g., `integer`) but receives `None`, and a comparison operation (like `minimum` check) is attempted.
fix
Ensure all data fields expected to be non-null are indeed populated with appropriate values before validation or `Dataproxy` usage. Add 'null' to the `type` array in your schema if `None` is an allowed value for a property (e.g., `"type": ["string", "null"]`).
Upgrade
Version history
0.1.4latest on PyPI · released Mar 28, 2014
Audit
Dependencies
jsonschemarequiredCore dependency for JSON schema validation.
requestsrequiredUsed for HTTP client functionality in API interactions.
Agent activity
36 hits · last 30 days
node
32
OpenAI (training)
1
Resources

No resource links recorded.

apitools — pip install apitools · libregistry