8000 GitHub - KuantumBS/grikod2: grikod2
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

KuantumBS/grikod2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
< 8000 svg aria-hidden="true" focusable="false" class="octicon octicon-file color-fg-muted" viewBox="0 0 16 16" width="16" height="16" fill="currentColor" display="inline-block" overflow="visible" style="vertical-align:text-bottom">
 
 
 
 
 
 
 
 

Repository files navigation

grikod2 (Gri Kod, Gray Code)

DOI

Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Open Source 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 (1.1.1). GitHub, PYPI, Anaconda, Zenodo. https://doi.org/10.5281/zenodo.15352207

Chicago

Keçeci, Mehmet. “Grikod2”. GitHub, PYPI, Anaconda, Zenodo, 06 Mayıs 2025. https://doi.org/10.5281/zenodo.15352207.

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

This project is licensed under the MIT License.

About

grikod2

Resources

License

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages

0