Metadata-Version: 2.3
Name: crossnm
Version: 0.1.0
Summary: Add your description here
Author: wormwo
Author-email: wormwo <159902959+wormwo@users.noreply.github.com>
Requires-Dist: geopandas>=1.1.2
Requires-Dist: google-cloud-core>=2.5.0
Requires-Dist: google-cloud-storage>=3.9.0
Requires-Dist: loguru>=0.7.3
Requires-Dist: pandas>=3.0.1
Requires-Python: >=3.11
Description-Content-Type: text/markdown

# CrossNM

Python package for downloading, and caching network rail geometry models as GeoPandas GeoDataFrames.

## What this package provides

CrossNM has two network model views:

- **Full model**

- **Simplified model**: produces a single-line representation of the network and is **not split by ELR**.  

---

## Installation

```bash
pip install crossnm
```

---

## Quick start

```python
from crossnm import FullModel, SimplifiedModel

tracks_gdf = FullModel().download()

simplified_tracks_gdf = SimplifiedModel().download()

```

## Cache Behaviour

When available, `FullModel().download` will load relevant geometries from a local cache. This is created when the geometry was last downloaded. 

The GeoDataFrames are stored as `.pkl` files alongside cache information as a `.json`. The cache `.json` contains information on the life-span of the cache as a unix timestamp, as well as when the geometry was last cached. 

On loading the geometry, the cache information is inspected, and if the cache is out of date, the geometry is replaced with a download from the google storage bucket. The cache information is then updated with the new time of cacheing. 

## Logs

If logs are not required, pass `logs=False` into the constructor of the loader. 

