2 个仓库
Automatic generation of hash methods for class instances, enabling use as dictionary keys or set members.
Distinguishing note: No candidate covers automatic hash method generation for data classes; closest is Object Key Validation which is unrelated.
Explore 2 awesome GitHub repositories matching programming languages & runtimes · Hashable Object Generators. Refine with filters or upvote what's useful.
Sourcery 是一个 Swift 代码生成工具,可自动处理重复的样板代码和协议一致性实现。它作为一个模板引擎,通过扫描源文件来生成结构化代码(如 Codable、Equatable 和 Hashable 实现),并基于标记协议和静态分析进行工作。 该项目提供了一个专门的 Mock 框架,用于为协议创建 Mock 对象,以便在测试期间跟踪函数调用并捕获参数。它还包括用于生成结构体 Lens、枚举 Case 集合以及精确属性级测试差异的实用程序。 该系统支持实时工作流,使用后台守护进程进行文件监控和自动代码重新生成。集成通过 YAML 驱动的配置文件和构建系统插件进行管理,以确保生成的代码在重构期间保持一致。
Automates the creation of hashing logic for types to remove manual boilerplate.
attrs is a Python library that automatically generates initialization, representation, equality, hashing, and ordering methods from declarative class attribute definitions. At its core, it provides a class decorator metaprogramming framework that intercepts class creation to rewrite the class body, producing dunder methods without manual boilerplate. The library includes a comprehensive attribute validation toolkit with built-in validators for type checks, range constraints, regex matching, length limits, and logical composition of validation rules. The library distinguishes itself through it
Generates hash methods for objects, enabling their use as dictionary keys or set members.