Saravanan666/pypi-org huggingface dataset:
Package: typed-configparser
typed-configparsertyped-configparser is an extension of the standard configparser module with support for typed configurations using dataclasses.
It leverages Python's type hints and dataclasses to provide a convenient way of parsing and validating configuration files.Features✓ Fully typed.✓ Use dataclasses to parse the configuration file.✓ Support for almost all python built-in data types -int,float,str,list,tuple,dictand complex data types usingUnionandOptional.✓ Built on top ofconfigparser, hence retains all functionalities ofconfigparser.✓ Support for optional values (optional values are automatically set toNoneif not provided).✓ Smarter defaults (see below).InstallationYou can installtyped_configparserusingpip:pipinstalltyped-configparserUsageexamples/basic.py# This is a complete example and should work as isfromtypingimportListfromtyped_configparserimportConfigParserfromdataclassesimportdataclass@dataclassclassBASIC:option1:intoption2:stroption3:floatoption4:List[str]config="""[BASIC]option1 = 10option2 = value2option3 = 5.2option4 = [foo,bar]"""parser=ConfigParser()parser.read_string(config)section=parser.parse_section(using_dataclass=BASIC)print(section)BASIC(option1=10,option2=value2,option3=5.2,option4=['foo','bar'])examples/unions_and_optionals.py# This is a complete example and should work as isfromtypingimportList,Union,Optional,Dict,Tuplefromtyped_configparserimportConfigParserfromdataclassesimportdataclass,field@dataclassclassDEFAULT_EXAMPLE:option1:intoption2:Union[List[Tuple[str,str]],List[int]]option3:Dict[str,str]=field(default_factory=lambda:{"default_key":"default_value"})option4:Optional[float]=Noneconfig="""[DEFAULT]option1 = 20option2 = default_value2[MY_SECTION_1]option2 = [10,20]option4 = 5.2[MY_SECTION_2]option2 = [(value2a, value2b), (value2c, value2b), (value2c, value2d)]option3 = {key: value}option4 = none"""parser=ConfigParser()parser.read_string(config)my_section_1=parser.parse_section(using_dataclass=DEFAULT_EXAMPLE,section_name="MY_SECTION_1")my_section_2=parser.parse_section(using_dataclass=DEFAULT_EXAMPLE,section_name="MY_SECTION_2")print(my_section_1)print(my_section_2)DEFAULT_EXAMPLE(option1=20,option2=[10,20],option3={'default_key':'default_value'},option4=5.2)DEFAULT_EXAMPLE(option1=20,option2=[('value2a','value2b'),('value2c','value2b'),('value2c','value2d')],option3={'key':'value'},option4=None)Checkexampledirectory for more examples.Defaultsconfigparserincludes sensible defaults options which allows you to declare a[DEFAULT]section in the config file for fallback values.typed_configparsergoes a step further and allows you to set a final (last) level of defaults at dataclass level.LicenseMIT License
Package: typedcsvsort
CSV SortFor sorting CSV files on disk that do not fit into memory. The merge sort algorithm is used to break up the original file into smaller chunks, sort these in memory, and then merge these sorted files.Example usage>>>fromcsvsortimportcsvsort>>># sort this CSV on the 5th(str) and 3rd(int) columns (columns are 0 indexed)>>>csvsort('test1.csv',[4,2],["str","int"])>>># sort this CSV with no header on 4th column and save results to separate file>>>csvsort('test2.csv',[3],["str"],output_file='test3.csv',has_header=False)>>># sort this TSV on the first column and use a maximum of 10MB per split>>>csvsort('test3.tsv',[0],["str"],max_size=10,delimiter='\t')>>># sort this CSV on the first column and force quotes around every field (default is csv.QUOTE_MINIMAL)>>>importcsv>>>csvsort('test4.csv',[0],["str"],quoting=csv.QUOTE_ALL)InstallSupports python 2 & 3:$pipinstallcsvsort$pip3installcsvsort
Package: typed-dataclass
Typed DataclassTyped Dataclass is a Python library providing a decorator for dataclasses that enables runtime type checking.InstallationUse the package managerpipto install typed-dataclass.pip install typed-dataclassUsageThis library should be used in conjunction with the@dataclasdecorator and should be placed
below@dataclass. On object initialization it checks types by usingtypeguardpackage. Internally this works by modifying
the__post__init__method of the dataclass.fromdataclassesimportdataclassfromtyped_dataclassimporttyped_dataclass@dataclass@typed_dataclassclassMyClass:my_field:intMyClass(12)# will succeedMyClass("a")# will failPre ValidationYou can also implement logic that is happening before Type checks defining__before_type_check__function:fromdataclassesimportdataclassfromtyped_dataclassimporttyped_dataclass@dataclass@typed_dataclassclassMyClass:my_int:intdef__before_type_check__(self):self.my_int=int(self.my_int)Testingpython -m unittest discover testsContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: typed-descriptors
typed-descriptors is a small library of descriptor classes featuring static and runtime typechecking, runtime validation, and other useful features.Static typechecking is compatible withPEP 484 type hints, and runtime typechecking is performed by thetyping-validationlibrary.ContentsInstallUsageAPIContributingLicenseInstallYou can install the latest release fromPyPIas follows:pip install --upgrade typed-descriptorsUsageClasses from thetyped_descriptorsmodule can be used to create statically typechecked descriptors which implement the following features:attributes with runtime typechecking on writeattributes with validation on writereadonly attributes (set once)cached propertiesTypechecking is compatible withPEP 484 type hints.
Runtime typechecking is performed by thetyping-validationlibrary.Below is a simple example displaying all features listed above:fromcollections.abcimportSequenceimportnetworkxasnx# type: ignorefromtyped_descriptorsimportAttr,PropclassLabelledKn:r"""
        A complete graph :math:`K_n` with readonly size and mutable labels,
        where the NetworkX graph object is computed lazily and cached.
    """n=Attr(int,lambdaself,n:n>=0,readonly=True)#   type ^^^       validation ^^^^^^  ^^^^^^^^^^^^^ attribute is readonlylabels=Attr(Sequence[str],lambdaself,labels:len(labels)==self.n)#        type ^^^^^^^^^^^^^            validation ^^^^^^^^^^^^^^^^^^^^^graph=Prop(nx.Graph,lambdaself:nx.complete_graph(self.n))#       type ^^^^^^^^    prop value ^^^^^^^^^^^^^^^^^^^^^^^^^def__init__(self,n:int,labels:Sequence[int]):# Setters for Attr instances take care of runtime typechecking and validation# for the arguments 'n' and 'labels' which have been passed to the constuctor.self.n=nself.labels=labelsmyobj=LabelledKn(3,["a","b","c"])# OKmyobj.labels=("x","y","z")# OKprint(myobj.graph.edges)# OK: EdgeView([(0, 1), (0, 2), (1, 2)])myobj.x=5# AttributeError (readonly descriptor)myobj.y=["a","b","c","d"]# ValueError (lenght of y is not 3)myobj.y=5# TypeError (type of y is not 'Sequence')myobj.y=[2,3,5]# TypeError (type of y is not 'Sequence[str]')APIFor the full API documentation, seehttps://typed-descriptors.readthedocs.io/ContributingPlease seeCONTRIBUTING.md.LicenseMIT © Hashberg Ltd.
Package: typeddict
TypedDictUseTypedDictreplacepydanticdefinitions.Why?frompydanticimportBaseModelclassUser(BaseModel):name:strage:int=Field(default=0,ge=0)email:Optional[str]user:User={"name":"John","age":30}# Type check, error!print(repr(user))In index.py or other framework, maybe you write the following code. And then got an type check error inAnnotated[Message, ...], because the type of{"message": "..."}is notMessage.classMessage(BaseModel):message:str@routes.http.post("/user")asyncdefcreate_user(...)->Annotated[Message,JSONResponse[200,{},Message]]:...return{"message":"Created successfully!"}UsageUseAnnotatedto provide extra information topydantic.Field. Other than that, everything conforms to the general usage ofTypedDict. Usingto_pydanticwill create a semantically equivalent pydantic model. You can use it in frameworks likeindex.py/fastapi/xpresso.fromtyping_extensionsimportAnnotated,NotRequired,TypedDictimporttypeddictfromtypeddictimportExtra,MetadataclassUser(TypedDict):name:strage:Annotated[int,Metadata(default=0),Extra(ge=0)]email:NotRequired[Annotated[str,Extra(min_length=5,max_length=100)]]classBook(TypedDict):author:NotRequired[User]user:User={"name":"John","age":30}# Type check, pass!print(repr(user))# Then use it in fastapi / index.py or other frameworksUserModel=typeddict.to_pydantic(User)print(repr(UserModel.__signature__))print(repr(UserModel.parse_obj(user)))book:Book={"author":user}# Type check, pass!print(repr(book))# Then use it in fastapi / index.py or other frameworksBookModel=typeddict.to_pydantic(Book)print(repr(BookModel.__signature__))print(repr(BookModel.parse_obj(book)))castSometimes you may not need a pydantic model, you can directly use typeddict to parse the data.importtypeddictclassUser(TypedDict):name:strage:Annotated[int,Metadata(default=0),Extra(ge=0)]email:NotRequired[Annotated[str,Extra(min_length=5,max_length=100)]]user=typeddict.cast(User,{"name":"John","age":30,"unused-info":"....."})print(repr(user))
Package: typeddict-validator
Validates Python’s TypedDict日本語の説明はこちら / Description in
JapaneseAboutThis is a utility to validate a dict object using TypedDict. It
recursively checks whether the dict has necessary keys and the values
has appropriate type. It will be useful when you deserialize the json or
yaml data, such as an API request or any file.Currently supported types are generic types and Union (including
Optional).RequirementsPython 3.10 or higherInstallationhttps://pypi.org/project/typeddict-validator/pipinstalltypeddict-validatorUsage>>>fromtypingimportTypedDict>>>fromtypeddict_validatorimportvalidate_typeddict>>>>>>PersonDict=TypedDict("PersonDict",{"name":str,"age":int,"interests":list[str]})>>>>>>person={"name":"Taro Yamada","age":30,"interests":["programming","painting"]}>>>>>>ifvalidate_typeddict(person,PersonDict):...print("It's a PersonDict!")It's a PersonDict!By default, it will raise an error when the dict object does not match.>>>robot={"name":"Doraemon"}>>>>>>ifvalidate_typeddict(robot,PersonDict):...print("It's a PersonDict!")Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/app/typeddict_validator/validate.py", line 37, in validate_typeddict
    raise DictMissingKeyException(key=k)
typeddict_validator.validate.DictMissingKeyExceptionYou can usesilent=Trueoption not to raise an error.>>>ifnotvalidate_typeddict(robot,PersonDict,silent=True):...print("It's not a PersonDict!!")It's not a PersonDict!!Seetypeddict_validator/validate_test.pyfor more examples.Testsdockerrun--mountsource=$(pwd),target=/app,type=bindpython:latestpython3-munittest-v/app/typeddict_validator/validate_test.py
Package: typed-dotenv
typed_dotenvParse .env files with typesInstallationpipinstalltyped_dotenvTo use...load_into:pip install typed_dotenv[pydantic]YAML literals:pip install typed_dotenv[yaml]TOML literals:pip install typed_dotenv[toml]UsageWith the following.envfile:GITHUB_TOKEN="jkjkimnotputtinmygithubpersonaltokeninamodulesexamples"DEBUG_IN_PRODUCTION=Falseimporttyped_dotenvsecrets=typed_dotenv.load(".env")You'll see here that nothing has changed much:secrets['DEBUG_IN_PRODUCTION']is still astr.That's because you need to explicitly define what syntax your .env uses.
Add the following at the top of your.env:# values: pythonGITHUB_TOKEN="jkjkimnotputtinmygithubpersonaltokeninamodulesexamples"DEBUG_IN_PRODUCTION=FalseNow the following will not raise an assertion error:importtyped_dotenvsecrets=typed_dotenv.load()# ".env" is the default valueasserttype(secrets["DEBUG_IN_PRODUCTION"])isboolWe used python-style values, but other syntaxes are available:values: yaml 1.2to use YAML 1.2 literalspip install typed_dotenv[yaml]values: yaml 1.1to use YAML 1.1 literals (differences from YAML 1.2).For now, this has the same effect asvalues: yaml 1.2pip install typed_dotenv[yaml]values: tomlto use TOML literals:12:35:24resolves to adatetime.time, etc.pip install typed_dotenv[toml]values: jsonto use JSON literalsNow, up until now, we've only seen how to get those variables into adict.The recommended way: using Pydantic'sBaseModelwithload_intoThis way, you have IDE autcompletion and type checking, and pydantic will raise errors if the value is not of the right type:frompydanticimportBaseModelimporttyped_dotenvclassSecrets(BaseModel):GITHUB_TOKEN:strDEBUG_IN_PRODUCTION:boolsecrets=typed_dotenv.load_into(Secrets,filename="my_dotenv.env")Using withos.getenvYou might still want to load these values as environment variables, but need to get type coersion. This time, since the value is gotten viaos.getenv,typed_dotenvdoes not know the file's contents. The syntax used is thus declared when coercing types:fromosimportgetenvimporttyped_dotenvprint(os.getenv("MY_ENV_VARIABLE"))print(typed_dotenv.coerce(os.getenv("MY_ENV_VARIABLE"),typed_dotenv.VALUE_FORMATS.python_literal))You can also make yourself a function to avoid declaring the values' format each time:defenv_coerce(key:str)->Any:returntyped_dotenv.coerce(os.getenv(key),typed_dotenv.VALUE_FORMATS.python_literal)And use it like so:print(env_coerce("MY_ENV_VARIABLE"))
Package: typed-environment-configuration
Typed Environment ConfigurationEnvironment-based configurationConverts environmental variables fetched through os.environ to Python-native variables with specified typesFree software: MIT licenseDocumentation:https://typed-environment-configuration.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-10-11)First release on PyPI.
Package: typed-envs
typed_envs is used to create specialized EnvironmentVariable objects that behave exactly the same as any other instance of thetypused to create them.typed_envs is used for:defining your envs in a readable, user friendly wayenhancing type hints for the returned instancesenhancing __repr__ of the returned instance with extra contextual informationIn the example below,some_varcan be used just like as any otherintobject.` import typed_envs some_var =typed_envs.create_env("SET_WITH_THIS_ENV",int, 10) >>> isinstance(some_var, int) True >>> isinstance(some_var, EnviromentVariable) True `There are only 2 differences betweensome_varandint(10):some_varwill properly type check as an instance of bothintandEnvironmentVariablesome_var.__repr__()will include contextual information about theEnvironmentVariable.` >>> some_var<EnvironmentVariable[name=`SET_WITH_THIS_ENV`,type=int, default_value=10, current_value=10, using_default=True]> >>> str(some_var) "10" >>> some_var + 5 15 >>> 20 / some_var 2 `
Package: typedframe
typedframeTyped wrappers over pandas DataFrames with schema validation.TypedDataFrameis a lightweight wrapper over pandasDataFramethat provides runtime schema validation and can be used to establish strong data contracts between interfaces in your Python code.The goal of the library is to reveal and make explicit all unclear or forgotten assumptions about your DataFrame.Checkthe Official Documentation.QuickstartInstall typedframe library:pip install typedframeAssume an overly simplified preprocessing code like this:defpreprocess(df:pd.DataFrame)->pd.DataFrame:df=df.copy()c1_min,c1_max=df['col1'].min(),df['col1'].max()df['col1']=0ifc1_min==c1_maxelse(df['col1']-c1_min)/(c1_max-c1_min)df['month']=df['date'].dt.monthdf['comment']=df['comment'].str.lower()returndfTo addtypedframeschema support for this transformation we will define two schema classes - for the input and for the output:importnumpyasnpfromtypedframeimportTypedDataFrame,DATE_TIME_DTYPEclassMyRawData(TypedDataFrame):schema={'col1':np.float64,'date':DATE_TIME_DTYPE,'comment':str,}classPreprocessedData(MyRawData):schema={'month':np.int8}Then let's modify thepreprocessfunction to take a typed wrapperMyRawDataas input and returnPreprocessedData:defpreprocess(data:MyRawData)->PreprocessedData:df=data.df.copy()c1_min,c1_max=df['col1'].min(),df['col1'].max()df['col1']=0ifc1_min==c1_maxelse(df['col1']-c1_min)/(c1_max-c1_min)df['month']=df['date'].dt.monthdf['comment']=df['comment'].str.lower()returnPreprocessedData.convert(df)As you can see the actual DataFrame can be accessed via the.dfattribute of the Typed DataFrame.Now clients of thepreprocessfunction can easily check what are the inputs and outputs without the need to look at its internals.
And if there are some unforseen changes in the data an exception will be thrown before the actual function will be invoked.Let's check:importpandasaspddf=pd.DataFrame({'col1':[0.1,0.2],'date':['2021-01-01','2022-01-01'],'comment':['foo','bar']})df.date=pd.to_datetime(df.date)bad_df=pd.DataFrame({'col1':[1,2],'comment':['foo','bar']})df2=preprocess(MyRawData(df))df3=preprocess(MyRawData(bad_df))The first call was successful.
But when we've tried to pass a wrong dataframe as input we've got the following error:AssertionError: Dataframe doesn't match schema
Actual: {'col1': dtype('int64'), 'comment': dtype('O')}
Expected: {'col1': <class 'numpy.float64'>, 'date': dtype('<M8[ns]'), 'comment': <class 'object'>}
Difference: {('col1', <class 'numpy.float64'>), ('date', dtype('<M8[ns]'))}Supported versionsTested on the following versions:Python: 3.9numpy: 1.20, 1.21, 1.22pandas: 1.2, 1.3, 1.4Manually test in your environmentgitclonegit@github.com:areshytko/typedframe.gitcdtypedframepipinstall-rrequirements.txtpytestReleasesv0.7.0New FunctionalityNaNs in categoricals are not allowed and cause an assertion.
Motivation: Explicit use of pd.Categorical(df.col, categories=[MyTypedFrame.schema['col']]) conversion can
introduce such NaNs and bypass the type check.
See thepd.Categorical documentation.v0.6.1New Functionalityupdated docstringsBreaking changes
Package: typed-graph
TypedGraphIs a staticly typed graph library.
This is a cross compatible port ofTypedGraph.TypedGraph is build to provide an easy to use interface for manipulating an maintaining graphs with a rigid schema.Getting startedinstall usingpip install typed_graphsee theexample folderfor information on how to create your first project using TypedGraph.Note that making and maintianing large static graphs can be time consuming, so using liketyped_graph_cliwill make the library significantly easier to maintianDevelopmentTo run a local instance of the library:.../typed_graph_py> pip install -e .This will import the library using a symlink, so changes in the directory will be propegated to the python installationNow it can be used as normalimport type_graphBuild releaseFirst install twinepip install twineThen to build the release run:python setup.py sdist bdist_wheelThen test that the build is valid:twine check dist/*And finally upload to PyPi with:twine upload dist/*To avoid having to retype your initials everytime setup a file in$HOME/.pypirc[pypi]
username = <username>
password = <password>Note: your password will be stored in plain text!This is also compatible with PyPi access tokens[pypi]
username = __token__
password = pypi-...
Package: typed-graphene
typed-graphenetyped-graphene is a library that provides a type-safe interface for graphene-python.ExamplesType-Safe QueryfromgrapheneimportObjectType,Field,StringclassExampleQuery(ObjectType):foo=Field(FooType,required=True,input_a=String(),input_b=String(required=True))defresolve_foo(self,info,**data)->FooType:input_a=data.get("input_a")# anyinput_b=data["input_b"]# anygraphene examplefromtypingimportTypedDict,NotRequiredfromgrapheneimportFieldfromtyped_grapheneimportTypedFieldclassFooFieldArguments(TypedDict):input_a:NotRequired[str]input_b:strclassExampleQuery(ObjectType):# `required=True` by defaultfoo=TypedField(FooType,**FooFieldArguments.__annotations__)defresolve_foo(self,info,**data:Unpack[FooFieldArguments])->FooType:input_a=data.get("input_a")# str | Noneinput_b=data["input_b"]# strtyped-graphene exmapleType-Safe MutationfromgrapheneimportMutation,Field,String,BooleanclassExample(Mutation):classArguments:input_a=String()input_b=String(required=True)ok=Field(Boolean,required=True)errors=Field(ExampleErrors)@classmethoddefmutate(cls,root,info,**data)->Self:input_a=data.get("input_a")# anyinput_b=data["input_b"]# anyreturncls(ok=True)graphene examplefromdataclassesimportdataclassfromtypingimportTypedDict,NotRequiredfromtyped_grapheneimportTypedBaseMutation,TypedFieldclassExample(TypedBaseMutation):classTypedArguments(TypedBaseMutation.TypedArguments):input_a:NotRequired[str]input_b:strok=TypedField(bool)# concat type with ` | None` for `required=False`errors=TypedField(ExampleErrors|None)@classmethoddefvalidate(cls,root,info,**data:Unpack[TypedArguments])->ExampleErrors:errors=ExampleErrors()errors.input_a="error"# no errorreturnerrors@classmethoddefexecute(cls,root,info,**data:Unpack[TypedArguments])->Self:input_a=data.get("input_a")# str | Noneinput_b=data["input_b"]# strreturncls(ok=True)typed-graphene exampleTopicsDefining custom typesYou can define custom types by inheriting fromBaseTransformerand registering it withregister.fromgrapheneimportIDfromtyped_grapheneimportBaseTransformer,registerclassIDStr(str):pass@registerclassIDStrTransformer(BaseTransformer):python_type=IDStrgraphene_type=IDYou can also overridecheck_typeandtransform_typeto define custom type checking and transformation.
It is recommended to add@cacheto thecheck_typeandtransform_typemethods for performance and type-consistency.fromtypingimportLiteral,get_originfromgrapheneimportLiteralfromtyped_grapheneimportBaseTransformer,register@registerclassLiteralTransformer(BaseTransformer[Literal,Enum]):python_type=Literalgraphene_type=Enum@classmethod@cachedefcheck_type(cls,T):returnget_origin(T)==Literal@classmethod@cachedeftransform_type(cls,T:type[Literal])->type[Enum]:"""Transform the type into the graphene type."""returnEnum.from_enum(literal_to_enum(T))AuthorJeong Yeon Nam(tonynamy@apperz.co.kr)
Package: typediterable
typediterabletypediterableis a simple python package for the actual typing of each element of an iterable with type hint notation.Installpip install git+ssh://git@github.com/osoken/typediterable.gitFeatures and ExamplesActual Typing with Type Hint NotationThe following example shows how the main componenttypediterable.TypedIterableworks:fromdataclassesimportdataclassfromtypediterableimportTypedIterable@dataclassclassUser:id:intname:strraw_data=[{"id":0,"name":"Alice"},{"id":1,"name":"Bob"}]fordinTypedIterable[User](raw_data):assertisinstance(d,User)It is equivalent to write:fromdataclassesimportdataclassfromtypediterableimportTypedIterable@dataclassclassUser:id:intname:strraw_data=[{"id":0,"name":"Alice"},{"id":1,"name":"Bob"}]fordin(User(**d)fordinraw_data):assertisinstance(d,User)Error Handlingtypediterable.TypedIterablealso has the error handling feature.fromdataclassesimportdataclassfromtypediterableimportTypedIterablefromcollections.abcimportMappingfromtypingimportUnion@dataclassclassUser:id:intname:strdeferror_handler(d:Mapping[str,Union[int,str]],i:int,e:Exception)->None:print(f"{i}th element `{d}` is invalid due to the following error:{e}")raw_data=[{"id":0,"name":"Alice"},{"name":"lack of id"},{"id":1,"name":"Bob"}]fordinTypedIterable[User](raw_data,on_error=error_handler):assertisinstance(d,User)The above example prints the following string:1th element `{'name': 'lack of id'}` is invalid due to the following error: User.__init__() missing 1 required positional argument: 'id'and it doesn't stop iterating.
The example is equivalent to write:fromdataclassesimportdataclassfromtypediterableimportTypedIterablefromcollections.abcimportMappingfromtypingimportUnion@dataclassclassUser:id:intname:strraw_data=[{"id":0,"name":"Alice"},{"name":"lack of id"},{"id":1,"name":"Bob"}]fori,raw_dinenumerate(raw_data):try:d=User(**raw_d)exceptExceptionase:print(f"{i}th element `{raw_d}` is invalid due to the following error:{e}")assertisinstance(d,User)Automatic Unpacking Argumentstypediterable.TypedIterablechecks the signature and automatically unpacks the arguments.
For functions which takes multiple positional arguments or multiple keyword arguments, such asdataclassandpydantic.BaseModel, it unpacks just like the above example.
If the function is single-argument, no unpacking is done.fromtypediterableimportTypedIterableraw_data=["1","2","3","4"]fordinTypedIterable[int](raw_data):assertisinstance(d,int)