Saravanan666/pypi-org huggingface dataset:
Package: typeconvs
TypeConvsConverters from str to another type.For more information see thedocumentation.History2022-04-04 (0.2.1)Add parameter separator to function range_conv2021-05-27 (0.2.0)Add overview table to API documentationAll parameters but 'string' are now keyword-onlyAdd functions sequence and range_convRename functions: boolean -> bool_conv, datetime -> datetime_conv,
date -> date_conv, time -> time_conv2021-01-25 (0.1.1)Bugfix: function duration now raises ValueError when hour, minute, or second
are negative or when minute or second are > 59Add parameter use_locale to function duration2021-01-22 (0.1.0)First public release
Package: typecorrector
ImportantThis project has merged with typesys and will no longer be maintained.
Typesys can be foundon githuborpypior it can be installed with pip install typesys.IntroType corrector is module that contains the decorator type_corrector.
This decorator lets the user specify what types the
arguments to a function should have. It’s not 100% safe to use as it
might result in a ValueError or TypeError if the user is not careful enough.
The motivation behing this module was to find a way that makes it easier
for the programmer to see what types the arguments should be, and at
the same time allow some margin of error.
I’m not sure if this is a good idea, or if it’s a good approach. It was
mostly developed for fun while playing around with decorators.Installationpip install typecorrectorUsageFirst import type_corrector from the typecorrector module:fromtypecorrectorimporttype_correctorThen you can decorate your functions with type_corrector@type_corrector(int,int)defadd(x,y):returnx+y@type_corrector(float,float)defdiv(x,y):returnx/yA call to add(1,’2’) will cast ‘2’ to an int, since that is what we
specified as the type of the second paramater in the decorator.
We can also call div as div(‘10’, ‘3’), and div will return 3.3333333333333335
as expected.This decorator also works with *args and **kwargs@type_corrector(int)defmult(*numbers):result=1fornuminnumbers:result*=numreturnresult@type_corrector(int)defkw_mult(**kwargs):first=kwargs.get('first')second=kwargs.get('second')third=kwargs.get('third')returnfirst*second*thirdThis allows us to call the functions like this:mult(‘2’, ‘3’, ‘4’)kw_mult(first=’2’, second=’3’, third=’4’)When looking at the function definitions of add, mult and kw_mult we can easily
see that the arguments are supposed to be integers.
By decorating the functions like this it should be a clear
hint what types we want the parameters to be passed in as, even though it
allows some margin of error.Known issuesWhen calling help on a decorated function the parameters are not shown
correctly, instead it will just say <function name>(*args, **kwargs)
Also, when using inspect to get the argument specification with
inspect.getargspec or getting the source code from inspect.getsourcelines
it will fail.
Thanks to the functools.wraps decorator the docstring of a wrapped function
will still be shown correctly.
Package: typecov
typecovRun type coverage checks.Usagetypecov --helpusage: typecov [-h] [-V] coverage reportfile

Run type coverage checks.

positional arguments:
  coverage       Minimum coverage required.
  reportfile     Path to the type coverage report with line counts.

optional arguments:
  -h, --help     show this help message and exit
  -V, --version  show program's version number and exitExampletypecov 99 .typecov/report/linecount.txtContributingInstall withpip install -r dev-requirements.txtRun testspytestOr if you havetoxsetuptox
Package: typecraft_python
Typecraft PythonThis repository contains an IGT model based on the Typecraft IGT format. It also contains a simple CLI for
performing various NLP tasks, interfacing with both NLTK and other tools such as the TreeTagger.Free software: MIT licenseFull Documentation:https://typecraft_python.readthedocs.io.Installationpip install typecraft_pythonFeaturesParsing of the Typecraft XML format.Manipulation of the Typecraft IGT model format.Integrating with NLTKIntegrating with TreeTaggerProvides a CLI that can be used to load, convert and manipulate raw text and Typecraft XML files.UsageUsage: tpy [OPTIONS] COMMAND [ARGS]...

Options:
  --help  Show this message and exit.

Commands:
  convert
  ntexts   This command lists the number of texts in a...
  raw
  xmlExamplesLoad a raw file, tokenize and tag it, and output xml (to stdout):$tpyrawyour_file.txtTo save to a file$tpyrawyour_file.txt-ooutput.xml#or$tpyrawyour_file.txt>output.xmlTo tag using a specific tagger:$tpyrawyour_file.txt--tagger=tree# Tags using the tree taggerTo load a Typecraft xml file and tag it:$tpyxmlyour_file.xml--tag--tagger=nltk-otagged_output.xmlCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.1 (2016-08-15)Fixed some small bugs.0.1.0 (2016-08-14)First release. Added main bulk of initial code:Parser works in its most basic inception and parses TC-XML documents into its object-tree
