Skip to main content

Converts binary numbers to Gray Code. grikod2 (Gray Code, Grey Code)

Project description

grikod2 (Gri Kod, Gray Code)


DOI

WorkflowHub DOI

Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Open Source MIT License

Python CI codecov Documentation Status Binder PyPI version PyPI Downloads Linted with Ruff


PyPI PyPI version
Conda conda-forge version
DOI DOI
License: MIT License


A Python library for converting binary numbers to Gray Code with ease.


Tanım (Türkçe)

Gri Kod: grikod2 İkili sayıları Gri Koda çevirir.

Description (English)

Gri Kod: grikod2 converts binary numbers to Gray Code.


Kurulum (Türkçe) / Installation (English)

Python ile Kurulum / Install with pip, conda, mamba

pip install grikod2 -U
python -m pip install -U grikod2
conda install bilgi::grikod2 -y
mamba install bilgi::grikod2 -y
- pip uninstall grikod2 -y
+ pip install -U grikod2
+ python -m pip install -U grikod2

PyPI

Test Kurulumu / Test Installation

pip install -i https://test.pypi.org/simple/ grikod2 -U

Github Master Kurulumu / GitHub Master Installation

Terminal:

pip install git+https://github.com/KuantumBS/grikod2.git

Jupyter Lab, Notebook, Visual Studio Code:

!pip install git+https://github.com/KuantumBS/grikod2.git
# or
%pip install git+https://github.com/KuantumBS/grikod2.git

Kullanım (Türkçe) / Usage (English)

import grikod2

def main():
    # Binary numbers: ikili sayılar
    binary_numbers = ["0", "1", "10", "11", "100", "101", "1111"]

    for binary in binary_numbers:
        try:
            gray_code = grikod2.ikili_2_gri_kod(binary)
            print(f"Binary: İkili: {binary} -> Gri Kod: {gray_code}")
        except grikod2.InvalidBinaryError as e:
            print(f"İkili: {binary} -> Hata: {e}")

if __name__ == "__main__":
    main()
Binary: İkili: 0 -> Gri Kod: 0
Binary: İkili: 1 -> Gri Kod: 1
Binary: İkili: 10 -> Gri Kod: 11
Binary: İkili: 11 -> Gri Kod: 10
Binary: İkili: 100 -> Gri Kod: 110
Binary: İkili: 101 -> Gri Kod: 111
Binary: İkili: 1111 -> Gri Kod: 1000


#Input: 100
#Output example
#000:000
#001:001
#010:011
#011:010
#100:110
#101:111
#110:101
#111:100
import grikod2
grikod2.__version__

Development

# Clone the repository
git clone https://github.com/KuantumBS/grikod2.git
cd grikod2

# Install in development mode
python -m pip install -ve . # Install package in development mode

# Run tests
pytest

Notebook, Jupyterlab, Colab, Visual Studio Code
!python -m pip install git+https://github.com/KuantumBS/grikod2.git

Citation

If this library was useful to you in your research, please cite us. Following the GitHub citation standards, here is the recommended citation.

BibTeX

APA

Keçeci, M. (2025). Grikod2 [Data set]. WorkflowHub. https://doi.org/10.48546/workflowhub.datafile.13.1

Keçeci, M. (2025). Grikod2. GitHub, PYPI, Anaconda, Zenodo. https://doi.org/10.5281/zenodo.15352206

Chicago

Keçeci, Mehmet. Grikod2 [Data set]. WorkflowHub. https://doi.org/10.48546/workflowhub.datafile.13.1

Keçeci, Mehmet. "Grikod2". Zenodo, 06 Mayıs 2025. https://doi.org/10.5281/zenodo.15352206

Lisans (Türkçe) / License (English)

This project is licensed under the MIT License.

FOSSA Status

Pixi:

Pixi

pixi init grikod2

cd grikod2

pixi workspace channel add https://repo.prefix.dev/bilgi --prepend

✔ Added https://repo.prefix.dev/bilgi

pixi add grikod2

✔ Added grikod2 >=1.1.3,<2

pixi install

pixi shell

pixi run python -c "import grikod2; print(grikod2.version)"

Çıktı: 1.1.3

pixi remove grikod2

conda install -c https://prefix.dev/bilgi grikod2

pixi run python -c "import grikod2; print(grikod2.version)"

Çıktı: 1.1.3

pixi run pip list | grep grikod2

grikod 1.1.3

pixi run pip show grikod2

Name: grikod2

Version: 1.1.3

Summary: Converts binary numbers to Gray Code. Grikod2 (Gray Code, Grey Code)

Home-page: https://github.com/KuantumBS/grikod2

Author: Mehmet Keçeci

Author-email: Mehmet Keçeci <...>

License: MIT License

Copyright (c) 2025 Mehmet Keçeci

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

grikod2-1.1.4.tar.gz (21.1 kB view details)

Uploaded Source

Built Distribution

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

grikod2-1.1.4-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file grikod2-1.1.4.tar.gz.

File metadata

  • Download URL: grikod2-1.1.4.tar.gz
  • Upload date:
  • Size: 21.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for grikod2-1.1.4.tar.gz
Algorithm Hash digest
SHA256 aa6350c766d18b0a565c33ed175d02e295b368681d0438449723d56d15dc6991
MD5 49df7d4d8755a5ef4a04e2c719429a66
BLAKE2b-256 a7ab6c1af617fc001eef0f60b0609421e7766055b9065f2223e709fd522e0825

See more details on using hashes here.

Provenance

The following attestation bundles were made for grikod2-1.1.4.tar.gz:

Publisher: workflow.yml on KuantumBS/grikod2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file grikod2-1.1.4-py3-none-any.whl.

File metadata

  • Download URL: grikod2-1.1.4-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for grikod2-1.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 96c5f309d757d5c317d7fe2258f2dce02d95d45bd488b91f281e6ea568a7c06f
MD5 bc58b9997b12410f6ee33fc0fd71348b
BLAKE2b-256 a4a954ccd0e66b67433214617f1a6c043dd21b6f50017547660f4ba59cf6a76b

See more details on using hashes here.

Provenance

The following attestation bundles were made for grikod2-1.1.4-py3-none-any.whl:

Publisher: workflow.yml on KuantumBS/grikod2

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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