Skip to main content

Python library for working with braids

Project description

BraidPy

A Python library for working with braids, with the goal to help design real world complex 3D braids, using recent advances in braid theory. Source is available at on github

Features

  • Mathematical representation of braids with braid words using Artin's generators
  • Conversion between different braid word formats
  • Braid operations and manipulations (inversion, handles reduction, ...)
  • Generation of parametric braid from braid word
  • Visualization capabilities (ASCI, 2D and 3D)
  • Computations of mathematical properties of braid word or invariants of braid
  • Annulus braids
  • Conversion from parametric braid to braid word
  • Conversion from material braid to parametric braid
  • Simulation of machine braiding process (hexagonal braiding machine)

Basic example

from braidpy import Braid

# Create a braid
b = Braid([1, 2, -1])

# Perform operations
result = b * b.inverse()

🛠️ Installation

Release versions are available on Pypi and it should be very easy to install braidpy in your python environment.

Using pip

pip install braidpy

Or using poetry

poetry add braidpy

Or using uv (recommended package manager used on the project)

uv add braidpy

🛠️ Installation from source

The version in pypi might lack features or bug corrections compared to the development versions.

You can download the code directly from GitHub or using git:

git clone git@github.com:baptistelabat/braidpy.git

By default, you should be on the 'develop' branch.

To install the required dependencies, follow the steps below:

  1. On linux, run the commands from root of repository to install uv. Use the official installation guide otherwise.
    sudo apt-get install build-essential
    cd braidpy
    make install-uv
    

Test

To launch the complete suite of tests, launch the following command:

uv run pytest tests

Alternatively, if you have make install, just run:

make test

📜 Documentation

Documentation of released versions is hosted by [readthedocs] (https://braidpy.readthedocs.io/en/latest/)

Documentation of development version can be found on [github pages] (https://baptistelabat.github.io/braidpy) You should be able to select among several versions. Note that this process is manual. You can also generate the documentation for your version installed from sources

make docs

Project Team:

This is a single person project for now, but I would be happy to make the team grow. Human:

  • Baptiste Labat LinkedIn GitHub

Bot: chatgpt windsurf

🤝 Contributions

Contributions are welcome! Please open an issue or submit a pull request from your fork to suggest changes, report bugs, or propose new features.

Here are a few code guidelines:

  • We use english for code and comments.
  • We use Google style docstring.
  • We use type hinting.
    Please be sure to install the pre-commit tool in order to check your code while commiting in order to keep a clean project history.
pre-commit install

Please have a look to makefile to find helpful commands.

📜 License

License

This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.


🖇️ References

https://dehornoy.lmno.cnrs.fr

Project details


Download files

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

Source Distribution

braidpy-0.2.1.tar.gz (28.8 kB view details)

Uploaded Source

Built Distribution

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

braidpy-0.2.1-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

Details for the file braidpy-0.2.1.tar.gz.

File metadata

  • Download URL: braidpy-0.2.1.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.7

File hashes

Hashes for braidpy-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e181df7f122ba8216f017e8a608eded644e0e060527a04c8021c0ca7c2b62d13
MD5 09b640d48320eabe6edd7a311acce895
BLAKE2b-256 5ab00490423629907ac6f79d73ebc843244120494366abc8063d49441fe5fc5c

See more details on using hashes here.

File details

Details for the file braidpy-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: braidpy-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.7

File hashes

Hashes for braidpy-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2496d09c28e97e853d723825cc5ce1ae11a5ddabe1a1ef27381bbc44b76c6146
MD5 95d3b0e04af4cc300f2123f130bd367a
BLAKE2b-256 704e8c15d2434b8af9d57f7e4aedacb5c22f2f09a4dec05430db3e6f74a1682e

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