graycode
Convert two's complement integer to gray code and vice versa
Decision gist · record as of 2026-08-14
Yes, if you need gray code conversion for a stable, self-contained use case. The library is small, dependency-free, and has no known vulnerabilities. However, the abandoned maintenance status means no bug fixes or Python version updates are forthcoming—install only if the current functionality meets your needs and you can maintain a local fork if necessary.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.5 or later; source distribution may require a C compiler on some systems.
- High install friction due to source distribution format.
- Package is abandoned (last release November 2020, over 5 years ago) with no maintenance activity, though it has no runtime dependencies.
License · maintenance · safety
permissive license (permissive) — MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.
last release 2020-11-09 (2104 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 97,771 downloads/mo, #13,127 on PyPI
Alternatives
Verify before relying
pip install graycode
import graycode
# Convert integer to gray code
graycode.tc_to_gray_code(5)
# Convert gray code back to integer
graycode.gray_code_to_tc(0b110)
# Generate all n-bit gray codes
graycode.gen_gray_codes(3)- Whether the source distribution requires compilation or has platform-specific build requirements.
- Current state of the GitLab repository and whether it accepts contributions or bug reports.
What it is and what it does
Graycode is a small utility library for converting between standard two's complement integers and gray code (reflected binary code), a binary numeral system where consecutive values differ by exactly one bit. This property makes gray codes useful in applications where bit transitions need to be minimized, such as digital electronics, error correction, and certain optimization problems.
The library provides three main functions: conversion from integers to gray code, conversion from gray code back to integers, and generation of all n-bit gray codes in sequence. It has no external dependencies and works with Python 3.5 and later. However, the package has been abandoned since late 2020 and receives no maintenance or updates.
Use it for
- Digital circuit design where minimizing bit transitions reduces power consumption or glitches.
- Rotary encoder applications where gray code naturally represents mechanical position changes.
- Error detection and correction systems that exploit the single-bit-change property.
- Algorithm development or teaching that requires gray code sequences or conversions.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need gray code conversion for a stable, self-contained use case.
The library is small, dependency-free, and has no known vulnerabilities. However, the abandoned maintenance status means no bug fixes or Python version updates are forthcoming—install only if the current functionality meets your needs and you can maintain a local fork if necessary.
Install
graycode on PyPI
Before you install
High install friction due to source distribution format. Package is abandoned (last release November 2020, over 5 years ago) with no maintenance activity, though it has no runtime dependencies.
Requires Python 3.5 or later; source distribution may require a C compiler on some systems.
License in practice
MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.
Quickstart
pip install graycode
import graycode
# Convert integer to gray code
graycode.tc_to_gray_code(5)
# Convert gray code back to integer
graycode.gray_code_to_tc(0b110)
# Generate all n-bit gray codes
graycode.gen_gray_codes(3)
Verify before relying
- Whether the source distribution requires compilation or has platform-specific build requirements.
- Current state of the GitLab repository and whether it accepts contributions or bug reports.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.5 |
| Install friction | High. Source build required |
| Runtime dependencies | None |
| Maintenance | Abandoned 2,104 days since the last release |
| First released | |
| Downloads | 97,771 / month, #13,127 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: graycode-1.0.5.tar.gz
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “gray code conversion”
- graycodeConverts between two's complement integers and gray code (reflected…
- simplejpegEncodes and decodes JPEG images directly to and from memory using…
- dxcamDXcam captures screen frames on Windows at high speed using the…
Give your agent the search over MCP, or paste the wish link into any chat.
More Mathematics packages
NetworkX provides data structures and algorithms for creating, analyzing, and manipulating graphs and networks, supporting everything from simple undirected graphs to complex directed and weighted networks.
kiwisolver is a Python binding to a fast C++ implementation of the Cassowary constraint solver, enabling you to solve systems of linear constraints and inequalities.
Install it if you need to solve constraint systems; skip it if you only need simple linear algebra.
SymPy is a Python library for symbolic mathematics, performing algebraic manipulation, calculus, equation solving, and mathematical expression simplification without numerical approximation.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
PyTorch provides GPU-accelerated tensor computation and automatic differentiation for building and training deep neural networks in Python.
onnxruntime loads and executes Open Neural Network Exchange (ONNX) models with a focus on inference performance across CPUs and accelerators.
Install it if you have ONNX models to run in production or development.
See also bitarray · bitarray-hardbyte · fixedint · macaddress · category-encoders · roman-numerals-py · hachoir · intbitset · blurhash · base36