Python bindings for the crate twmap
Project description
TwMap Python Module
Safely parse, edit and save Teeworlds and DDNet maps - in Python!
See the Rust library twmap for details on the wrapped library.
Installation
Simply do pip install twmap
!
Usage
The help
function is your friend!
Once you imported twmap
, do help(twmap.Map)
to access the documentation of the Map
struct.
It also contains important general knowledge about the module.
To load your first map, do map = twmap.Map(path-to-map)
.
To see the attributes and documentation about an object... help
helps you!
For example, have a look into help(map.groups)
and help(map.groups[0])
.
The first one will give you methods on the group collection and the second one attributes and methods on group objects.
If you are confused about something in the module, the general information in help(twmap.Map)
might help you.
Manual Building (on Linux)
You need Rust installed on your system. To compile twmap in release mode, execute the following command in the source root:
cargo build --release
Locate the file target/release/libtwmap.so
.
This file is only importable under twmap.so
.
Symlink or copy it to your desired location.
Publishing Steps
These steps are the ones I use to upload new versions of twmap-py to pypi.
Linux:
podman pull ghcr.io/pyo3/maturin
podman run --env "MATURIN_PYPI_TOKEN=<token>" --rm -v $(pwd):/io ghcr.io/pyo3/maturin publish -f
Cross-compiling to Windows:
- Download the newest version of the oldest non-end-of-life Python edition "Windows x86-64 embeddable zip file" from https://www.python.org/downloads/windows/. Last used: https://www.python.org/ftp/python/3.8.2/python-3.8.2-embed-amd64.zip
- Unzip in project root
MATURIN_PYPI_TOKEN='<token>' RUSTFLAGS='-C target-feature=+crt-static' PYO3_CROSS_LIB_DIR='./<path-to-unzipped-python>' maturin publish --target x86_64-pc-windows-gnu
(replace the directory path)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file twmap-0.6.1-cp37-abi3-win_amd64.whl
.
File metadata
- Download URL: twmap-0.6.1-cp37-abi3-win_amd64.whl
- Upload date:
- Size: 7.7 MB
- Tags: CPython 3.7+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6922fec6b21c5c5c3994e1a7a7a36f08c14fe73ac595cea397714c98559608f4 |
|
MD5 | 2d22d3d2d498cbfd07f74d0dd0110d1f |
|
BLAKE2b-256 | 616b0d8a91e75d8d37870657a486c63f8158e952bb3da96b2bd96a1ed78dc9ce |
File details
Details for the file twmap-0.6.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: twmap-0.6.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.7+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.7.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 847adde38015a9649fb8457cac4e15c81189756f140117c0c61c4a26701501af |
|
MD5 | aff9753ed25feabbd0a4fe32eb90e59c |
|
BLAKE2b-256 | b9516c88e0fe4726812e5b6c2c31fec48c3158d4b9068cb2ef4ff6a7d65654fa |