Saravanan666/pypi-org huggingface dataset:
Package: pystringmatcher
pystringmatcherdescriptiona small utility tool for finding substrings and text patterns in an input file
the tool is cutting the text in the file into chunks and processes every chunk in a separate process
using python's multiprocessing moduleinstallation:pipinstallpystringmatcherusage:using the python modulepython-mpypyringmatcher-h

Findingtextpatternsininputtextfile

optionalarguments:-h,--helpshowthishelpmessageandexit-fFILE_PATH,--fileFILE_PATHtheinputfiletosearchthepatternsin-pPATTERNS,--patternsPATTERNSthepattern\stosearchinthefileseparatedby,-nNUM_LINES_PER_CHUNK,--num-linesNUM_LINES_PER_CHUNKthenumberoflinesperchunkoftextfromtheinputfileor by using the included console scriptstringmatcher-hIn your own programfrompystringmatcher.AlgorithmsimportRabinKarpfrompystringmatcher.TypesimportTextFiletry:text=TextFile(file_path="/path/to/file")algorithm=RabinKarp()chunks=text.divide_into_chunks(num_of_lines_each_chunk=1000)patterns="alpha,beta,charlie,delta,echo,foxtrot".split(",")print(f"[X] - Start finding the patterns :{patterns}in the file:{text}")matches=text.find_matches(chunks=chunks,patterns=patterns,algorithm=algorithm)ifmatches:print("Found matches")print(matches)print("No matches were found")exceptFileNotFoundError:print(f"The file:{text}was not found and may not exist")Implementing your own matching algorithmfrompystringmatcher.AlgorithmsimportAlgorithmfrompystringmatcher.TypesimportMatchclassMyAlgorithm(Algorithm):defpreprocess(self,pattern,text,*args,**kwargs):"""some preprocess logic goes here if needed"""defrun(self,pattern,text,*args,**kwargs):matches=[]"""the mathcing algorithm logic goes herefor any match: matches.append(Match(char_offset=start_index_of_match))"""returnmatches
Package: py-stringmatching
py_stringmatchingThis project seeks to build a Python software package that consists of a comprehensive and scalable set of string tokenizers (such as alphabetical tokenizers, whitespace tokenizers) and string similarity measures (such as edit distance, Jaccard, TF/IDF). The package is free, open-source, and BSD-licensed.Important linksProject Homepage:https://sites.google.com/site/anhaidgroup/projects/magellan/py_stringmatchingCode repository:https://github.com/anhaidgroup/py_stringmatchingUser Manual:https://anhaidgroup.github.io/py_stringmatching/v0.4.2/index.htmlTutorial:https://anhaidgroup.github.io/py_stringmatching/v0.4.2/Tutorial.htmlHow to Contribute:https://anhaidgroup.github.io/py_stringmatching/v0.4.2/Contributing.htmlDeveloper Manual:http://pages.cs.wisc.edu/~anhai/py_stringmatching/v0.2.0/dev-manual-v0.2.0.pdfIssue Tracker:https://github.com/anhaidgroup/py_stringmatching/issuesMailing List:https://groups.google.com/forum/#!forum/py_stringmatchingDependenciespy_stringmatching has been tested on each Python version between 3.7 and 3.12, inclusive.The required dependencies to build the package are NumPy 1.7.0 or higher
and a C or C++ compiler. For the development version, you will also need Cython.Platformspy_stringmatching has been tested on Linux, OS X and Windows. At this time we have only tested on x86 architecture.
Package: pystrings
pystringsFor ease of working with stringsIf you, like me, have an obsession with writing strings, use pystringsWrite it once, then call itYou can use pystrings as below:from pystrings import create_strings

#initialization 
my_str = create_strings(['hell_world', 'use_it_for_handle_all_strings', 'haha'])

