Skip to main content

minicem

Kompakt, insan tarafından okunabilir minik bir metin formatı ve Python için encoder/decoder fonksiyonları.

A tiny, human-friendly text format.

https://github.com/muslu/minicem

Ne işe yarar? / What is it for?

  • JSON kadar gürültülü değil, YAML kadar karmaşık değil.
    Not as noisy as JSON, not as complex as YAML.
  • Küçük config / prompt / ayar dosyalarını elle yazmak için ideal.
    Ideal for small configs, prompts and settings.
  • Daha az karakter ⇒ LLM / yapay zeka prompt’larında daha az token ⇒ daha ucuz ve hızlı.
    Fewer characters ⇒ fewer tokens in LLM / AI prompts ⇒ cheaper and faster.

Format Özeti / Format Summary

  • ✅ Dict ve list yapıları:
    • {key:val, key2:val2}
    • [1,2,3]
  • ✅ Kompakt bool ve None:
    • True -> +1
    • False -> +0
    • None -> _
  • ✅ Yorum desteği:
    • Tırnak dışındaki # sonrası yorum kabul edilir.
  • ✅ Tek satır veya çok satırlı (YAML benzeri) blok formatı
  • ✅ Basit Python tipleri:
    • dict, list, str, int, float, bool, None

  • minicem, aynı veride JSON compact’tan ~%15 daha kısa. (minicem is ~15% shorter than compact JSON for this example.)
  • LLM prompt’larında her karakter token maliyetine yaklaşır (In LLM prompts, fewer characters ≈ fewer tokens)
  • Daha ucuz istekler / cheaper requests (Daha hızlı yanıtlar / faster responses)
  • Uzun context kullanan uygulamalarda daha verimli / more efficient in long-context apps

Kurulum

pip install minicem

Örnek

from minicem import encode_mt, decode_mt

data = {
    "users": [
        {"id": 1, "name": "Ali", "active": True},
        {"id": 2, "name": "Veli", "active": False},
        {
            "id": 3,
            "name": "John Doe",
            "active": True,
            "meta": {"age": 32, "city": "New York"},
        },
    ],
    "nums": [1, 2, 3],
    "title": "Example Data",
}

# Python -> minicem
text = encode_mt(data)
print("MINICEM:")
print(text)

# minicem -> Python
decoded = decode_mt(text)
print("DECODED:")
print(decoded)

assert decoded == data

Çıktı

#MINICEM:
{users:[{id:1, name:Ali, active:+1},{id:2, name:Veli, active:+0},{id:3, name:"John Doe", active:+1, meta:{age:32, city:"New York"}}], nums:[1,2,3], title:"Example Data"}

#DECODED:
{'users': [{'id': 1, 'name': 'Ali', 'active': True}, {'id': 2, 'name': 'Veli', 'active': False}, {'id': 3, 'name': 'John Doe', 'active': True, 'meta': {'age': 32, 'city': 'New York'}}], 'nums': [1, 2, 3], 'title': 'Example Data'}

Release files for minicem 1.0.3

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

Source distribution (sdist)

Source distribution for minicem 1.0.3
File Size Uploaded
minicem-1.0.3.tar.gz 4.7 kB Details

Built distribution (wheel)

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

Total release size: 9.8 kB

Release files / minicem-1.0.3.tar.gz

Download URL minicem-1.0.3.tar.gz
Size 4.7 kB
Tags Source
SHA-256 checksum
How to use checksums
877974693b001900c6ba4dcee684741954df5681831ada553fb9cdac3ebdd1c4
BLAKE2b-256 checksum
How to use checksums
80f3553bd90fd4347bd1da2b3625bbf85ad02ad653cef41207bba1e88b128e26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.12

Release files / minicem-1.0.3-py3-none-any.whl

Download URL minicem-1.0.3-py3-none-any.whl
Size 5.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ca2743ecc0485f8e65496a8676350091d002efc82595b55038a95cda85894b5b
BLAKE2b-256 checksum
How to use checksums
1c26e9560c0fc0309f4fc0d20a8afeb639dfbe48171bbfa4835294ad4cd8c712
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.12

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.1

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