Skip to main content

Keçeci Binomial Squares (Keçeci Binom Kareleri): Keçeci's Arithmetical Square (Keçeci Aritmetik Karesi, Keçeci'nin Aritmetik Karesi)

Keçeci Binomial Shapes: Keçeci Binomial Şekilleri

Keçeci-Narayana Shapes: Keçeci-Narayana Şekilleri

Keçeci Binomial Squares (Keçeci Binom Kareleri) Keçeci Binomial Squares (Keçeci Binom Kareleri)

PyPI version License: AGPL-3.0 license

DOI DOI

Authorea DOI

WorkflowHub DOI

Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge Anaconda-Server Badge

Open Source Documentation Status

OpenSSF Best Practices

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


PyPI PyPI version
Conda conda-forge version
DOI DOI
License: AGPL-3.0 license License


Description / Açıklama

Keçeci Binomial Squares (Keçeci Binom Kareleri): Keçeci's Arithmetical Square (Keçeci Aritmetik Karesi, Keçeci'nin Aritmetik Karesi):

Keçeci Binomial Shapes: Keçeci Binomial Şekilleri

Keçeci Binomial Squares (Keçeci Binom Kareleri): The Keçeci Binomial Square is a series of binomial coefficients forming a square or other geometric shapes region within Khayyam (مثلث خیام), Pascal, Binomial Triangle, selected from a specified starting row with defined size and alignment.

Keçeci Binom Karesi, Hayyam (مثلث خیام), Pascal, Binomial üçgeni içinde belirli bir başlangıç satırından itibaren, seçili boyut ve hizalamada bir kare veya diğer geometrik şekiller oluşturan binom katsayıları serisidir.

0.1.8: Keçeci-Narayana Shapes: Keçeci-Narayana Şekilleri


Installation / Kurulum

conda install bilgi::kececisquares -y

pip install kececisquares

https://anaconda.org/bilgi/kececisquares

https://pypi.org/project/kececisquares/

https://github.com/WhiteSymmetry/kececisquares

https://zenodo.org/records/15411671

https://zenodo.org/records/


Usage / Kullanım

Example

import kececisquares as ks

# Manuel parametre dict'i oluştur
test_params = {
    "triangle_source": "binomial",
    "num_rows": 12,
    "region_size": 4,
    "start_row_0idx": 5,
    "region_type": "square",
    "shape_type": "hexagon",
    "alignment": "center",
    "is_filled": True,
    "show_numbers": True,
    "save_plot": False,
    "save_path": None,
    "export_csv": False,
    "export_json": False,
    "csv_path": None,
    "json_path": None,
    "narayana_shape_type": None,
    "narayana_width": None,
    "region_label": "Square-Kare"
}

# Tek satırda çalıştır
ks.generate_full_report(test_params)
import matplotlib.pyplot as plt
import kececisquares as ks
from kececisquares import get_user_parameters, generate_full_report

# 1. Kullanıcıdan parametreleri al
params = get_user_parameters()

# 2. Parametre geçerliyse görselleştirmeyi başlat
if params:
    try:
        print("\n⏳ Keçeci Visualizer çalışıyor...")
        report = ks.generate_full_report(params)
        
        # 3. Sonuçları özetle
        print("\n" + "="*50)
        print("📦 OLUŞTURULAN ÇIKTILAR")
        print("="*50)
        print(f"  🔹 Seçilen Eleman: {report['statistics']['count']}")
        print(f"  🔹 Toplam Değer  : {report['statistics']['sum']:,}")
        
        for key in ("plot", "csv", "json"):
            if report.get(key):
                print(f"  ✅ {key.upper():<5}: {report[key]}")
                
        print("="*50)
        print("🎉 İşlem başarıyla tamamlandı.")
        
    except Exception as e:
        print(f"\n❌ Hata oluştu: {e}")
import matplotlib.pyplot as plt
import kececisquares as ks
from kececisquares import (
    get_user_parameters, 
    generate_binomial_triangle, 
    generate_narayana_triangle, 
    draw_kececi_region, 
    export_to_csv, 
    export_to_json, 
    calculate_region_statistics
)