#example for test it 
print(my_str.haha) 
==>hahapystrings is anopen-sourcelibraryyou can use it in all source code instead strings, like use in instead of ML hyperparametersjust you must inshialize pystrings with your strings and call it laterIn theJupyterweb application this is a great function, when you select a cell for initialization and whenever you need to add a string, you update this cell and run it again.We have good news in the next updatesto be continued...
Package: py-stringsimjoin
py_stringsimjoinThis project seeks to build a Python software package that provides scalable implementation of string similarity joins over two tables, for commonly used similarity measures such as Jaccard, Dice, cosine, overlap, overlap coefficient and edit distance. The package is free, open-source, and BSD-licensed.Important linksProject Homepage:https://sites.google.com/site/anhaidgroup/projects/magellan/py_stringsimjoinCode repository:https://github.com/anhaidgroup/py_stringsimjoinUser Manual:http://anhaidgroup.github.io/py_stringsimjoin/v0.3.2/index.htmlOverview:https://anhaidgroup.github.io/py_stringsimjoin/v0.3.2/overview.htmlHow to Contribute:https://anhaidgroup.github.io/py_stringsimjoin/v0.3.2/contributing.htmlIssue Tracker:https://github.com/anhaidgroup/py_stringsimjoin/issuesMailing List:https://groups.google.com/forum/#!forum/py_stringsimjoinDependenciespy_stringsimjoin has been tested on each Python version between 3.7 and 3.12, inclusive.The required dependencies to build the package are pandas 0.16.0 or higher, py_stringmatching 0.2.1 or higher,
joblib, pyprind, six and a C++ compiler. For the development version, you will also need Cython.Platformspy_stringsimjoin has been tested on Linux, OS X and Windows.
Package: py-stringsimjoin-temp
py_stringsimjoinThis project seeks to build a Python software package that provides scalable implementation of string similarity joins over two tables, for commonly used similarity measures such as Jaccard, Dice, cosine, overlap, overlap coefficient and edit distance. The package is free, open-source, and BSD-licensed.Important linksProject Homepage:https://sites.google.com/site/anhaidgroup/projects/magellan/py_stringsimjoinCode repository:https://github.com/anhaidgroup/py_stringsimjoinUser Manual:http://anhaidgroup.github.io/py_stringsimjoin/v0.3.2/index.htmlOverview:https://anhaidgroup.github.io/py_stringsimjoin/v0.3.2/overview.htmlHow to Contribute:https://anhaidgroup.github.io/py_stringsimjoin/v0.3.2/contributing.htmlIssue Tracker:https://github.com/anhaidgroup/py_stringsimjoin/issuesMailing List:https://groups.google.com/forum/#!forum/py_stringsimjoinDependenciespy_stringsimjoin has been tested on each Python version between 3.7 and 3.11, inclusive.The required dependencies to build the package are pandas 0.16.0 or higher, py_stringmatching 0.2.1 or higher,
joblib, pyprind, six and a C++ compiler. For the development version, you will also need Cython.Platformspy_stringsimjoin has been tested on Linux, OS X and Windows.
Package: pystrix
pystrixis an attempt at creating a versatileAsterisk-interface package for AMI and (Fast)AGI needs. It is published as an open-source library under the LGPLv3 byIvrnet, inc., welcoming contributions from all users.Overviewpystrix runs on python 2.7/python 3.4+ on any platform. It’s targeted at Asterisk 1.10+ and provides a rich, easy-to-extend set of bindings for AGI, FastAGI, and AMI.Release ScheduleThe current code in the repository correspond to version1.1.8of the package.  When a bug is found and fixed a new version of the package will be generated in order to keep it updated and as bug-free as possible.New releases will follow the format: <release mayor>.<release minor>.<bug fixed> according to the change made to the code.HistoryAfter some research, we found that what was available was either incompatible with the architecture model we needed to work withTwisted, (while excellent for a great many things, isn’t always the right choice), was targeting an outdated version of Asterisk, or had a very rigid, monolithic design. Identifying thepystandpy-asteriskpackages as being similar, but structurally incompatible, to what we wanted, pyst was chosen as the basis for this project, with a full rewrite of its AGI and AMI systems to provide a uniform-looking, highly modular design that incorporates logic and ideas from py-asterisk. The end result is a package that should satisfy anyone who was looking at either of its ancestors and that should be easier to extend as Asterisk continues to evolve.InstallationFrom pip$pipinstallpystrixFrom github$pipinstall-egit://github.com/marsoguti/pystrix.git#egg=pystrixUsageDetailed usage information is provided in the documentation, along with simple examples that should help to get anyone started.DocumentationOnline documentation is available athttp://pystrix.readthedocs.io/.Inline documentation is complete and made readable byreStructuredText, so you’ll never be completely lost.CreditsIvrnet, inc.Initial development of pystrix was funded by IvrnetIvrnet is a software-as-a-service company that develops and operates intelligent software applications, delivered through traditional phone networks and over the Internet. These applications facilitate automated interaction, personalized communication between people, mass communication for disseminating information to thousands of people concurrently, and personalized communication between people and automated systems. Ivrnet’s applications are accessible through nearly any form of communication technology, at any time, from anywhere in North America, via voice, phone, fax, email, texting, and the Internet.Neil TallimDevelopment leadProgrammingOther contributions and current package maintenanceMarta SolanoBug solving - ProgrammingPip package maintenanceEric LeePython 2 to 3 migration - compatibilityProgrammingKarthic RaghupathiBug solving - ProgrammingPip package maintenance
Package: pystrom
python-mystrom aka. pystromDies ist eine unoffizielle Python-Integration für die Steuerung von lokalen MyStrom-Geräten.Dieses Projekt ist noch sehr neu und hat deshalb noch nicht sehr viele Features.HINWEIS: Dieses Projekt wird nicht vonMyStromentwickelt und steht auch nicht damit in Verbindung.InstallationDie Installation benötigtPythonsowiePip.python -m pip install -U pip pystromFeaturesKonsolen-BefehleBefehlFunktionpython -m pystrom searchSuche MyStrom-Geräte im lokalen Netzwerk
Package: pyStrompris
StrømprisUsageSupported sources:Hvakosterstrommenfromstrompris.stromprisimportStromprisfromstrompris.constimportSOURCE_HVAKOSTERSTROMMENstrompris=Strompris(source=SOURCE_HVAKOSTERSTROMMEN,zone=1)# Can also be used with direct string # Zone 1-5"""Returns pricing for today and tomorrow if available"""priser=strompris.get_available_prices()"""Returns pricing for current hour using GMT+1|+2"""now=strompris.get_current_price()"""Returns pricing for current hour along with extra info:total (kwh + tax)minmaxavgtaxprice_level"""nowAttrs=strompris.getPriceAttrs(zone=1)
Package: py-strongly-typed
What do I need?Python (3.5+)DescriptionWith py-strongly-typed, now typing annotations metters! Use this lib to validate provided args typing.Be free to contribute with ourGitHubproject.Get StartedInstallpip install py-strongly-typedUsageTyping classesfrom py_strongly_typed import TypedClass


 class SomeClass(TypedClass):
     def __init__(self, first_arg: str, second_arg: int):
         self.first_arg = first_arg
         self.second_arg = second_arg
     
     def some_method(*, method_arg: list):
         pass


 instance_class = SomeClass('arg_value', second_arg=1)
 istance_class.some_method(method_arg=[1])You can also to set only__init__method to be typed doing:from py_strongly_typed import TypedClass


 class SomeClass(TypedClass):
     type_all_methods: bool = False

     def __init__(self, first_arg: str, second_arg: int):
         self.first_arg = first_arg
         self.second_arg = second_arg
     
     def some_method(*, method_arg: list):
         pass


 instance_class = SomeClass('arg_value', second_arg=1)
 istance_class.some_method(method_arg=[1])or:from py_strongly_typed import TypedInit


 class SomeClass(TypedInit):
     def __init__(self, first_arg: str, second_arg: int):
         self.first_arg = first_arg
         self.second_arg = second_arg
     
     def some_method(*, method_arg: list):
         pass


 instance_class = SomeClass('arg_value', second_arg=1)
 istance_class.some_method(method_arg=[1])Typing function or methodsYou can also use decorators for methods or functions typing:from py_strongly_typed import typed_function

  @typed_function
  def some_function(arg: str):
      passObjectsTypedClassclassUsed to set a class to has typing annotations validated.TypedInitclassUsed to set a class to has typing annotations validated on __init__ only.typed_functiondecoratorUsed to set a function or method to has typing annotations validated.IValidateAnnotationsUseCaseabstract classInterface that should be used to implement custom typing validations.ValidateAnnotationsUseCaseclass (inherit IValidateAnnotationsUseCase)Default typing validation core.Argument optionsTypedClass and TypedInittyping_validator[Type[IValidateAnnotationsUseCase]][default=ValidateAnnotationsUseCase]:You can provide an custom class that validates typing.type_all_methods[bool][default=True]:Defines if all methods of the class will be type validated or only __init__.@typed_function decoratortyping_validator[Type[IValidateAnnotationsUseCase]]:You can provide an custom class that validates typing.IValidateAnnotationsUseCasefunc[Callable]: Function that will has be called after typing validation.BehaviorWhen an invalid value type is provided, WrongType exception will be raised.When function or method is defined with any argument missing annotation,
