Catalog PyPI
PACKAGE EXPLORERView in registry

ai-law-tracker

PyPI

Official Python SDK for the AI Law Tracker API — audited AI-regulation data (US state + federal, EU, global) in three lines.

actaiapicomplianceeulawlegalregulationsdk
Versions collected1
Direct dependencies4From release 0.1.0
Last observed21 Oct, 11:08 UTC

README

Version 0.1.0 documentation

AI Law Tracker — Python SDK

PyPI Python License: MIT

Official Python client for the AI Law Tracker API — the audited dataset of AI regulation across US state + federal, the EU, and global jurisdictions. Laws, news, changelogs, obligations, penalties, compliance assessment, deadlines, and webhooks.

pip install ai-law-tracker

Quick start (3 lines)

from ai_law_tracker import Client

alt = Client()                          # anonymous tier; no key required
laws = alt.laws.list(scope="federal")   # -> a Page of records
for law in laws:
    print(law["identifier"], "—", law["title"])

Authentication

The API has a free anonymous tier (rate-limited by IP). For higher limits, richer fields, and the changelog/webhook endpoints, use a free API key (no card required):

from ai_law_tracker import Client

# 1) Issue a free key by email (anonymous call is fine)
Client().account.create_key("you@example.com")   # emails you a key

# 2) Use it — explicitly, or via the ALT_API_KEY env var
alt = Client(api_key="alt_live_...")
print(alt.account.get())   # your tier, limits, and live usage

Set ALT_API_KEY in your environment and Client() picks it up automatically. Paid tiers ($29 / $99 / $299 a month) raise quotas and unlock Pro-only endpoints — see https://ai-law-tracker.com/pricing.

Pagination

List endpoints return a Page you can iterate, index, and len(), plus .total, .limit, .offset, and .has_more:

page = alt.laws.list(scope="state", jurisdiction="colorado", limit=50)
print(page.total, "records match;", len(page), "on this page")

To sweep every matching record without managing offsets yourself, use .iterate(...) — it pages transparently and yields one record at a time:

for law in alt.laws.iterate(scope="eu", in_force=True):
    ...

for hit in alt.search.iterate("facial recognition", scope="state"):
    ...

Endpoints

Grouped as resources on the client:

ResourceMethods
alt.lawslist, iterate, get(id), history(id), sources(id), citations(id)
alt.searchquery(q, ...), iterate(q, ...)
alt.newslist, iterate
alt.changeslist, iterate (poll since= for what changed)
alt.feedlist (lean recent-changes stream)
alt.jurisdictionslist, countries, states
alt.sectorslist, get(sector)
alt.complianceobligations, penalties, assess, report
alt.deadlineslist (JSON or iCal via format="ical")
alt.billslist, get(slug)
alt.webhookslist, get(id), create, delete (Pro+)
alt.accountget, revoke, create_key(email), create_token(email)
top levelalt.health(), alt.accuracy(), alt.categories(), alt.openapi()

Examples:

# Poll the changelog for everything that moved since a timestamp
changes = alt.changes.list(since="2026-07-01T00:00:00Z", scope="federal")

# Compliance obligations for a sector + jurisdiction
obs = alt.compliance.obligations(jurisdiction="colorado", sector="hr")

# Risk assessment from a company profile
result = alt.compliance.assess(state="CA", sector="hr", aiUse="resume_screening")

# Upcoming compliance deadlines as an iCal feed (text/calendar)
ics = alt.deadlines.list(scope="eu", format="ical")

Error handling

Every non-2xx response raises a typed exception carrying .status, .code, .message, and .docs:

from ai_law_tracker import NotFoundError, RateLimitError, AuthenticationError

try:
    alt.laws.get("does-not-exist")
except NotFoundError as e:
    print(e.code, e.message)
except RateLimitError as e:
    print("retry after", e.retry_after, "seconds")

All inherit from ALTError. Transient failures (timeouts, 5xx, 429) on GET/DELETE are retried automatically with exponential backoff (configurable via Client(max_retries=...)).

Configuration

Client(
    api_key=None,        # or set ALT_API_KEY
    base_url="https://ai-law-tracker.com/api/v1",
    timeout=30.0,        # seconds
    max_retries=2,       # transient GET/DELETE retries
)

Client is a context manager (with Client() as alt: ...) and has .close() to release the connection pool.

Responsible use

This SDK is designed to be a well-behaved API citizen and does not provide any way to bypass the server's tier gating or rate limits:

  • Requests are sequential with a single connection — no parallel fan-out or concurrent request flooding.
  • Retries are conservative: a small default (max_retries=2), exponential backoff with jitter, and only on idempotent GET/DELETE. Writes/POSTs are never retried automatically.
  • 429 responses and their Retry-After header are respected; a persisted rate limit surfaces as a RateLimitError (with .retry_after) rather than being retried away.
  • iterate(...) pages one page at a time, in order, through the same rate-limited transport. It is a convenience for legitimate paging, not a bulk scraper — please honour your tier's quotas.

If you need high-volume or bulk access, use an appropriate paid tier or contact hello@ai-law-tracker.com rather than working around the limits.

License

MIT (SDK code). API data is CC BY 4.0 — attribution required, informational only, not legal advice.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.023 Jul 20264

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
awesome28208/ai-law-tracker

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 21 Oct, 11:08 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:0aadf982a8eeed1d9b885c2c02841f75a04657ac6bdffc73ef522c3ba38eca64