Skip to main content

sagemap

A python library for reading BFME .map files. Can potentially work with the map files of other SAGE games but might need to be adjusted. This implementation is not complete.

All the credit for the parsing logic goes to: https://github.com/OpenSAGE/OpenSAGE. I simply "translated" it to Python and simplified it.

Installing

The package is available on pip

python -m pip install sagemap

Example

from sagemap import parse_map_from_path

# Load a BFME .map file
map = parse_map_from_path('path/to/your/file.map')

# Access map properties
print(map.world_info)
print(map.height_map_data)
print(map.objects_list)

Map Linter

sagemap includes a command-line linter for validating BFME map files. The linter checks for common issues such as terrain flatness, object counts, resource placement, and camera settings.

Usage

Run the linter from the command line:

python -m sagemap.linter <path-to-map-folder>

You can list all available error codes or exclude specific checks using command-line options. For more details, run:

python -m sagemap.linter --help

Using the Linter Programmatically

You can also use the linter in your own Python scripts:

from sagemap.linter import lint_map
from sagemap import parse_map_from_path

map = parse_map_from_path('path/to/your/file.map')
errors = lint_map(map)

for error in errors:
	print(f"{error.code}: {error.message}")

Metadata

Release files for sagemap 0.8.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sagemap 0.8.1
File Size Uploaded Provenance Actions
sagemap-0.8.1.tar.gz 39.1 kB Without provenance Details for sagemap-0.8.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sagemap 0.8.1
File Interpreter ABI Platform Actions
sagemap-0.8.1-py3-none-any.whl Python 3 none any Details for sagemap-0.8.1-py3-none-any.whl

Total release size: 90.3 kB

Release files / sagemap-0.8.1.tar.gz

Download URL sagemap-0.8.1.tar.gz
Size 39.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ab244110c80b8ee98f4aef3bb674c7227c0191a1f1f88e9319ad49a0672b2747
BLAKE2b-256 checksum
How to use checksums
0f7e9be89552257a34959e01904dfa52bf6abb211e60e48d053e92d791e6c9ad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Release files / sagemap-0.8.1-py3-none-any.whl

Download URL sagemap-0.8.1-py3-none-any.whl
Size 51.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
da122d899db4a8318e581ad6a6ef2c15912e0dcf9950d3cdc5d31f90eaabe086
BLAKE2b-256 checksum
How to use checksums
596fdd0a43e573e0f628b9dd132d76d0f4cd8aac3e416aa52b73f69de5588c04
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.7

Security for sagemap 0.8.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page