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.2.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.2-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: braidpy-0.2.2.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.2.tar.gz
Algorithm Hash digest
SHA256 ed37e94bf99fda3098c2f13408bf31ccd082ba3f29cd998b888fb12a80696a86
MD5 591f14fa3a2f232ddb064362160a98bb
BLAKE2b-256 fb122bd67fc45fe4c70eafeea0cc52428b24f08377307c482cc20f3405282fe9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: braidpy-0.2.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2c7ba91f6b1ec08d2357e7cd6cb9f8ffbd2adec6574f9f7684da174f99d48eae
MD5 981e48288ce4326579795bf05d3e7695
BLAKE2b-256 dada652fe4326493958dd8cc4c42919b4618bd83d49911cab69284ccf27963cf

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