# 1. Parametre al
params = get_user_parameters()
if not params:
    exit("❌ Parametre alınamadı.")

# 2. Üçgeni oluştur
if params["triangle_source"] == "narayana":
    triangle = generate_narayana_triangle(params["num_rows"])
else:
    triangle = generate_binomial_triangle(params["num_rows"])

# 3. Görselleştir (5 değer döner: fig, ax, series_data, indices, total_value)
result = ks.draw_kececi_region(
    triangle_data=triangle,
    num_rows=params["num_rows"],
    region_size=params["region_size"],
    start_row_0based=params["start_row_0idx"],
    region_type=params["region_type"],
    shape_to_draw=params["shape_type"],
    alignment=params["alignment"],
    is_filled=params["is_filled"],
    show_values=params["show_numbers"],
    triangle_source=params["triangle_source"],
    narayana_shape_type=params.get("narayana_shape_type"),
    narayana_width=params.get("narayana_width"),
    show_plot=False  # Manuel kontrol için False
)

if result[0] is None:
    exit("❌ Görselleştirme başarısız.")

fig, ax, series_data, indices, total = result

# 4. İstatistikleri hesapla
stats = calculate_region_statistics(series_data, params["region_label"])
print(f"\n📊 Toplam: {total:,} | Eleman: {len(series_data)} | Ortalama: {stats['mean']:.2f}")

# 5. Dışa Aktar (İsteğe bağlı)
if params.get("csv_path"):
    ks.export_to_csv(series_data, indices, params["csv_path"])
if params.get("json_path"):
    payload = {"series": series_data, "stats": stats, "config": params}
    ks.export_to_json(payload, params["json_path"])

# 6. Plot'u kaydet ve göster
if params.get("save_path"):
    fig.savefig(params["save_path"], dpi=200, bbox_inches="tight")
    print(f"✅ PNG kaydedildi: {params['save_path']}")

plt.show()
#!/usr/bin/env python3
"""Quick test for the fixes."""

from kececisquares import (
    generate_binomial_triangle,
    kececi_binomial_square,
    draw_shape_on_axis,
    draw_kececi_region
)
import matplotlib.pyplot as plt

print("🔧 Testing fixes...")

# Test 1: Function signature
tri = generate_binomial_triangle(10)
try:
    series, total, indices = kececi_binomial_square(tri, 4, 5, "center")
    print(f"✅ kececi_binomial_square: OK ({len(series)} values, total={total})")
except TypeError as e:
    print(f"❌ kececi_binomial_square: {e}")

# Test 2: draw_shape_on_axis with RegularPolygon
try:
    fig, ax = plt.subplots()
    draw_shape_on_axis(ax, 0, 0, "hexagon", 0.5, "gold", "black")
    plt.close(fig)
    print("✅ draw_shape_on_axis: OK")
except TypeError as e:
    print(f"❌ draw_shape_on_axis: {e}")

# Test 3: Full visualization
try:
    result = draw_kececi_region(
        triangle_data=tri, num_rows=10, region_size=4, start_row_0based=5,
        region_type="square", show_plot=False
    )
    if result[0] is not None:
        print("✅ draw_kececi_region: OK")
        plt.close(result[0])
    else:
        print("❌ draw_kececi_region: returned None")
except Exception as e:
    print(f"❌ draw_kececi_region: {e}")

print("\n🎉 All tests completed!")
from kececisquares import generate_full_report, print_triangle_matrix

# Örnek 1: Tek fonksiyonla tam rapor
params = {
    "triangle_source": "binomial",
    "num_rows": 15,
    "region_size": 4,
    "start_row_0idx": 5,
    "region_type": "square",
    "alignment": "center",
    "save_path": "output.png",
    "csv_path": "output.csv", 
    "json_path": "output.json",
}
result = generate_full_report(params)
print(f"📁 Generated: { {k:v for k,v in result.items() if v} }")

# Örnek 2: Sadece matris yazdırma
from kececisquares import generate_binomial_triangle, print_triangle_matrix
tri = generate_binomial_triangle(10)
print_triangle_matrix(tri, title="Pascal Triangle (10 rows)")


Keçeci Squares Example

Keçeci Squares Example

Keçeci Squares Example

