awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectAboutHow we rankPressMCP server
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
spf13 avatar

spf13/cast

0
View on GitHub↗
3,976 stars·329 forks·Go·MIT·4 views

Cast

Cast is a Go type conversion library and data type casting utility designed to transform various primitive data types into specific target formats. It functions as a primitive type transformer that manages the conversion of basic Go types while handling incompatible data.

The library provides mechanisms for dynamic type handling, allowing the system to process untyped or interface data and safely cast values into concrete types during runtime. It includes logic to distinguish between successful zero-value results and failed conversions through explicit error reporting and validation.

Features

  • Primitive Type Converters - Provides utilities for transforming values between basic primitive types like strings, integers, floats, and booleans.
  • Data Type Casting - Provides a comprehensive utility for casting data types with built-in validation and error handling.
  • Conversion Validation - Convert data to a target type and return an explicit error to distinguish failed conversions from successful zero values.
  • Dynamic Type Casting - Manages untyped or interface data in Go by safely casting values into usable concrete types during runtime.
  • Interface-Based Data Handling - Accepts empty interfaces to allow the system to process any arbitrary data type before attempting a cast.
  • Primitive Type Converters - Converts various primitive data types to a specific target format within Go while handling incompatible types.
  • Primitive Type Transformers - Safely casts various basic Go data types into specific target formats.
  • Type-Based Dispatching - Uses Go type switches to dynamically select the appropriate conversion logic based on the input's runtime type.
  • Zero-Value Fallbacks - Returns the default value of a target type when a conversion fails to prevent application crashes.
  • Static Conversion Paths - Defines static conversion paths between numeric and string primitives to ensure consistent data transformation.
  • Data Type Validation - Ensures data conforms to expected Go types through conversion attempts and explicit error reporting.
  • Error Wrapping - Implements custom error wrapping to distinguish between invalid input data and successful zero-value conversion results.
  • Development Utilities - Safe data type conversion library.

Star history

Star history chart for spf13/castStar history chart for spf13/cast

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does spf13/cast do?

Cast is a Go type conversion library and data type casting utility designed to transform various primitive data types into specific target formats. It functions as a primitive type transformer that manages the conversion of basic Go types while handling incompatible data.

What are the main features of spf13/cast?

The main features of spf13/cast are: Primitive Type Converters, Data Type Casting, Conversion Validation, Dynamic Type Casting, Interface-Based Data Handling, Primitive Type Transformers, Type-Based Dispatching, Zero-Value Fallbacks.

What are some open-source alternatives to spf13/cast?

Open-source alternatives to spf13/cast include: hapijs/joi — Joi is a JavaScript data validation library used to define schemas that validate, cast, and sanitize data objects. It… phuocng/1loc — 1loc is a JavaScript utility library and multifaceted toolkit providing a collection of single-line functions for… vyperlang/vyper — Vyper is a security-focused, typed programming language and compiler designed for creating smart contracts that… trekhleb/learn-python — This project is an educational resource designed for learning the Python programming language. It serves as a tutorial… spatie/data-transfer-object — This library provides a framework for defining typed, immutable data structures in PHP. It enables developers to… processing/processing — Processing is a creative coding environment and Java graphics library designed for writing visual sketches that…

Open-source alternatives to Cast

Similar open-source projects, ranked by how many features they share with Cast.
  • hapijs/joihapijs avatar

    hapijs/joi

    21,192View on GitHub↗

    Joi is a JavaScript data validation library used to define schemas that validate, cast, and sanitize data objects. It functions as an object schema validator and parser, ensuring that input data matches specific types and formats before it is processed by an application. The library features a conditional validation engine capable of dynamic schema enforcement, where validation logic and dependencies change based on the values of other keys within an object. It also serves as a data casting and sanitization tool, transforming input values into target types and removing sensitive keys from the

    JavaScripthapijavascriptschema
    View on GitHub↗21,192
  • phuocng/1locphuocng avatar

    phuocng/1loc

    6,738View on GitHub↗

    1loc is a JavaScript utility library and multifaceted toolkit providing a collection of single-line functions for common mathematical, string, date, and geometric operations. It functions as a set of functional programming helpers and data validation predicates designed to perform atomic transformations and validations. The project includes a geometry math library for calculating distances, angles, and spatial overlaps between points and rectangles, alongside a text manipulation library for casting, capitalizing, and analyzing string content. The toolkit covers broader capability areas inclu

    MDXeleventyjavascriptjavascript-utils
    View on GitHub↗6,738
  • spatie/data-transfer-objectspatie avatar

    spatie/data-transfer-object

    2,226View on GitHub↗

    This library provides a framework for defining typed, immutable data structures in PHP. It enables developers to construct structured objects from raw input arrays, ensuring consistent data shapes and schema integrity across different layers of an application. By enforcing strict property types and validation rules during instantiation, the library prevents invalid data states and simplifies the handling of complex information. The project distinguishes itself through its use of attribute-driven metadata, which allows for property renaming, custom validation, and serialization logic directly

    PHPobjectsphpvalue
    View on GitHub↗2,226
  • trekhleb/learn-pythontrekhleb avatar

    trekhleb/learn-python

    18,058View on GitHub↗

    This project is an educational resource designed for learning the Python programming language. It serves as a tutorial repository and programming guide, providing a collection of annotated scripts, code examples, and cheatsheets to help users master syntax and core fundamentals. The resource focuses on moving from basic language syntax to advanced implementation, with a particular emphasis on object-oriented programming, the use of the Python standard library, and scripting automation for business workflows. The content covers a broad range of programming capabilities, including control flow

    Pythonlearninglearning-by-doinglearning-python
    View on GitHub↗18,058
  • See all 30 alternatives to Cast→