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.cra-srl.com

# 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.1.0.tar.gz (10.8 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.1.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: atlaspi_client-0.1.0.tar.gz
  • Upload date:
  • Size: 10.8 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.1.0.tar.gz
Algorithm Hash digest
SHA256 b146fb13167ea11dab635508f1e86adf1e44b4391390d7f5cdd733335b8d10be
MD5 06f979e75e554ce10944da3560fae11a
BLAKE2b-256 1e712b53d9bc57ea58ae36573b72b7ca78eaa0b62f6e8263562cb822c32ff407

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlaspi_client-0.1.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.1.0-py3-none-any.whl.

File metadata

  • Download URL: atlaspi_client-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.5 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3adc6baa789f3213e4838c9a625f0cce3b84e2494352cdf9ca97e1a86e87fa7b
MD5 6c193f2e4cb9e2e28954befa49cd114b
BLAKE2b-256 23f63008aa2d831b8bd8551d0fb2bacec24298592a4cd3e01e828fe1ca662d9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for atlaspi_client-0.1.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