IDLite
IDLite は開発中のプロジェクトです。 予告なく、下位互換性のない変更を行います。
背景
IDLite は、 Unity でモバイルオンラインゲームを作成するときに、 Unity C# で JSON を 扱うのが面倒なのを解決してくれるツールです。
固い protocol を使いたい場合は protocol buffer や thrift や msgpack idl がありますが、 これらは効率的にデータをパックするために、 {“キー”: 値} という構造ではなくて、 配列中の位置に意味をもたせているため、効率よりも Web 系のカジュアルな開発スタイルを 重視する場合には使いにくいことがあります。
JSON schema もありますが、これも複雑で学習が難しいものです。
LitJSON など、 JSON を手軽に扱える C# のライブラリはありますが、 リフレクションやジェネリクスに制限のある iOS では動かないケースがあります。
IDLite は、この隙間の需要を満たすためのものです。
サンプル
IDL
// ドキュメントコメント
// 複数行書けます.
enum Color {
red = 1,
green = 2,
blue = 3
};
# 無視されるコメント
// ボール
class Ball {
// ボールの持ち主
string? owner;
// ボールの色
enum Color color;
// 座標
float x;
float y;
};
class Field {
List<Ball> balls;
};
生成されるコード
// This code is automatically generated.
// Don't edit this file directly.
using System;
using System.Collections.Generic;
namespace IDLite
{
/// <summary>
/// ドキュメントコメント
/// 複数行書けます.
/// </summary>
public enum Color
{
red = 1,
green = 2,
blue = 3
}
/// <summary>
/// ボール
/// </summary>
[Serializable]
public partial class Ball : IDLiteBase
{
/// <summary>
/// ボールの持ち主
/// </summary>
public string owner;
/// <summary>
/// ボールの色
/// </summary>
public Color color;
/// <summary>
/// 座標
/// </summary>
public double x;
public double y;
public Ball(string owner, Color color, double x, double y)
{
this.owner = owner;
this.color = color;
this.x = x;
this.y = y;
}
public Ball(Dictionary<string, object> dict)
{
this.owner = ParseNullableString(GetItem(dict, "owner"));
this.color = (Color)ParseInt(GetItem(dict, "color"));
this.x = ParseDouble(GetItem(dict, "x"));
this.y = ParseDouble(GetItem(dict, "y"));
}
public override string ToString()
{
return "Ball(owner=" + owner + ", color=" + color + ", x=" + x + ", y=" + y + ")";
}
}
[Serializable]
public partial class Field : IDLiteBase
{
public List<Ball> balls;
public Field(List<Ball> balls)
{
this.balls = balls;
}
public Field(Dictionary<string, object> dict)
{
this.balls = GetList<Ball>(dict, "balls", (object o) => { return new Ball((Dictionary<string, object>)o); });
}
public override string ToString()
{
return "Field(balls=" + balls + ")";
}
}
}
Metadata
Release files for idlite 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| idlite-0.0.11.tar.gz | 7.4 kB | Without provenance | Details for idlite-0.0.11.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| idlite-0.0.11-py3-none-any.whl | Python 3 | none | any | Details for idlite-0.0.11-py3-none-any.whl |
Total release size: 18.3 kB
Release files / idlite-0.0.11.tar.gz
| Download URL | idlite-0.0.11.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2915cf18bccabe8d51c287f87e0b9b43087c9f49267d5d4aa9707ae0bca49c6c
|
|
BLAKE2b-256 checksum How to use checksums |
face6b4e91e3ed5a36ceea868de5045f6888a7491ec12026ae50684a692179ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / idlite-0.0.11-py3-none-any.whl
| Download URL | idlite-0.0.11-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
25704891c8b436b2cbfd02191bd296f8ae77e16cafe97467738c4a456628086f
|
|
BLAKE2b-256 checksum How to use checksums |
1d18cbe72748d95b58022aa2f2c9b28fa762cce81953ab47049aef302fb11322
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for idlite 0.0.11
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.