Metadata-Version: 2.4
Name: colocationpy
Version: 0.1.8
Summary: Tools for co-location analysis: metrics, transforms, and utilities.
Author: Keiran Suchak
License: BSD 3-Clause License
        
        Copyright (c) 2025, Keiran Suchak
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice, this
           list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its
           contributors may be used to endorse or promote products derived from
           this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: Homepage, https://github.com/ksuchak1990/colocationpy/
Project-URL: Issues, https://github.com/ksuchak1990/colocationpy/issues
Keywords: co-location,spatial,mobility
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy<3.0,>=2.1
Requires-Dist: pandas<3.0,>=2.2.3
Requires-Dist: scipy<2.0,>=1.14.1
Requires-Dist: networkx<4.0,>=3.4
Requires-Dist: shapely<3.0,>=2.0.6
Requires-Dist: pandera<0.27,>=0.26.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"
Dynamic: license-file

# `colocationpy`

[![Ruff linting and formatting](https://github.com/ksuchak1990/colocationpy/actions/workflows/ruff.yml/badge.svg)](https://github.com/ksuchak1990/colocationpy/actions/workflows/ruff.yml)

[![Run Pytest with Conda](https://github.com/ksuchak1990/colocationpy/actions/workflows/pytest.yml/badge.svg)](https://github.com/ksuchak1990/colocationpy/actions/workflows/pytest.yml)

> A package to identify instances of co-location between mobile individuals in a
> population.

The package provides:

* **Core functionality** for detecting when and where co-location occurs.
* **Supporting metrics** for analysing the outcomes of co-location (entropy, clustering, interaction networks, modularity, etc.).
* **Transformations and utilities** to handle spatial and temporal alignment, distances, and proximity checks.

## Installation

```bash
pip install colocationpy
```

## Quickstart

Import the library and detect co-locations from mobility data, then use the built-in tools to explore the results.

Example outline:

* Provide trajectories with individual IDs, positions, and timestamps.
* Use co-location utilities to compute who was in the same place at the same time.
* Analyse the resulting interaction network or entropy measures.

## Modules

* **colocationpy (top-level)**
  Main API: co-location detection and related helpers.

* **colocationpy.metrics**
  Functions to analyse co-location results: entropies, clustering coefficient, interaction networks, mutual information, modularity.

* **colocationpy.transformations**
  Functions to align coordinate systems and map simulation timesteps to real datetimes. Used to make heterogeneous mobility data comparable.

* **colocationpy.utils**
  Distance measures, proximity functions, barrier handling, and other helpers used internally and available for advanced users.
