> For the complete documentation index, see [llms.txt](https://cloakedkeys.gitbook.io/ofsc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cloakedkeys.gitbook.io/ofsc/installation/install-from-source.md).

# Install from source

This guide provides instructions for installing and setting up the project from source.

**Important Note for Developers:** Development builds get a version with the commit hash added (for example `3.16.2+g1a2b3c4`). PyPI doesn't accept versions like that, so only tagged releases are published there, as `ofscraper-community`. This guide includes steps to manage that for local development.

## Prerequisites

Before you begin, ensure you have the following installed on your system:

* **Git:** For cloning the project repository.
  * [Installation Guide](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
* **uv:** A fast Python package installer and resolver.
  * Follow the official installation instructions: [uv Installation Guide](https://docs.astral.sh/uv/getting-started/installation/)

## Installation Steps

Follow these steps to get your project up and running:

### 1. Clone the Repository

First, clone the project from its Git repository:

```
git clone https://github.com/cloakedkeys/OF-Scraper-Community
cd OF-Scraper-Community
```

### 2. Pull the Latest Tags

To ensure you have access to all version information, pull the Git tags:

```
git pull --tags
```

### 3. Prepare Environment Variables (for Custom Versioning)

The project uses a custom versioning strategy for local development and CI/CD that overrides the default PEP 440 checks during the build process. You need to source a script to set the necessary environment variables:

Bash

```
source scripts/commit_version.sh
```

This script will set variables that allow Hatch to correctly interpret and build the project's development versions.

### 4. Create a Python Virtual Environment

It's highly recommended to use a virtual environment to isolate your project's dependencies from your system's Python installation. `uv` can create these for you:

Bash

```
uv venv
```

Python 3.11 to 3.15 work. This will create a new virtual environment named `.venv` (by default) in your project directory.

### 5. Activate the Virtual Environment

Before installing dependencies, you need to activate the virtual environment:

Bash

```
source .venv/bin/activate
```

*(On Windows, you would typically use `.\.venv\Scripts\activate`)*

You should see `(.venv) or OF-Scraper` or similar prefix in your terminal prompt, indicating the virtual environment is active.

### 6. Install Project Dependencies

Now, use `uv` to install all project dependencies and reinstall any existing ones to ensure a clean state:

Bash

```
uv sync --reinstall
```

This command will read your `pyproject.toml` and `uv.lock` and install all necessary packages into your activated virtual environment. The `--reinstall` flag ensures that if any packages are already present, they are reinstalled, which can be useful after pulling updates.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://cloakedkeys.gitbook.io/ofsc/installation/install-from-source.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
