Skip to main content

Official Python client for the AtlasPI Historical Geography API

Project description

atlaspi-client

Official Python client for the AtlasPI Historical Geography API — free, public, no-auth REST API with 862 historical entities, 490 events, 94 dynasty chains from 4500 BCE to 2024.

Install

pip install atlaspi-client

Quick start

from atlaspi import AtlasPI

client = AtlasPI()  # defaults to https://atlaspi.it

# What was happening in 1250?
snapshot = client.snapshot(year=1250)
for period in snapshot["periods"]["items"]:
    print(f"{period['name']} ({period['region']})")

# Find similar entities
similar = client.entities.similar(entity_id=1, limit=5)
for ent in similar["similar"]:
    print(ent["name_original"], ent["similarity_score"])

# Events on a specific calendar day
today = client.events.on_this_day("07-14")  # Bastille Day
for event in today["events"]:
    print(f"{event['year']}: {event['name_original']}")

# Batch fetch (N entities in one round-trip)
batch = client.entities.batch([1, 2, 3, 42, 100])
print(f"Got {batch['found']} of {batch['requested']} entities")

# Full detail with all fields
entity = client.entities.get(1)
print(f"{entity['name_original']} ({entity['year_start']}-{entity['year_end']})")
print(f"Boundary: {entity['boundary_source']} ({entity['confidence_score']})")

Async support

import asyncio
from atlaspi import AsyncAtlasPI

async def main():
    async with AsyncAtlasPI() as client:
        snap = await client.snapshot(year=1500)
        similar = await client.entities.similar(entity_id=1)

asyncio.run(main())

Key endpoints

The client mirrors AtlasPI's endpoint taxonomy:

  • client.entities.* — entities (list, get, batch, similar, periods, events, etc.)
  • client.events.* — events (list, get, on_this_day, at_date, periods)
  • client.periods.* — periods (list, get, by_slug, at_year)
  • client.chains.* — dynasty chains
  • client.cities.* — cities
  • client.routes.* — trade routes
  • client.search.* — fuzzy + advanced search
  • client.snapshot() — world snapshot at year
  • client.stats() — aggregate statistics
  • client.export.* — GeoJSON, CSV bulk export

See API docs for the full endpoint catalog.

License

Apache 2.0.

Source

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

atlaspi_client-0.3.0.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

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

atlaspi_client-0.3.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file atlaspi_client-0.3.0.tar.gz.

File metadata

  • Download URL: atlaspi_client-0.3.0.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atlaspi_client-0.3.0.tar.gz
Algorithm Hash digest
SHA256 2929b2f3b02e48108744add667b69b7471b5685d089e91845201b9036e42d9c5
MD5 7b2e39b6d1e59b507293664f97b1395b
BLAKE2b-256 0a3479e6a09d335dfd4c80593620abbe812e8954f66d72b00d682b9f1df74115

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlaspi_client-0.3.0.tar.gz:

Publisher: publish-sdk-python.yml on Soil911/AtlasPI

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

File details

Details for the file atlaspi_client-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: atlaspi_client-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for atlaspi_client-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 23e8fa9bd9fe7c63ab2499e76c315a680b04609f6c21ac1813a7e59318bd5951
MD5 8dad4f27819b2e5801e5d6a02ae2af5e
BLAKE2b-256 b7a7e77a73c62622d6ff81c0c4227e29991cc8d583bb628b52758290550abe58

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlaspi_client-0.3.0-py3-none-any.whl:

Publisher: publish-sdk-python.yml on Soil911/AtlasPI

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