xatra

Quick start

Xatra (pronounced kṣatra), a tool for making historical maps – the data I have is currently focused on India (including Central and Southeast Asia), but I welcome expansions to the library. Installation:

pip install xatra

For a quick start, see examples.py e.g.

import xatra.maps.nations as nations
import xatra.maps.colonies as colonies

# any optional parameters may be set either while initializing a 
# FlagMap object or in plot()

nations.INDIC.plot(path_out="examples/nations/INDIC.html") 
nations.SILKRD.plot(path_out="examples/nations/SILKRD.html")
nations.SEA_GREATER.plot(path_out="examples/nations/SEA_GREATER.html") 
nations.INDOSPHERE.plot(path_out="examples/nations/INDOSPHERE.html")
colonies.EARLY_SUVARNABHUMI.plot(path_out="examples/colonies/EARLY_SUVARNABHUMI.html")
colonies.SEA_ROUTES.plot(path_out="examples/colonies/SEA_ROUTES.html")

The outputs are in

Note: view this documentation,

Documentation

Key ideas:

from xatra.data import Loka, Varuna
from xatra.maps import Flag, FlagMap
from xatra.matchers import *

flags_sample = [
    Flag(name="Arjunayana", period=[-60, 80], matcher=KURU, ref="Majumdar p 29"),
    Flag(name="Kuru", period=[-1100, -900], matcher=KURU),
    Flag(
        name="Maurya",
        period=[-260, -180],
        matcher=(SUBCONTINENT_PROPER | country("Afghanistan") | BALOCH)
        - (BACTRIA | MARGIANA | MERU | KALINGA | TAMIL_PROPER),
    ),
    Flag(name="Maurya", period=[-260, -180], matcher=KALINGA),
]

SampleMap = FlagMap(
    flags=flags_sample,
    loka=Loka.INDIC,
    varuna=Varuna.INDIAN_SUBCONTINENT,
    custom_html="Sample map for demonstration",
)
sample.plot(path_out="examples/sample.html")

TODO

If you’re interested in contributing to this open-source project, please do so! I’m an amateur at coding, and this is just a side-project of mine, and I’m quite busy with real work to do everything I wish I could.

Ideally if you’d like to contribute, create an issue and assign it to yourself, then start a pull request. I will review and approve pull requests daily. Here’s a to-do list of priorities you could work on: