Madtypes

Latest version: v0.0.9

Safety actively analyzes 682404 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.0.9

What's Changed
- :hammer_and_wrench: list and set usage 6r17 in https://github.com/6r17/madtypes/pull/10

**Full Changelog**: https://github.com/6r17/madtypes/compare/v0.0.8...v0.0.9

0.0.8

What's Changed

Woaw ! This is a major refactor of the project. It piled up a bunch of features together from v0.0.1 to v0.0.7 and when I added the `Annotation` metaclass I realized how the project should've been properly written in the first place. There are few elements that have been dropped in favor of a overall more solid proposed code, for instance Immutable are not really the first aim of this package and since I didn't have put much mind into it, I didn't want to encourage it's usage.

However, I believe the new `MadType` metaclass should be the correct pythonic way of adding this feature in Python. The code feels way more maintainable now, and I'm really happy to put this release out so early :)

I'm not bumping into a `1.0.0` straight away, i'd like the software to live a little bit longer, it might get to `0.1.0` if a few weeks if the code looks stable.

Enjoy !

* Annotation support for dict by 6r17 in https://github.com/6r17/madtypes/pull/6
- :anger: `Annotation` is renamed `MadType`
- :nerd_face: `MadType` support for `dict`.
- :warning: drop `Immutable` since it's a poor proposal.
- :warning: drop `Schema` in favor of `(dict, metaclass=MadType)`.
- :hammer_and_wrench: refactor of tests which are now organized between integrity and json_schema
- :hammer_and_pick: `__init__` can be safely overwritten and type-check will still apply inside of it

**Full Changelog**: https://github.com/6r17/madtypes/compare/v0.0.7...v0.0.8

0.0.7

What's Changed
* Field subtraction by 6r17 in https://github.com/6r17/madtypes/pull/7
- :new: subtract_fields (*args: tuple[str])(class) allow to remove fields from a class. It can be used to dynamically create schemas based on existing work without creating multiple sources of truth.
- :hammer_and_wrench: extra parameter should raise a TypeError
- :hammer_and_wrench: type check for multi-inherited objects


**Full Changelog**: https://github.com/6r17/madtypes/compare/v0.0.6...v0.0.7

0.0.6

What's Changed
* Multiple inheritance by 6r17 in https://github.com/6r17/madtypes/pull/5
- :hammer_and_wrench: Multiple Inheritance should properly render to json-schema
- :hammer_and_wrench: Set should properly render to json_schema
- :hammer_and_wrench: Enum should properly render to json_schema
- :warning: __required python version bumped to 3.10 because class do not contain `__annotation__` in 3.9__


**Full Changelog**: https://github.com/6r17/madtypes/compare/v0.0.5...v0.0.6

0.0.5

What's Changed
* object validation by 6r17 in https://github.com/6r17/madtypes/pull/3
- :hammer_and_wrench: "Subscripted generics cannot be used with class and instance checks"
- :hammer_and_wrench: type_check when used with set or Optional
- :new: is_valid method is used on Schema class to allow validation that is dependent on multiple fields
- `is_value_compatible_with_annotation` has been renamed `type_check`
- Schema uses `type_check` whenever in should apply type checking
- tests for `type_check` (list, set, primitives)
- `schema` function has been renamed `json_schema`
- :new: pattern attribute on Annotation can be used to define regex validation
- setting a pattern attribute on an Annotation that is not a string or a byte will raise a `SyntaxError`
- Instantiating an Annotated item that has a pattern with a wrong value raise a `TypeError`
- pattern attribute is used by `json_schema`


**Full Changelog**: https://github.com/6r17/madtypes/compare/v0.0.4...v0.0.5

0.0.4

What's Changed
* Annotation by 6r17 in https://github.com/6r17/madtypes/pull/2
- Annotation metaclass allows to define additional properties on a `type` used with Schema
- Annotation.description is used in the generated json-schema
- Annotation overwrite the __new__ method of a class to do type-check

**Full Changelog**: https://github.com/6r17/madtypes/compare/v0.0.3...v0.0.4

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.