Skip to main content

Python SDK for Lore, a scalable version control system for code and large binary assets.

Project description

Lore Python SDK

About

This repository contains the Python SDK for integrating with Lore.

Lore is an open source version control system that is designed for unprecedented scalability of both data and teams. It is optimized for projects that combine code with large binary assets, including games and entertainment, and caters to the needs of developers and artists alike.

For full Lore documentation, architecture details, and contribution guidelines, visit the main Lore repository.

Install

Stable Release

python3 -m pip install lore-vcs

Minimal example

The top-level lore package exposes the high-level fluent API. A low-level, C-like wrapper around the underlying FFI is also available under lore.native for advanced use cases.

from lore import Lore
from lore.types import LoreLogConfig
from lore.types.args import LoreGlobalArgs, LoreRepositoryStatusArgs
from lore.types.enums import LoreEventTag, LoreLogLevel
from lore.types.events import LoreEventFFI

Lore.log_configure(
    LoreLogConfig(file=True, file_path="/path/to/log/directory", level=LoreLogLevel.DEBUG)
)

global_args = LoreGlobalArgs(repository_path="/path/to/local/repository")
status_args = LoreRepositoryStatusArgs(staged=True, scan=True)


def on_event(lore_event: LoreEventFFI, _user_context: int):
    if lore_event.tag == LoreEventTag.REPOSITORY_STATUS_FILE:
        print(lore_event.get_data())


Lore.repository_status(global_args, status_args).callback(on_event).wait()

For comprehensive examples, see the examples directory. Both examples/example.py and examples/example-native.py run offline by default; pass a remote URL (e.g. lore://localhost) as the first argument to exercise the online push/clone flow. See examples/README.md for details, including how to run a local Lore server.

When running examples/example.py or examples/example-native.py, set ON_WINDOWS_LINUX_SUBSYSTEM=True otherwise WSL fails to open the browser to complete user authentication.

Contributing

Set up your dev environment

  1. Clone the Lore Python SDK repository:
git clone https://github.com/EpicGames/lore-python
  1. Create a virtual environment and activate it:
uv venv .venv
source .venv/bin/activate
  1. Install the dev tooling:
uv pip install --group dev

Get the Lore library

The SDK binds against the Lore C library. Pick one of the two options below depending on whether you're also modifying the Lore core.

Option A — build the library from Lore source

Use this when you're changing the Lore C/Rust core alongside the Python SDK.

  1. Clone Lore's repository and build it:
cargo build --release
  1. Set the environment variable LORE_BUILD_PATH to point to the release build path:
export LORE_BUILD_PATH="/<path-to>/lore/target/release"

Option B — fetch a pre-built Lore library

Use this when you only need to develop the Python SDK against an existing Lore version.

  1. Download the header and binaries from the Lore repository release page and place them under /<path-to>/lore/

  2. Set the environment variable LORE_BUILD_PATH to point to the download path:

export LORE_BUILD_PATH="/<path-to>/lore/"

Generate the Python bindings

  1. Generate the lore.types, lore.include and lore.lib packages from lore build or fetched pre-built. Use --no-project so uv does not try to build the lore-vcs package which would fail because lore/types, lore/include and lore/lib don't exist yet.
uv run --no-project python find_lorelib.py
uv run --no-project python generator/generate.py
  1. Install the package as 'editable'.
uv pip install -e .
  1. Any edits you now make to lore will be immediately available in your current Python environment. If you change anything under generator/templates/ or pull a new Lore pre-built binary, re-run step 1 to regenerate the bindings — no second editable install is needed.

Why the install is a multi-step process:

setup.py declares the packages lore, lore.types, lore.include, and lore.lib. Of these, only lore is checked into the repo — the other three are produced by find_lorelib.py and generator/generate.py from a local build.

Setuptools refuses to perform an editable install (uv pip install -e .) until those directories exist on disk, so the generator must run before the editable install.

Running uv pip install -e . --group dev as a first step would fail with error: package directory 'lore/types' does not exist.

Run the examples

With the dev environment set up, a Lore library available, and the Python bindings generated, run an example as a module from the repository root:

uv run python examples/example.py
uv run python examples/example-native.py

Run the test suite

uv run pytest

Type-check

uv run mypy lore

mypy is configured in strict mode (see [tool.mypy] in pyproject.toml). Run it before opening a PR so type annotations on the public SDK surface stay correct for users.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

lore_vcs-0.8.5-py3-none-win_amd64.whl (11.1 MB view details)

Uploaded Python 3Windows x86-64

lore_vcs-0.8.5-py3-none-manylinux_2_39_x86_64.whl (10.8 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ x86-64

lore_vcs-0.8.5-py3-none-manylinux_2_39_aarch64.whl (10.2 MB view details)

Uploaded Python 3manylinux: glibc 2.39+ ARM64

lore_vcs-0.8.5-py3-none-macosx_11_0_arm64.whl (11.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

File details

Details for the file lore_vcs-0.8.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: lore_vcs-0.8.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 11.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lore_vcs-0.8.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 ddd00598b02b8d9c0750643edd5aedb82c2aa89663b958457d05b531385a0b4d
MD5 3c9541003f047ece842665051b7c2e74
BLAKE2b-256 5e9bb20f8d61a026f72d1e796618c957d142ab52311805a17141bebad2e1392d

See more details on using hashes here.

File details

Details for the file lore_vcs-0.8.5-py3-none-manylinux_2_39_x86_64.whl.

File metadata

  • Download URL: lore_vcs-0.8.5-py3-none-manylinux_2_39_x86_64.whl
  • Upload date:
  • Size: 10.8 MB
  • Tags: Python 3, manylinux: glibc 2.39+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lore_vcs-0.8.5-py3-none-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 335ddda2bc7670b220fe1ab68339a6b308266a39c627cbcca08411a4d9806922
MD5 3f782cd42c46708ac902cc2a198c6a90
BLAKE2b-256 9de13ed4ff66cae00767f2901bdf19d0e9c7b53aa2af1f7bd8eaa4446a66d0df

See more details on using hashes here.

File details

Details for the file lore_vcs-0.8.5-py3-none-manylinux_2_39_aarch64.whl.

File metadata

  • Download URL: lore_vcs-0.8.5-py3-none-manylinux_2_39_aarch64.whl
  • Upload date:
  • Size: 10.2 MB
  • Tags: Python 3, manylinux: glibc 2.39+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lore_vcs-0.8.5-py3-none-manylinux_2_39_aarch64.whl
Algorithm Hash digest
SHA256 8279a15c41ce97b1a99fe56065fe00cec895772a965f8c43c7c41e5890411582
MD5 d2ec4fddbce86000f5568564310257e1
BLAKE2b-256 2492dc3518147024e9a2a5045ec949bf3fcd621749b8559394479004a96c3315

See more details on using hashes here.

File details

Details for the file lore_vcs-0.8.5-py3-none-macosx_11_0_arm64.whl.

File metadata

  • Download URL: lore_vcs-0.8.5-py3-none-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 11.8 MB
  • Tags: Python 3, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.15 {"installer":{"name":"uv","version":"0.9.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for lore_vcs-0.8.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 112a7f41e416a4f53bfe52a253b3c237b4886707e7893b25a98ff54e70f5691d
MD5 638224dab59b5d89efdb7c2a7e600e1d
BLAKE2b-256 3e872c1a4e6117c07fe20ff7479677af6f5938362da9b732938e979c920e590b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page