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 chainsclient.cities.*— citiesclient.routes.*— trade routesclient.search.*— fuzzy + advanced searchclient.snapshot()— world snapshot at yearclient.stats()— aggregate statisticsclient.export.*— GeoJSON, CSV bulk export
See API docs for the full endpoint catalog.
License
Apache 2.0.
Source
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b146fb13167ea11dab635508f1e86adf1e44b4391390d7f5cdd733335b8d10be
|
|
| MD5 |
06f979e75e554ce10944da3560fae11a
|
|
| BLAKE2b-256 |
1e712b53d9bc57ea58ae36573b72b7ca78eaa0b62f6e8263562cb822c32ff407
|
Provenance
The following attestation bundles were made for atlaspi_client-0.1.0.tar.gz:
Publisher:
publish-sdk-python.yml on Soil911/AtlasPI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atlaspi_client-0.1.0.tar.gz -
Subject digest:
b146fb13167ea11dab635508f1e86adf1e44b4391390d7f5cdd733335b8d10be - Sigstore transparency entry: 1329292594
- Sigstore integration time:
-
Permalink:
Soil911/AtlasPI@8341843f9d0a8b58ee784ccc9495b0ef87aea17f -
Branch / Tag:
refs/tags/sdk-py-v0.1.0 - Owner: https://github.com/Soil911
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-python.yml@8341843f9d0a8b58ee784ccc9495b0ef87aea17f -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3adc6baa789f3213e4838c9a625f0cce3b84e2494352cdf9ca97e1a86e87fa7b
|
|
| MD5 |
6c193f2e4cb9e2e28954befa49cd114b
|
|
| BLAKE2b-256 |
23f63008aa2d831b8bd8551d0fb2bacec24298592a4cd3e01e828fe1ca662d9c
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
atlaspi_client-0.1.0-py3-none-any.whl -
Subject digest:
3adc6baa789f3213e4838c9a625f0cce3b84e2494352cdf9ca97e1a86e87fa7b - Sigstore transparency entry: 1329292601
- Sigstore integration time:
-
Permalink:
Soil911/AtlasPI@8341843f9d0a8b58ee784ccc9495b0ef87aea17f -
Branch / Tag:
refs/tags/sdk-py-v0.1.0 - Owner: https://github.com/Soil911
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk-python.yml@8341843f9d0a8b58ee784ccc9495b0ef87aea17f -
Trigger Event:
push
-
Statement type: