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.0.tar.gz (29.2 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.0-py3-none-any.whl (29.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for braidpy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 80a40d3f84f63680b4161e621f14c2319ce81272cc6c012c9b9077a840173f48
MD5 abb8f8bf88bfb196af2528a1c8307eee
BLAKE2b-256 72370df8eb7192950688e16d4e075e792c3a1d1c256a6e06c7d018cb87100fa0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: braidpy-0.2.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 77d5300817db17ed3f70cdf4eb8be73971fb57021af05d94b05943ca805d5340
MD5 f247ee260898fb48ce2393f5869c02b2
BLAKE2b-256 3fba683963dd7c35a921e94eed3ed0fdb55077069077984fc198466cb53e5cc7

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