Saravanan666/pypi-org huggingface dataset:
Package: py-str-case
PyPIpy_str_caseThis module is extension ofstringcase.Convert string cases between camel case, pascal case, snake case etc...Examplesimport py_str_case
py_str_case.camelcase('foo_bar_baz') # => "fooBarBaz"
py_str_case.camelcase('FooBarBaz') # => "fooBarBaz"
py_str_case.capitalcase('foo_bar_baz') # => "Foo_bar_baz"
py_str_case.capitalcase('FooBarBaz') # => "FooBarBaz"
py_str_case.constcase('foo_bar_baz') # => "FOO_BAR_BAZ"
py_str_case.constcase('FooBarBaz') # => "FOO_BAR_BAZ"
py_str_case.lowercase('foo_bar_baz') # => "foo_bar_baz"
py_str_case.lowercase('FooBarBaz') # => "foobarbaz"
py_str_case.pascalcase('foo_bar_baz') # => "FooBarBaz"
py_str_case.pascalcase('FooBarBaz') # => "FooBarBaz"
py_str_case.pathcase('foo_bar_baz') # => "foo/bar/baz"
py_str_case.pathcase('FooBarBaz') # => "foo/bar/baz"
py_str_case.sentencecase('foo_bar_baz') # => "Foo bar baz"
py_str_case.sentencecase('FooBarBaz') # => "Foo bar baz"
py_str_case.snakecase('foo_bar_baz') # => "foo_bar_baz"
py_str_case.snakecase('FooBarBaz') # => "foo_bar_baz"
py_str_case.spinalcase('foo_bar_baz') # => "foo-bar-baz"
py_str_case.spinalcase('FooBarBaz') # => "-foo-bar-baz"
py_str_case.titlecase('foo_bar_baz') # => "Foo Bar Baz"
py_str_case.titlecase('FooBarBaz') # => " Foo Bar Baz"
py_str_case.trimcase('foo_bar_baz') # => "foo_bar_baz"
py_str_case.trimcase(' FooBarBaz ') # => "FooBarBaz"
py_str_case.uppercase('foo_bar_baz') # => "FOO_BAR_BAZ"
py_str_case.uppercase('FooBarBaz') # => "FOOBARBAZ"
py_str_case.alphanumcase('_Foo., Bar') # =>'FooBar'
py_str_case.alphanumcase('Foo_123 Bar!') # =>'Foo123Bar'Failure Messagepy_str_case.alphanumcase('') # =>'Enter the string to convert..'Installpip install py_str_case
Package: py-streamkompressor
StreamKompressorStreamKompressor is a Python library for compressing and decompressing sample data streams from IoT devices and sensors.
It also can divide the data in a maximum-byte-number block size, ideal for sending data to a limited packet size communication protocol such LoraWan, non continuos satellite connectivity (LEO) or distributed storage systems.AlgorithmStreamKompressor manages only integer values and utf-8 encoded labels. It performs better with small labels (less characters as possible)InstallationUse the package managerpipto install foobar.pipinstallpy-streamkompressorUsagefromstreamkompressor.streamkompressorimportStreamKompressor#Input Data exampledata=[{'a':1,'b':2,'c':10000},{'a':7,'b':1,'c':10001},#...{'a':-34,'b':1,'c':10006}]#Initializesk=StreamKompressor()#Compressresult=sk.kompress(data,label="optional")#Decompressdata,label=sk.dekompress(result)ContributingPull 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: pystream-pipeline
PyStream - Real Time Python Pipeline ManagerThis package provides tools to build and boost up a python data pipeline for real time processing. This package is managed usingPoetry.For more detailed guidelines, visit this projectdocumentation.ConceptsIn general, PyStream is a package, fully implemented in python, that helps you manage a data pipeline and optimize its operation performance. The main feature of PyStream is that it can build your data pipeline in asynchronous and independent multi-threaded stages model, and hopefully multi-process model in the future.A PyStreampipelineis constructed by severalstages, where each stage represents a single set of data processing operations that you define by your own. When the stages have been defined, the pipeline can be operated in two modes:Serial mode:In this mode, each stage are executed in blocking fashion. The later stages will only be executed when the previous ones have been executed, and the next data can only be processed if the previous data have been processed by the final stage. There is only one data stream that can be processed at any time.Parallel mode:In this mode, each stage live in a separate parallel thread. If a data has been finished being processed by a stage, the results will be send to the next stage. Since each stage runs in parallel, that stage can immediately take next data input if exist and process it immediately. This way, we can process multiple data at one time, thus increasing the throughput of your pipeline.Mixed mode:This a mix of serial and parallel mode. You can put a serial pipeline inside a parallel one and vice versa. Parallel pipeline can improve the pipeline throughput but it is prone to larger latency. Mixing serial and parallel pipeline can very useful to optimize the latency and throughput of your pipeline further.Whatever the mode you choose, you only need to focus on implementation of your own data processing codes and pack them into several stages. PyStream will handle the pipeline executions including the threads and the linking of stages for you.InstallationYou can install this package usingpip.pipinstallpystream-pipelineIf you want to build this package from source or develop it, we recommend you to use Poetry. First install Poetry by following the instructions inits documentation site. Then clone this repository and install all the dependencies. Poetry can help you do this and it will also setup a new virtual environment for you.poetryinstall--withdevTo build the wheel file, you can runpoetrybuildYou can find the wheel file insidedistdirectory.Sample UsageAPI of PyStream can be found in this projectdocumentation.You can also access some examples:Seedemo.ipynbto get the quick start of PyStream.See how PyStream is used to increase the throughput of a vehicle environment mapping system inthis repository.
Package: pystream-protobuf
pyStreamPython implementation ofstream library.IntroductionThis library enablesstream processingof protobuf messages (or any serializable
objects since v1.6.3); i.e. multiple protobuf messages can be written/read into/from a
single stream or file.It was originally developed to parse/writevgfile formats (.vg,.gam, etc). However, it can be used for any arbitrary
protocol buffer messages.Refer to the C++stream libraryfor more
details.NOTE@vg users:The new version of stream library, now as a part oflibvgio, writes a header tag at the start of
the stream depending on the output format. For example, headers likeb'GAM'orb'VG'can be found before the actual protobuf messages in GAM and VG files
repectively. In this case, you should provide the expected value usingheaderkeyword argument; e.g.stream.parse('file.gam', vg_pb2.Alignment, header=b'GAM', persistent_header=True)for GAM files (since version v1.6.2).EncodingThe encoding is simple. Messages are written in groups of different sizes. Each
group starts with its size; i.e. the number of messages in that group. Then, the
size of each message is followed by the encoded message itself. Quoted fromGoogle Protobuf Developer Guide:The Protocol Buffer wire format is not self-delimiting, so protocol buffer
parsers cannot determine where a message ends on their own. The easiest way to
solve this problem is to write the size of each message before you write the
message itself. When you read the messages back in, you read the size, then
read the bytes into a separate buffer, then parse from that buffer.By default, the stream is considered compressed by GZip. However, uncompressed
stream processing is possible by passinggzip=Falseto any API calls.InstallationYou can install pyStream usingpip:pip install pystream-protobufUsageSeeWikifor usage documentation.DevelopmentIn case, you work with the source code and need to build the package:python setup.py buildThe proto files in the test module required to be compiled before running test
cases. To do so, it is required to have Google protobuf compiler (>=3.0.2)
installed. After installing protobuf compiler, run:make initto compile proto files required for test module and then:make testto run tests.
Package: pystreams
This small library provides you with convenient streams deeply inspired by
Java 8 release. That release contains not only lambdas but pretty cool
Stream API which provides developers with possibilities to build sequental
and parallel aggregation on big collections or infinite data flows.Frankly  I am not the Java guy but I have more or less the same workflow on
my previous projects where I actively usedconcurrent.futuresor Gevent
pools to process pipelines of incoming data to reduce them to some scalar
value or aggregated data set. As a rule I used that approach to manage big or
unpredictable collections of similar data using some appropriate concurrency
where it is possible (threads on computations, coroutines on networking, etc.)I saw how people are using the same pattern with ORMs but for generic cases
they still are trying to avoid mapping, filtering and reducing the results.
Actually this library tries to help.Please checkoutofficial documentationto get more information.
Package: pystress
pystress is a tool to stress your CPU in a simple manner.InstallationYou can install with pip:$ pip install pystressOr, you can download a source distribution and install with these commands:$ python setup.py installExample usageStress CPU(s) with the same number of processes for 60 (default) seconds:$ pystressStress CPU(s) with 2 processes for 10 seconds:$ pystress 10 2
Package: py-stresser
py-stresserДанная программа предназначенна для
стресс-тестирования различных файлов.На данный момент поддерживается работа со скриптами
на языках программированияc, c++, pythonпринцип работыу пользователя есть рабочее решение и решение с ошибкойпользователь пишет генератор тестовпользователь запускает утилитуустановка и использованиес помощью pip устанавливаем пакетpip install py-stresserзапускаем утилитуstresserс нужными нам параметрамиконфигурацияпараметры можно задавать аргументами командной строки,
либо с помощью конфигурационного файла с расширением.iniв случае использования конфигурационного файла все параметры должны быть в секции[settings]параметры:-h, --help            show this help message and exit
    -c CONFIG_PATH, --CONFIG_PATH CONFIG_PATH
                            путь к конфигурационному файлу. Если прописан, то все аргументы будут браться из него
    -S SOLUTION_PATH, --SOLUTION_PATH SOLUTION_PATH
                            путь к решению с ошибками
    -D DUMMY_PATH, --DUMMY_PATH DUMMY_PATH
                            путь к правильному решению
    -G GENERATOR_PATH, --GENERATOR_PATH GENERATOR_PATH
                            путь к программе, которая генерирует данные в stdout
    -N NTESTS, --NTESTS NTESTS
                            необходимое количество тестов. Базовое значение: 10000
    -s SAVE_TESTS, --SAVE_TESTS SAVE_TESTS
                            сохранять ли тесты. варианты: True/False. Базовое значение: false
    -t CHECKER_TYPE, --CHECKER_TYPE CHECKER_TYPE
                            тип чекера. варианты: ['base', 'base_with_format'] Базовое значение: base_with_formatпараметры SOLUTION_PATH, DUMMY_PATH, GENERATOR_PATH являютсяобязательнымипример работыпример работы можете посмотретьтутисходный коддерево проекта:.
├── test 
│   ├── tests
│   └── test.py
├── stresser
│   ├── modules
│   │   ├── parse.py
│   │   ├── launch.py
│   │   ├── __init__.py
│   │   └── checker.py
│   ├── __main__.py
│   └── __init__.py
├── setup.py
├── README.md
├── MANIFEST.in
└── Makefileкоманды в Makefilemake update- локальное обновление пакетаmake local_test- локальный запуск тестовmake deploy_test- проверка работы на удаленной машинеmake push- добавление пакета вpypiавтор:@gingersamurai
Package: pyStressTest
Description of the projectpyStressTestpyStressTest is a simple module for stress testing web resources.from pyStressTest.stress_test import StressTest
from pyStressTest.monitor import ChartMonitor

stress = StressTest('http://127.0.0.1:8000')
stress.timeout = 0.5
stress.max_execution_time = 10
stress.max_thread_count = 100
monitor = ChartMonitor(stress)
monitor.start()
monitor.build_graph()pyStressTest allows you to easily test your web resources with just a few lines of code.
The project works with the help of threads, you can set their maximum numberstress.max_thread_count = 100otherwise, they will be constantly created.You can specify timeout, this variable affects the speed of sending requests and the speed of creating threads.stress.timeout = 0.5You can specify a maximum resource testing time.stress.max_execution_time = 10pyStressTest can automatically display test statistics, for this you can use two classes:CMDMonitor - statistics will be displayed in the terminal;ChartMonitor - statistics will be displayed as two graphs (using matplotlib).You can read more in the class documentation.pyStressTest, if the response code from the resource is != 200, it will consider this an error and display a message about this in the terminal and display it in the statistics.
Package: pystrext
This package contains many helper functions to manipulate strings.Read the fabulous dochereQuickstartTo install:pip install pystrextUsage:>>> import pystrext as strext
>>> h,m,s = strext.extracts('elapse time : 5h 7m 36s','(\d+)h (\d+)m (\d+)s',['0']*3)
>>> h,m,s
('5', '7', '36')
>>> print strext.no_one_many(0,"No item","One item","%(n)s items")
No item
>>> print strext.no_one_many(1,"No item","One item","%(n)s items")
One item
>>> print strext.no_one_many(36,"No item","One item","%(n)s items")
36 items… more functions available :read the docNews0.1.7 (2015-01-02)add CHANGES.rst fileadd a Quickstat in documentation0.1.6 (2015-01-01)add docstringsadd sphinx doc0.1.1 (2014-12-30)First commitNo doc
Package: pystrfry
Aboutpystrfrya tool and Python 3 library for Linux for assisting in solving those annoyingstrfryCTF challenges that seem to be common in CTFs likeångstromCTF 2020andDawgCTF 2020.No additional requirements other than Linux and Python 3.InstallationPyPi# pip3 install pystrfryManual$ git clone https://github.com/arinerron/pystrfry.git
$ cd pystrfry
# python3 setup.py installUsageCommand Line InterfaceHelp Menu$ strfry --help

usage: strfry [-h] [--processid PROCESSID] [--timestamp TIMESTAMP] [--decode] string

a tool for solving those annoying strfry CTF challenges

positional arguments:
  string                the string to manipulate

optional arguments:
  -h, --help            show this help message and exit
  --processid PROCESSID, --pid PROCESSID, -p PROCESSID
                        process id which called strfry
  --timestamp TIMESTAMP, --ts TIMESTAMP, -t TIMESTAMP
                        unix timestamp when strfry happened
  --decode, -d          switch to decode mode$Example$ strfry --pid=1337 --ts=1234 "i use arch btw"
ubs twir ec ha

$ strfry --pid=1337 --ts=1234 "ubs twir ec ha" --decode
i use arch btwPython Library>>> from strfry import *

>>> strfry('i use arch btw', pid=1337, ts=1234)
'ubs twir ec ha'

>>> unstrfry('ubs twir ec ha', pid=1337, ts=1234)
'i use arch btw'

>>> strfry('this will pull the current ts / pid if you dont specify')
'iutihtfwel usnsd  f oyroyi    t p/rphpctlcsle n dleiitu'

>>> strfry('this will pull the current ts / pid if you dont specify')
'ols tupeprn ftod ceit l sehic  rys i tn pwl/uyflhdiiu t'