MissingAnnotation will be raised.LimitationsTyping usingoroperator will validate only first one. Example: providing str or int,
only str will be considered. To provide more than one expected type, use|operator orUnion.*argsand**kwargsare not supported yet.LicenseMIT
Package: pystrsim
pystrsimPython wrapper for Rust'sstrsimlibraryUsage:importpystrsimprint(f"hamming:{pystrsim.hamming('hamming','hammers')}should be 3")print(f"levenshtein:{pystrsim.levenshtein('kitten','sitting')}should be 3")print(f"normalized_levenshtein:{pystrsim.normalized_levenshtein('kitten','sitting')}should be ~0.571")print(f"osa_distance:{pystrsim.osa_distance('ac','cba')}should be 3")print(f"damerau_levenshtein:{pystrsim.damerau_levenshtein('ac','cba')}should be 2")print(f"normalized_damerau_levenshtein:{pystrsim.normalized_damerau_levenshtein('levenshtein','löwenbräu')}should be ~0.272")print(f"jaro:{pystrsim.jaro('Friedrich Nietzsche','Jean-Paul Sartre')}should be ~0.392")print(f"jaro_winkler:{pystrsim.jaro_winkler('cheeseburger','cheese fries')}should be ~0.911")print(f"sorensen_dice:{pystrsim.sorensen_dice('web applications','applications of the web')}should be ~0.7878787878787878")Is it blazingly fast?Well, no : )JellyfishandLevenshteinare faster.See thebenchmark/benchmark.pyfile.algorithmlibraryfunctiontimeDamerauLevenshteinjellyfishdamerau_levenshtein_distance0.00593378HammingLevenshteinhamming0.000683438Hammingjellyfishhamming_distance0.00112426Jarojellyfishjaro_similarity0.00206124JaroWinklerjellyfishjaro_winkler_similarity0.00221943LevenshteinLevenshteindistance0.00115115Levenshteinjellyfishlevenshtein_distance0.00257007damerau_levenshteinpystrsimdamerau_levenshtein0.380067hammingpystrsimhamming0.0116847jaropystrsimjaro0.0547281jaro_winklerpystrsimjaro_winkler0.057244levenshteinpystrsimlevenshtein0.102525normalized_damerau_levenshteinpystrsimnormalized_damerau_levenshtein0.389092normalized_levenshteinpystrsimnormalized_levenshtein0.107314osa_distancepystrsimosa_distance0.15746sorensen_dicepystrsimsorensen_dice0.0973786
Package: pystructs
pystructspystructsis usefulc-like structpackage for humanHow to install$pipinstallpystructsExample codesfromtypingimportListfrompystructsimportfieldsclassAttribute(fields.Struct):type=fields.BytesField(size=1)length=fields.Int32Field(byteorder='big')value=fields.VariableBytesField(related_field='length')classStunMessage(fields.Struct):type=fields.BytesField(size=1)length=fields.Int32Field(byteorder='big')attributes:List[Attribute]=fields.MultipleField(count='length',field=Attribute())message=StunMessage(b'\x09\x00\x00\x00\x02'b'\x01\x00\x00\x00\x03\x12\x34\x56'b'\x02\x00\x00\x00\x03\x12\x34\x56')message.initialize()print(message.length)# 2print(message.attributes[0].length)# 3print(message.attributes[1].length)# 3
Package: pystructs3
PyStructsImplements a dataclass version of python's stdlibstructlibrary.Structs decode values as defined by their type annotations and allows
for simple, easy, and fast encoding/decoding of complex data-structures.Installationpip install pystructs3ExamplesSimple Examplefrompystructsimport*classFoo(Struct):x:U8y:U16z:U32# same as struct.pack('>BHI', 230, 6500, 2147483648)foo=Foo(230,65000,2147483648)print(foo)print(foo.pack())encoded=pack((U8,U16),230,65000)print(encoded)decoded=unpack((U8,U16),encoded)print(decoded)More Complex Examplefrompystructsimport*fromtyping_extensionsimportAnnotatedclassFoo(Struct):x:I16y:U32ip:IPv4data:Annotated[bytes,SizedBytes[U16]]classBar(Struct):mac:MacAddrip6:IPv6data:Annotated[bytes,StaticBytes[16]]# use context to encode/decode items in seriesctx=Context()foo=Foo(69,420,'1.2.3.4',b'example message')bar=Bar('00:01:02:03:04:05','::1',b'message two')print(foo,bar)print(foo.x)raw=foo.encode(ctx)+bar.encode(ctx)print(raw)# reset context before switching between encoding/decodingctx.reset()foo2=Foo.decode(ctx,raw)bar2=Bar.decode(ctx,raw)print(foo2,bar2)ctx.reset()encoded=encode(ctx,(I16,IPv4),1,'1.2.3.4')+\encode(ctx,(U32,IPv6),2,'::1')ctx.reset()item1=decode(ctx,(I16,IPv4),encoded)item2=decode(ctx,(U32,IPv6),encoded)print(item1,item2)LimitationsThis implementation is intentionally simple and avoids doing things like
allowing hierarchies of structured-objects or any real dynamic behavior
outside of parsing a series of specified simple data-types. This is to
avoid any complex class definitions that often feel overly esoteric and
work likemagic. Instead, dynamic parsing is left to standard python
code to make things simpler and easier to read.
Package: pystructurizr
PyStructurizrPyStructurizr provides a Python DSL inspired byStructurizr, and is intended for generating C4 diagrams.OverviewStructurizrbuilds upon "diagrams as code", allowing you to create multiple software architecture diagrams from a single model. A popular way of creating Structurizr workspaces is the Structurizr DSL.However, Structurizr DSL has some downsides:It's a custom language, with its own syntax rules and limitationsIt has rather primitive support for splitting your diagram code over multiple files, with only#include-like support rather than proper imports. That makes it really hard to maintain C4 models with a team.PyStructurizr solves that. It implements the same concepts as Structurizr DSL, but now in plain Python. That means you can use the full power and flexibility of Python to define your diagrams!ExampleConsider the following example (as shown on Structurizr's homepage), in Structurizr DSL:workspace {
    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System" {
            webapp = container "Web Application" {
                user -> this "Uses"
            }
            container "Database" {
                webapp -> this "Reads from and writes to"
            }
        }
    }
    views {
        container softwareSystem {
            include *
            autolayout lr
        }
    }
}In PyStructurizr, this becomes:frompystructurizr.dslimportWorkspace# Create the model(s)withWorkspace()asworkspace:withworkspace.Model(name="model")asmodel:user=model.Person("User")withmodel.SoftwareSystem("Software System")assoftware_system:webapp=software_system.Container("Web Application")db=software_system.Container("Database")# Define the relationshipsuser.uses(webapp,"Uses")webapp.uses(db,"Reads from and writes to")# Create a view onto the modelworkspace.ContainerView(software_system,"My Container View","The container view of our simply software system.")For such a simple example, the benefits are not super obvious, but look at the example in this repo for something more realistic.CLIPyStructurizr comes with a DSL that allows to convert your Python code to Structurizr DSL, or to immediately generate SVG versions of the diagrams. You can even upload directly to your favorite cloud storage provider: this is ideal if you want to include diagrams on blogs, wiki's, etc.Finally, there's a development mode so you can get live preview of the diagram you're working on in your webbrowser.Installationpip install pystructurizrUsageConvert to Structurizr DSLpystructurizr dump --view <path_to_view_file>Live previewpystructurizr dev --view <path_to_view_file>Convert to SVG and upload to cloud storagepystructurizr build --view <path_to_view_file> --gcs-credentials <path_to_credentials_json_file> --bucket-name <string> --object-name <string>Note that this command uses kroki.io under the hood to generate your SVG file. The benefit is that you don't need to install any tools that understand Structurizr DSL on your machine. The downside is that your diagram code is sent to an online service.LicenseMIT LicenseAcknowledgementsStructurizrKroki
Package: pysts
descriptionThis is a utility package composed of several modules.Installationpip install pystsTestsIf the module is installed through pip:pytestRun the tests from the local setup directory:python -m pytestCode coverageGenerate coverage report with:py.test --cov=python_utils tests/before_script:- bumpversion minor setup.pyor- bumpversion --new-version 0.9.13 setup.pyscript:- pip install --user --upgrade setuptools wheel twine numpy- python setup.py sdist bdist_wheel- python -m twine upload --repository-urlhttps://upload.pypi.org/legacy/dist/pysts-0.9.13* -u USERNAME -p PASSWORDNOTE: Delete previous builds before uploadingAdd pypi repo:- pip config --user set global.gtlpypihttps://pypi.gtl.fyi/simple/download:- pip install --upgrade -ihttps://pypi.gtl.fyi/simplepystsOR-pip install --upgrade git+https://github.com/sdswart/pysts.git
Package: pystubber
pystubberWhat differs frommypy stubgen?As mypy'sstubgen -m randomgenerates the following for therandommodule:classRandom(_random.Random):VERSION:int=...gauss_next:Any=...def__init__(self,x:Optional[Any]=...)->None:...defseed(self,a:Optional[Any]=...,version:int=...)->None:...defgetstate(self):...defsetstate(self,state:Any)->None:...def__reduce__(self):...defrandrange(self,start:Any,stop:Optional[Any]=...,step:int=...,_int:Any=...):...defrandint(self,a:Any,b:Any):...defchoice(self,seq:Any):......pystubber randominstead generates:#!/usr/bin/env python  # [module random]"""Random variable generators...."""__all__=['Random','seed','random','uniform','randint','choice','sample','randrange','shuffle','normalvariate','lognormvariate','expovariate','vonmisesvariate','gammavariate','triangular','gauss','betavariate','paretovariate','weibullvariate','getstate',...]classRandom(_random.Random):def__getstate__(self):"""# Issue 17489: Since __reduce__ was defined to fix #759889 this is no# longer called; we leave it here because it has been here since random was# rewritten back in 2001 and why risk breaking something."""raiseNotImplementedError()def__init__(self,x=None):"""Initialize an instance.Optional argument x controls seeding, as for Random.seed()."""raiseNotImplementedError()def__reduce__(self):"""helper for pickle"""raiseNotImplementedError()...