Installation Guide

Prerequisites

  • Python 3.10 or higher
  • pip (Python package installer)
  • Docker (optional, for container deployment)

Installation Methods

Basic Installation

pip install uoapi

Development Installation

For development purposes, you can install the package with poetry:

# Install poetry if you haven't already
pip install poetry
# Clone the repository
git clone https://github.com/yourusername/uoapi.git
cd uoapi
# Install dependencies and package
poetry install

Pull the Official Image

docker pull carrowmw/uoapi:latest

Run the Container

docker run carrowmw/uoapi:latest

Build from Source

# Clone the repository
git clone https://github.com/yourusername/uoapi.git
cd uoapi
# Build the image
docker build -t uoapi .
# Run the container
docker run uoapi

Configuration

Local Installation

Create a config.yml file in your project directory:

base_url: "https://newcastle.urbanobservatory.ac.uk/api/v1.1"
timeout: 100000
time_slice:
last_n_days: 2
starttime: null
endtime: null
sensor:
theme: Traffic

Docker Installation

Mount a configuration file when running the container:

docker run -v /path/to/your/config.yml:/app/config.yml uoapi

Verification

Verify the installation by running Python and importing the package:

from uoapi import api_client
client = api_client.APIClient()
print("Installation successful!")

Troubleshooting

Common Issues

  1. Python Version Mismatch
  2. Error: "Python version < 3.10"
  3. Solution: Upgrade Python to version 3.10 or higher

  4. Dependencies

  5. Error: Missing dependencies
  6. Solution: Ensure all dependencies are installed using pip install -r requirements.txt

  7. Docker Issues

  8. Error: Image not found
  9. Solution: Ensure Docker is running and you have internet access to pull the image

For more help, please open an issue on our GitHub repository.