Package: typed
This library allows type tests and transformation and can be used for data loading, storing and validation.UsageSimple type-checking:import typed

            t1 = typed.int | typed.string

            assert t1.test('abc')
            assert t1.test(u'xyz')
            assert t1.test(30)
            assert not t1.test(1.2)
            assert not t1.test(True)
            assert not t1.test(None)

            t2 = typed.list(typed.int)

            assert t1.test([1, 2, 3])
            assert t1.test([])
            assert not t1.test(['a', 'b', 'c'])

            t3 = typed.list(typed.int | typed.string)

            assert t3.test([1, 'a', 2, 'b'])

            t4 = typed.list(typed.int) | typed.list(typed.string)

            assert t4.test([1, 2, 3])
            assert t4.test(['a', 'b', 'c'])
            assert not t4.test([1, 'a', 2, 'b'])

            t5 = typed.set(1, 2, 3)

            assert t5.test(2)
            assert not t5.test(4)

            t6 = typed.dict({
                            'a': typed.int,
                            'b': typed.bool.optional,
                            'c': (typed.int | typed.none).optional,
                    })
Package: typed-argparse
💡 write type-safe and elegant CLIs with a clear separation of concerns.FeaturesArgument parsing based on type annotation (including runtime validation).Support for many common types.Clear separation of concern between argument parsing and business logic.Support for super-low-latency shell auto-completions.Great forwriting sub-command CLIs.Very lightweight.No dependencies.Fully typed itself, no extra type stubs required.Offers both ahigh-leveland alow-levelAPI.
The high-level API generally requires less code to write, is fully based on type annotations, and is the preferred way for writing new CLIs.
The low-level API is mainly a low-effort migration path for incorporating type-safety into existing CLIs based onargparse.Install$pipinstalltyped-argparseThe only requirement is a modern Python (3.8+).Basic Usageimporttyped_argparseastap# 1. Argument definitionclassArgs(tap.TypedArgs):my_arg:str=tap.arg(help="some help")number_a:int=tap.arg(default=42,help="some help")number_b:Optional[int]=tap.arg(help="some help")verbose:bool=tap.arg(help="some help")names:List[str]=tap.arg(help="some help")# 2. Business logicdefrunner(args:Args):print(f"Running my app with args:\n{args}")# 3. Bind argument definition + business logic & rundefmain()->None:tap.Parser(Args).bind(runner).run()DocumentationSeefull documentation.ChangesSeechange log.LicenseThis project is licensed under the terms of theMIT license.
Package: typed-args
typed-argsThis project is inspired byTeXitoi/structopt.Introductiontyped-argsis a Python package for creating command line interfaces with type annotations.
The program defines what arguments it requires, andtyped-argswill figure out how to parse them out ofsys.argv.typed-argsuse standard python libraryargparseanddataclassesso no need to install any dependencies after Python 3.6.
Its API is very similar toargparse.What does it look like? Here is anexamplefromargparsedocs and is rewritten withtyped-args:importtyped_argsastafromtypingimportList,Callable@ta.argument_parser(description='Process some integers.')classArgs(ta.TypedArgs):integers:List[int]=ta.add_argument(metavar='N',type=int,nargs='+',help='an integer for the accumulator')accumulate:Callable[[List[int]],int]=ta.add_argument('--sum',action='store_const',const=sum,default=max,help='sum the integers (default: find the max)')args=Args.parse_args()print(args.accumulate(args.integers))Assuming the above Python code is saved into a file calledprog.py, it can be run at the command line and it provides useful help messages:$ python prog.py -h
usage: prog.py [-h] [--sum] N [N ...]

Process some integers.

positional arguments:
  N           an integer for the accumulator

optional arguments:
  -h, --help  show this help message and exit
  --sum       sum the integers (default: find the max)When run with the appropriate arguments, it prints either the sum or the max of the command-line integers:$ python prog.py 1 2 3 4
4