>>> strfry('this will pull the current ts / pid if you dont specify')
'ft sult f ynn srhp top /eihlew ipi ecdl l itutc rudyois'
Package: pystrgpw
pystrgpwA simple package that generates random characters and can be used for strong passwords.RequirementsPython >= 3.9.xInstallTo install the package, use the command below:pip install pystrgpwUsageThe basic usage of this package is explained below.importpystrgpwstrgpw=pystrgpw.Generator()# Set the character length output.strgpw.length(25)# Execute the generate process.strgpw.generate()# Get the generated output and print "0123456789abcdefghijklmn..."print(strgpw.get())To ContributeDevelopmentTo prepare the dev environment, you need to run the command below in your virtualenv:pip install -e .[dev]Unit TestingTo run the test cases, use the command below:pytest -s --verboseTravisCI and CoverallsWhen using a public repository on GitHub, the integration between TravisCI and Coveralls.io is pretty easy. To get started with coveralls-python, make sure to add your repo on theCoveralls.io. If you will be using coveralls-python on TravisCI, you’re done here.Publishing the PackageTo build the source code usingbdist_wheelandsdist, use the command below:python setup.py bdist_wheel sdistTo publish the source distribution onpypi.org(pip), run the command below:Install the twine:pip install twineExecute twine upload:twine upload dist/*When using Docker as Local Environment SetupUsing Docker compose setup, we need to make sure to execute the commands below to avoid environment issues:apk add --update --no-cache --virtual .tmp-build-deps gcc libc-dev linux-headers postgresql-dev libffi-devLicenseThis package is open-sourced software licensed under theMIT license.
Package: pystributed
PyStributed: Remote Execution UtilityThis package allows users to mark specific code cells in a Jupyter Notebook for remote execution. Once marked, the code will be packaged into a Docker container, sent to a specified remote server for execution, and the results will be fetched back to the local machine.InstallationExtract the contents of this directory to a location on your machine.Navigate to the directory and runpip install .to install the package.PrerequisitesDocker installed on both local and remote machines.SSH access to the remote machine.PyTorch and Transformers libraries if you are using them in your code.ConfigurationBefore using the package, you need to set up some configurations inconfig.py. Template can be seen below.docker_utils.pyis used to set docker file and container environment variablesremote_utils.pyis used to set docker container volume and host save locationUsageIn your Jupyter Notebook, import the package:importpystributed.mainasrunnerUse the%%save_for_remotemagic command to mark the code cell you want to run remotely:%%save_for_remote# Your code here# For example:importtorchmodel=torch.load('my_model.pth')result=model(some_data)After marking the desired code cell, run the cell to obtain results.Under the HoodThe package works in the following sequence:The code cell marked with%%save_for_remoteis saved to a Python script (temp_script.pyby default).A Docker image is built with the user's code and necessary dependencies.The Docker image is pushed to the specified Docker registry.The package SSHs into the specified remote server, pulls the Docker image, and runs it.Once the code execution is complete on the remote server, the results are fetched and saved to the local machine.ConfigurationTo customize the configuration forpystributed, create aconfig.jsonfile in the following location:~/.pystributed/config.jsonHere's a detailed structure for theconfig.jsonfile:{"BASE_IMAGE":"Name of the base docker image you want to use","PACKAGES_NEEDED":"Packages needed to execute code snippet","DOCKER_IMAGE_NAME":"Name of the Docker image that will be created.","DOCKER_REGISTRY":"Docker registry where the image will be pushed.","REMOTE_SERVER":"SSH-compatible address of your remote server (e.g., `user@remote_server_ip`).","REMOTE_WORKDIR":"Working directory on the remote server where results will be stored.","USER_CODE_PATH":"Temporary path on the local machine where the user's code will be saved before packaging.","SSH_PRIVATE_KEY_PATH":"Location of .pem file to access remote instance","GPU":"Set to 'True' if you are using a remote instance that requires your docker container to access the GPU on the instance"}
Package: pystrict
strictPython strict tagpip install pystrictUsing @strict on classes can prevent serious errors by raising an exception when an instance has a variable created outside of init.
Unfortunately, linters don't (cannot) always catch this.  I can't express how much time this has saved me recently.Using @strict on functions only checks type specifiers.Example:from pystrict import strict