Keçeci Squares Example

Keçeci Squares Example

Keçeci Squares Example

Keçeci Squares Example



License / Lisans

This project is licensed under the AGPL3.0-or-later License. See the LICENSE file for details.

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

@misc{kececi_2025_15411670,
  author       = {Keçeci, Mehmet},
  title        = {kececisquares},
  month        = may,
  year         = 2025,
  publisher    = {GitHub, PyPI, Anaconda, Zenodo},
  version      = {0.1.0},
  doi          = {10.5281/zenodo.15411670},
  url          = {https://doi.org/10.5281/zenodo.15411670},
}

@misc{kececi_2025_15425855,
  author       = {Keçeci, Mehmet},
  title        = {The Keçeci Binomial Square: A Reinterpretation of
                   the Standard Binomial Expansion and Its Potential
                   Applications
                  },
  month        = may,
  year         = 2025,
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.15425855},
  url          = {https://doi.org/10.5281/zenodo.15425855},
}

APA

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

Keçeci, M. (2025). Keçeci's Arithmetical Square. Authorea. June, 2025. https://doi.org/10.22541/au.175070836.63624913/v1

Keçeci, M. (2025). kececisquares. Zenodo. https://doi.org/10.5281/zenodo.15411670

Keçeci, M. (2025). The Keçeci Binomial Square: A Reinterpretation of the Standard Binomial Expansion and Its Potential Applications. https://doi.org/10.5281/zenodo.15425529

Chicago

Keçeci, Mehmet. kececisquares [Data set]. WorkflowHub, 2025. https://doi.org/10.48546/workflowhub.datafile.15.1

Keçeci, Mehmet. "Keçeci's Arithmetical Square". Authorea. June, 2025. https://doi.org/10.22541/au.175070836.63624913/v1

Keçeci, Mehmet. "kececisquares". Zenodo, 01 May 2025. https://doi.org/10.5281/zenodo.15411670

Keçeci, Mehmet. "The Keçeci Binomial Square: A Reinterpretation of the Standard Binomial Expansion and Its Potential Applications", 15 Mayıs 2025. https://doi.org/10.5281/zenodo.15425529


Pixi:

Pixi

pixi init kececisquares

cd kececisquares

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

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

pixi add kececisquares

✔ Added kececisquares >=...,<1

pixi install

pixi shell

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

Çıktı:

pixi remove kececisquares

conda install -c https://prefix.dev/channels/bilgi kececisquares

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

Çıktı:

pixi run pip list | grep kececisquares

kececisquares

pixi run pip show kececisquares

Name: kececisquares

Version:

Summary: Keçeci Squares

Home-page: https://github.com/WhiteSymmetry/kececisquares

Author: Mehmet Keçeci

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

License: GNU AFFERO GENERAL PUBLIC LICENSE

Copyright (c) 2025-2026 Mehmet Keçeci


  1. https://pypi.org/project/kececisquares/
  2. https://anaconda.org/bilgi/kececisquares
  3. https://prefix.dev/channels/bilgi/packages/kececisquares

Metadata

Release files for kececisquares 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kececisquares 0.1.9
File Size Uploaded
kececisquares-0.1.9.tar.gz 58.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kececisquares 0.1.9
File Interpreter ABI Platform
kececisquares-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 100.5 kB

Release files / kececisquares-0.1.9.tar.gz

Download URL kececisquares-0.1.9.tar.gz
Size 58.5 kB
Tags Source
SHA-256 checksum
How to use checksums
c1467e725e82f0cf8fa78ad7a26cdf5dc3b82b2f778a0e1fe7c46721d03b4e42
BLAKE2b-256 checksum
How to use checksums
d1adb5df58495447a91f1b1136fc5eb3c6bff32a9f2590319deee14ef225fb1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / kececisquares-0.1.9-py3-none-any.whl

Download URL kececisquares-0.1.9-py3-none-any.whl
Size 41.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3808757cd8dc17635e3c351e94214660b841034f9eadf634792274aaf42efe04
BLAKE2b-256 checksum
How to use checksums
dcc86d799c3fbcd595b20c5172c458cc7191c331f43f0114fa632e5e1f29150f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page