Skip to main content

A tiny, human-friendly text format.

Project description

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'}

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

minicem-1.0.3.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

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

minicem-1.0.3-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file minicem-1.0.3.tar.gz.

File metadata

  • Download URL: minicem-1.0.3.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.12

File hashes

Hashes for minicem-1.0.3.tar.gz
Algorithm Hash digest
SHA256 877974693b001900c6ba4dcee684741954df5681831ada553fb9cdac3ebdd1c4
MD5 873929a39c3db01ee7a9c67ecd9e32b1
BLAKE2b-256 80f3553bd90fd4347bd1da2b3625bbf85ad02ad653cef41207bba1e88b128e26

See more details on using hashes here.

File details

Details for the file minicem-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: minicem-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.12

File hashes

Hashes for minicem-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ca2743ecc0485f8e65496a8676350091d002efc82595b55038a95cda85894b5b
MD5 7e0fb8d645108d38faf4f5deff256060
BLAKE2b-256 1c26e9560c0fc0309f4fc0d20a8afeb639dfbe48171bbfa4835294ad4cd8c712

See more details on using hashes here.

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