Binary to Gray code conversion package for efficient data encoding.
Project description
grikod3 (Grikod, Gri Kod, Gray Code, GrayCode)
| PyPI |
|
| Conda |
|
| DOI |
|
| License: AGPL-3.0-or-later |
|
A Python library for converting binary numbers to Gray Code with ease.
Tanım (Türkçe)
Gri Kod: grikod3 İkili sayıları Gri Koda çevirir.
Description (English)
Gri Kod: grikod3 converts binary numbers to Gray Code.
Kurulum (Türkçe) / Installation (English)
Python ile Kurulum / Install with pip, conda, mamba
pip install grikod3 -U
python -m pip install -U grikod3
conda install bilgi::grikod3 -y
mamba install bilgi::grikod3 -y
- pip uninstall grikod3 -y
+ pip install -U grikod3
+ python -m pip install -U grikod3
Test Kurulumu / Test Installation
pip install -i https://test.pypi.org/simple/ grikod3 -U
Github Master Kurulumu / GitHub Master Installation
Terminal:
pip install git+https://github.com/WhiteSymmetry/grikod3.git
Jupyter Lab, Notebook, Visual Studio Code:
!pip install git+https://github.com/WhiteSymmetry/grikod3.git
# or
%pip install git+https://github.com/WhiteSymmetry/grikod3.git
Kullanım (Türkçe) / Usage (English)
import grikod3
grikod3.__version__
import grikod3
grikod3.ikili_2_gri_kod("1010")
import grikod3
def main():
# Binary numbers: ikili sayılar
binary_numbers = ["0", "1", "10", "11", "100", "101", "1111"]
for binary in binary_numbers:
try:
gray_code = grikod3.ikili_2_gri_kod(binary)
print(f"Binary: İkili: {binary} -> Gri Kod: {gray_code}")
except grikod3.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 grikod3
def main():
print("🌟 Gri Kod Dönüştürücü - grikod3 Paketi ile")
print("Geçerli bir ikili sayı girin (örneğin: 1101)")
print("Çıkmak için 'q' yazın.\n")
while True:
user_input = input("İkili sayı: ").strip()
if user_input.lower() == 'q':
print("👋 Çıkılıyor. İyi günler!")
break
try:
gray_code = grikod3.ikili_2_gri_kod(user_input)
print(f"✅ Gri Kod: {gray_code}\n")
except grikod3.InvalidBinaryError as e:
print(f"❌ Giriş Hatası: {e}\n")
except Exception as e:
print(f"⚠️ Beklenmeyen hata: {e}\n")
if __name__ == "__main__":
main()
import grikod3
if __name__ == "__main__":
print("🚀 grikod3 Etkileşimli Moduna Hoş Geldiniz!")
grikod3.run_interactive_converter()
Development
# Clone the repository
git clone https://github.com/WhiteSymmetry/grikod3.git
cd grikod3
# 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/WhiteSymmetry/grikod3.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). grikod3 [Data set]. WorkflowHub. https://doi.org/10.48546/workflowhub.datafile.13.1
Keçeci, M. (2025). grikod3. GitHub, PYPI, Anaconda, Zenodo. https://doi.org/10.5281/zenodo.15352206
Chicago
Keçeci, Mehmet. grikod3 [Data set]. WorkflowHub. https://doi.org/10.48546/workflowhub.datafile.13.1
Keçeci, Mehmet. "grikod3". Zenodo, 06 Mayıs 2025. https://doi.org/10.5281/zenodo.15352206
Lisans (Türkçe) / License (English)
This project is licensed under the AGPL-3.0-or-later License.
Pixi:
pixi init grikod3
cd grikod3
pixi workspace channel add https://repo.prefix.dev/bilgi --prepend
✔ Added https://repo.prefix.dev/bilgi
pixi add grikod3
✔ Added grikod3 >=0.1.0,<2
pixi install
pixi shell
pixi run python -c "import grikod3; print(grikod3.version)"
Çıktı: 0.1.0
pixi remove grikod3
conda install -c https://prefix.dev/bilgi grikod3
pixi run python -c "import grikod3; print(grikod3.version)"
Çıktı: 0.1.0
pixi run pip list | grep grikod3
grikod3 0.1.0
pixi run pip show grikod3
Name: grikod3
Version: 0.1.0
Summary: Converts binary numbers to Gray Code. grikod3 (Gray Code, Grey Code)
Home-page: https://github.com/WhiteSymmetry/grikod3
Author: Mehmet Keçeci
Author-email: Mehmet Keçeci <...>
License: AGPL-3.0-or-later 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file grikod3-0.1.2.tar.gz.
File metadata
- Download URL: grikod3-0.1.2.tar.gz
- Upload date:
- Size: 314.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e3dcba2838114e4924d0b1b63354102954fa2d895ddf4828c695cc003beaec4
|
|
| MD5 |
776d13fd897c2d64ae793d6b8ce18462
|
|
| BLAKE2b-256 |
3ad8c1ac65b603965f3ff8a58b90b210de7888e1c533dbc8a7781cec226e595f
|
Provenance
The following attestation bundles were made for grikod3-0.1.2.tar.gz:
Publisher:
workflow.yml on WhiteSymmetry/grikod3
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grikod3-0.1.2.tar.gz -
Subject digest:
8e3dcba2838114e4924d0b1b63354102954fa2d895ddf4828c695cc003beaec4 - Sigstore transparency entry: 2082461488
- Sigstore integration time:
-
Permalink:
WhiteSymmetry/grikod3@b836cbf4c4ebdd7e0a5fab5920f1f5c0fb75b03a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/WhiteSymmetry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@b836cbf4c4ebdd7e0a5fab5920f1f5c0fb75b03a -
Trigger Event:
push
-
Statement type:
File details
Details for the file grikod3-0.1.2-py3-none-any.whl.
File metadata
- Download URL: grikod3-0.1.2-py3-none-any.whl
- Upload date:
- Size: 311.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9bb2384c3b6765dd1d527e6469de6de3442f8fdcc10b66928121440dee82824
|
|
| MD5 |
262607f9a54af3e650531864457e2c9d
|
|
| BLAKE2b-256 |
56e8dc5e26795f910811e13454c452d5591221af1156341f91d408cfdacdf057
|
Provenance
The following attestation bundles were made for grikod3-0.1.2-py3-none-any.whl:
Publisher:
workflow.yml on WhiteSymmetry/grikod3
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
grikod3-0.1.2-py3-none-any.whl -
Subject digest:
c9bb2384c3b6765dd1d527e6469de6de3442f8fdcc10b66928121440dee82824 - Sigstore transparency entry: 2082461503
- Sigstore integration time:
-
Permalink:
WhiteSymmetry/grikod3@b836cbf4c4ebdd7e0a5fab5920f1f5c0fb75b03a -
Branch / Tag:
refs/heads/main - Owner: https://github.com/WhiteSymmetry
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
workflow.yml@b836cbf4c4ebdd7e0a5fab5920f1f5c0fb75b03a -
Trigger Event:
push
-
Statement type: