{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/14"}],"enrichment":{"capability":"Provides algebraic data types for Python, specifically sum types (tagged unions) that let you define and pattern-match over multiple constructor variants of a single type.","skillfed_tags":["algebraic-types","pattern-matching","functional-programming"],"use_cases":["Model domain types with multiple variants such as Result as Success or Failure, or AST nodes with different expression types","Write exhaustive pattern-matching functions over all constructor cases without risk of missing a case","Define state machines or state enums where each state can carry different associated data","Implement functional-style error handling with explicit Success and Error constructors","Build parsers or interpreters that need to represent different kinds of syntax tree nodes"],"what_it_does":"sumtypes brings algebraic data types to Python by implementing sum types (also called tagged unions), which let you define a type with multiple named constructor variants. Each variant can carry its own set of attributes. The package builds on attrs to provide attribute validation, defaults, and other features. You decorate a class with @sumtype, define constructors as class attributes, and then instantiate them by calling those constructors; the resulting objects track which constructor was used and can be pattern-matched over all cases.\n\nThe main use case is writing code that handles multiple distinct cases of a logical type in a type-safe, exhaustive way. Instead of using strings or integers to tag variants, sum types make the structure explicit and let the match decorator verify that all cases are handled. This is particularly useful in functional programming styles or when modeling domain logic with multiple states or alternatives.","worth_installing":"No. The package is abandoned (last commit 2021-11-30, no activity for 1718 days), and maintenance compatibility with current Python versions is unverified. For new projects, consider whether native language features or actively maintained alternatives better serve your needs."},"id":"sumtypes","links":{"html":"https://skillfed.io/packages/sumtypes","md":"https://skillfed.io/packages/sumtypes.md","pypi":"https://pypi.org/project/sumtypes/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2021-11-30","license_spdx":null,"license_treatment":"permissive","name":"sumtypes","python_support":"unspecified","summary":"Algebraic types for Python (notably providing Sum Types, aka Tagged Unions)"},"popularity":{"monthly_downloads":187040,"position":9972,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.1a6"}