# not allowed, missing type specifier
@strict
def foo(x: int, y):
    ...


# not allowed, missing type specifier in __init__
@strict
class Foo():
    def __init__(self, x: int, y):
        ...

# not allowed, object modified outside of init
@strict
class Foo():
    def __init__(self, x: int):
        self.x = 1

# mypy and pytest won't check this
def evil():
    return list({'a':Foo(1)}.values())

z = evil()
z[0].y = 4
Package: py-strict-typing
Python Strict Typing LibraryThis is a library written in pure Python that enables runtime type-checking for classes and functions via the use of a single@strictly_typeddecorator. Classes may enforce strict typing of their members and functions are able to have type-checked parameters and return values via type hints.InstallationThis library is available via PyPI. It may be installed with the following pip command:pip install py-strict-typingUsageWith ClassesAny class may declare itself as having strictly-typed members using the@strictly_typeddecorator:fromstrict_typingimport*@strictly_typedclassexample_class:a:intb:intprint(example_class.a)# NoneUpon assignment, any member of an instance of the class that provides a type hint will be type checked:example_inst=example_class()example_inst.a=123print(example_inst.a)# 123example_inst.a='hello'# results in TypeErrorAny members that do not have a type hint will not be checked. Also note that static assignments at the time of class declaration cannot be checked.fromstrict_typingimport*@strictly_typedclassexample_class:a='hello'b:list=123# valid. static assignment at declaration is not checkedinst=example_class()inst.a=123# valid. 'a' has no hint so it is not checkedWith FunctionsAny Python function may declare its parameters and return type as strictly-typed using the@strictly_typeddecorator:fromstrict_typingimport*@strictly_typeddeftest(a:int,b:str)->str:returnstr(a)+bprint(test(123,'hello'))# returns '123hello'print(test(10.0,'invalid'))# results in TypeErrorAs with strictly-typed classes, any parameters that lack a hint will not be checked.fromstrict_typingimport*@strictly_typeddeftest(a,b:str)->str:returnstr(a)+bprint(test(10.0,'not invalid'))# returns '10.0not invalid' as 'a' is no longer checked.This rule also applies to the return type hint:fromstrict_typingimport*@strictly_typeddeftest(a:int):returna+123@strictly_typeddeftest2(a:int)->str:returna+123print(test(111))# outputs '234'print(test2(111))# results in TypeError
Package: pystrin
# pystrinA small Python library for string interpolation.### UsageUse the `f` method on a string with a literal for string interpolation. Use `printf` instead to directly print the result. An example is:```name = 'campoe'printf('Hello {name}')# --- Output ---# Hello campoe```In fact, it can be used with any expression:```x = 3printf('5 * {x} = {5 * x}')# --- Output ---# 5 * 3 = 15```