$ python prog.py 1 2 3 4 --sum
10If invalid arguments are passed in, an error will be displayed:$ python prog.py a b c
usage: prog.py [-h] [--sum] N [N ...]
prog.py: error: argument N: invalid int value: 'a'InstallationFrom pypipipinstalltyped-argsIf you want to use it on python 3.5 and 3.6 please installdataclasses:pipinstalldataclassesCore FunctionalityCheck_test_v0_6.pyforadd_argument_groupandadd_subparsers.Create a parserargparseimportargparseparser=argparse.ArgumentParser(prog='ProgramName')typed-argsimporttyped_argsasta@ta.argument_parser(prog='ProgramName')classArgs(ta.TypedArgs):passAdd argumentsargparseimportargparseparser=argparse.ArgumentParser()parser.add_argument('filename')# positional argumentparser.add_argument('-c','--count')# option that takes a valueparser.add_argument('-v','--verbose',action='store_true')# on/off flagtyped-argsimporttyped_argsasta@ta.argument_parser()classArgs(ta.TypedArgs):filename:str=ta.add_argument()# positional argument, use the attribute name automaticallycount:str=ta.add_argument('-c','--count')# option that takes a value, also can be annotated as Optional[str]verbose:bool=ta.add_argument('-v','--verbose',action='store_true')# on/off flagParse argsargparseargs=parser.parse_args()print(args.filename,args.count,args.verbose)typed-argsargs=Args.parse_args()print(args.filename,args.count,args.verbose)
Package: typed-ast
End of lifeThis project is no longer maintained.Use the standard libraryastmodule instead.
Seehttps://github.com/python/typed_ast/issues/179.Descriptiontyped_astis a Python 3 package that provides a Python 2.7 and Python 3
parser similar to the standardastlibrary.  Unlikeastbelow Python 3.8,
the parsers intyped_astinclude PEP 484 type comments and are independent of the version of
Python under which they are run.  Thetyped_astparsers produce the standard
Python AST (plus type comments), and are both fast and correct, as they are
based on the CPython 2.7 and 3.7 parsers.Note:Theastmodule of Python 3.8+ supports all features oftyped_ast.typed_astdoes not support parsing code that uses syntax introduced in
Python 3.8 onwards.
We recommend usingaston Python 3.8 or above.
Package: typedattr
typedattrDeprecated:Attribute parsing capabilities have been moved totypedparserOther utilities have been moved topackgThis code and pypi package may be deleted at some point.Typechecking and conversion utility forattrsParses a dictionary into an attrs instance.
Contains other generic object, type and cache utilities.InstallRequirespython>=3.7Note:0.2breaks some backwards compatibility. Use0.1or update your code.pipinstalltypedattrQuickstartDefine the class hierarchy and parse the input usingattrs_from_dict:fromattrsimportdefinefromtypingimportOptionalfromtypedattrimportattrs_from_dict@defineclassCfg:foo:int=12bar:Optional[int]=Noneprint(attrs_from_dict(Cfg,{"foo":1,"bar":2}))# Cfg(foo=1, bar=2)@defineclassCfgNested:sub_cfg:Cfg=Noneprint(attrs_from_dict(CfgNested,{"sub_cfg":{"foo":1,"bar":2}}))# CfgNested(sub_cfg=Cfg(foo=1, bar=2))FeaturesNested checking and conversion of python standard typesSupports old and new style typing (e.g.typing.Listandlist)Supports positional and keyword arguments in classesCan also typecheck existing attrs instancesAllows custom conversions, by default converts source typestrto target typePathandinttofloatAllows to redefine which objects will be recursed into, by default recurses into standard
containers (list, dict, etc.)@definenumpydecorator for equality check if the instances contains numpy arraysStrict mode (default)Convert everything to the target type, e.g. if the input is a list and the annotation is a tuple,
the output will be a tupleRaise errors if types cannot be matched, there are unknown fields in the input or
abstract annotation types are used (e.g. Sequence)Non-strict modeEnabled by callingattrs_from_dictwithstrict=FalseNo conversion except for creating the attrs instance from the dictIgnore silently if types cannot be matched or abstract annotation types are usedUnknown fields in the input will be added to the attrs instance if possible
(see the hint below about slots)Skip unknownsSetskip_unknowns=Trueto ignore all unknown input fields.HintsThe following behaviour stems from theattrspackage:New attributes cannot to be added after class definition to an attrs instance,
unless it is created with@define(slots=False)ExplanationUntyped fields or "ClassVar" typed fields will be ignored by @attrs.define
and therefore also by this library.Other utilities in the packageConst: An alternative toenum.Enumfor defining constantscacheutils: Cache objects to disk / to memoryobjutils: Various utilities like nested modification of dictsType definitions and other utilitiesInstall locally and run testsClone repository and cd into, then:pipinstall-e.
pipinstall-Upytestpytest-covpylint
pylinttypedattr# run tests for python>=3.7python-mpytest--cov
pylinttests# run tests for python>=3.9python-mpytestteststests_py39--cov
pylinttestspylinttests_py39AlternativesThis library should be useful for off-the-shelf typechecking and conversion of dicts to
attrs instances.For more complex or other related use cases there are many alternatives:cattrs,attrs-strict,pydantic,dataconf,omegaconfto name a few.
Package: typedb-client
TypeDB Client for PythonClient ArchitectureTo learn about the mechanism that a TypeDB Client uses to set up communication with databases running on the TypeDB Server, refer toTypeDB > Client API > Overview.API ReferenceTo learn about the methods available for executing queries and retrieving their answers using Client Python, refer toTypeDB > Client API > Python > API Reference.Concept APITo learn about the methods available on the concepts retrieved as the answers to TypeQL queries, refer toTypeDB > Concept API > OverviewInstall TypeDB Client for Python through Pippip install typedb-clientIf multiple Python versions are available, you may wish to usepip3 install typedb-clientIn your python program, import from typedb.client:fromtypedb.clientimport*client=TypeDB.core_client(address=TypeDB.DEFAULT_ADDRESS)
Package: typedb-driver
TypeDB Python DriverDriver ArchitectureTo learn about the mechanism that a TypeDB Driver uses to set up communication with databases running on the TypeDB Server, refer to theClients Overview.API ReferenceTo learn about the methods available for executing queries and retrieving their answers using Driver Python, refer to theAPI Reference.Install TypeDB Driver for Python through Pippip install typedb-driverIf multiple Python versions are available, you may wish to usepip3 install typedb-driverIn your python program, import from typedb.driver:fromtypedb.driverimport*driver=TypeDB.core_driver(address=TypeDB.DEFAULT_ADDRESS)
Package: typed-bencode
TypedBencodeMake it easy to create round-trippable bencoding for objects.Usageimporttyped_bencodefromtypingimportListmy_type=typed_bencode.for_dict(a=str,b=int,c=bytes,d=List[str])val={"a":"hello","b":123,"c":b'asd',"d":["hey","there"]}encoded=my_type.encode(val)print(encoded)# => b'd1:a5:hello1:bi123e1:c3:asd1:dl3:hey5:thereee'print(my_type.decode(encoded)==val)# => TrueYou can even compose typesmy_other_type=typed_bencode.for_dict(a=my_type,b=int)encoded2=my_other_type.encode({"a":{"a":"helo","b":123,"c":b'asd',"d":["asd","asd"]},"b":123})print(encoded2)# => b'd1:ad1:a4:helo1:bi123e1:c3:asd1:dl3:asd3:asdee1:bi123ee'Custom typesYou can specify a custom typeclassDateEncoder(typed_bencode.StringEncoder):defto_bytes(self,val):returnsuper().to_bytes(val.isoformat())classDateDecoder(typed_bencode.StringDecoder):deffrom_bytes(self,b):v,pos=super().from_bytes(b)return(datetime.datetime.fromisoformat(v),pos)classDateType(typed_bencode.BaseType):def__init__(self):super().__init__()self.encoder=DateEncoder(self)self.decoder=DateDecoder(self)my_type=DateType()val=datetime.datetime.now()encoded=my_type.encode(val)# => '26:2018-06-06T12:12:12.363636'
Package: typed-blocks
typed-blocksDocumentation:https://typed-blocks.readthedocs.ioTyped Blocksis a modular event-centric python library created to simplify development of typical stream applications. It hardly exploits standard Python type hints.Distinctive features:Boilerplate-less: just ties together pre-defined computationalblocks.Focuses on loose coupling and event-driven design.Encourages explicit separation of data and code. Static typing to the rescue!Minimalistic at it's core and easy-to-go.Modular and open for extension via self-defined connectors for different data sources.InstallationIn minimal installation typed-blocks requires python 3.7 or greater and has no dependencies, so you may just use:$pipinstalltyped-blocksFor each data source or extended features you may need corresponding client library. More details indocumentation.ExampleIf it is hard to understand, what is going on in the following snippet of code,this articlealso may help.TL;DR:we are definingevents: minimally significant pieces of datawe are definingsourceof all events in our programwe defineprocessorsto handle themwe put all ingredients in theApp. Type hints are important! It's actually definition of whichprocessorshould handleeventand should it emit neweventsor not.???it works!fromdataclassesimportdataclassfromblocksimportApp,source,processor@dataclassclassE:x:int@dataclassclassE2:y:int@sourcedefgenerator()->E:returnE(1)@processordefprinter(e:E)->E2:print('1',e)returnE2(e.x)@processordefprinter2(e:E2)->None:print('2',e)blocks=(generator(),printer(),printer2())App(blocks).run(once=True)
Package: typedb-protocol
TypeDB Client RPC (Remote Procedure Call) ProtocolA protocol for implementing a TypeDB client driver, in many popular programming languages, usingGRPC (Google's Remote Procedure Call)framework.LicensingThe TypeDB protocol is distributed under the terms GNU Affero General Public License v3.0 ("AGPL 3.0") as published by the Free Software Foundation, but with the following special exception.Exception to AGPL 3.0: Any driver or client library (in each case) that implements the TypeDB protocol, and that is used to communicate or interact (in each case) with a database created or managed or accessed (in each case) using a version of the TypeDB software that is made available by or on behalf of Vaticle Limited (UK Company Number 08766237) or any successor entity (but excluding any forked version of that software), may be distributed under one of the following licences:The Apache License version 2:https://www.apache.org/licenses/LICENSE-2.0.txtThe MIT License:https://opensource.org/licenses/MITThe BSD License (2-Clause):https://opensource.org/licenses/BSD-2-ClauseAs used above "successor entity" means any entity then owning copyrights in the TypeDB software that were previously owned by Vaticle Limited.If you make any change to, or contribute to, (in each case) the TypeDB protocol, then this exception will apply to any driver or client library that uses or implements that change/contribution.
Package: typed-cap
typed-capCap is a pythonCommand-lineArgumentParser that providestypingsupport. Using Cap requires less code to generate a more easy to use parser.Usage⚠️typed_caprequiredpython>=3.9pip install typed_capQuick Examplefromtyped_capimportCapclassArgs:"""description here"""# @alias=cconfig:str|None"""file path to config file"""# @alias=ddepth:int"""depth of search"""dry_run:bool=True"""run without making any changes"""cap=Cap(Args)parsed=cap.parse()print(parsed.args.__dict__)print(parsed.argv)pythondemo.py# Cap.parse: option depth:int is required but it is missing#         ArgsParserMissingArgumentpythondemo.py--help# description here## OPTIONS:#     -c,--config     file path to config file#     -d,--depth      depth of search#        --dry_run    run without making any changes (default: True)#     -h,--help       display the help textpythondemo.py-d5hellotypedcap# {'depth': 5, 'config': None, 'dry_run': True}# ['hello', 'typed', 'cap']
Package: typedclasses
typedclassesPython classes with types validation at runtime.(Experimental & Under Development)InstallationYou can install this library using Python's favorite,pippackage manager.pipinstall-UtypedclassesHow it worksUsing typedclasses, you can create classes indataclasses-like manner i.e using type annotations and library will enforce types for
that class at runtime. Here's an example:importtypingfromtypedclassesimportTypedClassclassUser(TypedClass):id:intname:stremail:typing.Optional[str]=NoneParameters will be validated when initialising above class. Sinceemailhas a default value set, It is optional to pass
it as a parameter while instansiating:>>>User(id=1,name="foobar")# runs fine>>>User(id="1",name="foobar")TypeError:Parameter'id'mustbeaninstanceof<class'int'>, <class 'str'> is unsupported.This library also provides validation forvariousgeneric types fromtypingmodule:classFoo(TypedClass):x:typing.Union[str,int]Foo(x="a")# okFoo(x=1)# okFoo(x=True)# invalidList of all types supported fromtypingmodule can be found in the documentation.
Package: typedcols
WarningAlthough production code is based on this library, it should still be considered
as work in progress.IntroductionPython 2 and 3 compatible library providing typed collections.This README file is work in progress, sorry about that.CopyrightCopyright (c) since 2016, CESNET, z. s. p. o.Author: Pavel Kácha <pavel.kacha@cesnet.cz>Use of this package is governed by the ISC license, see LICENSE file.ChangelogVersion 0.1.15Released 2022-11-02Allowed adding files from previous versions using Gitlab CI/CD.Version 0.1.14Released 2022-06-27Added a config file for GitLab CI/CD.Fixed deprecation warnings for Python 3.7+ regardingcollections.abcUpdated the repository information.Updated packages versions.