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.2.tar.gz (4.9 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.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: minicem-1.0.2.tar.gz
  • Upload date:
  • Size: 4.9 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.2.tar.gz
Algorithm Hash digest
SHA256 459bd2ba98e5123215cb0a435ba615441daa6a6f5a611baa2654dbfc726e12f8
MD5 9eca56dfbc12cb851d16ded5da56d01b
BLAKE2b-256 741731f6a0b3ac9ca874bf1713f22758b69e3e710c84fbc147039e0ada8f9778

See more details on using hashes here.

File details

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

File metadata

  • Download URL: minicem-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0407918a17ae28cc7e4e85df4ff9facac0fe2b83293f62049768309b7745eb4a
MD5 e54a11de1d74a5be00ac948adea95bd0
BLAKE2b-256 5f384557cb09926757af234889172b9ea198dc53e671263392fe34def64f0fd3

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