Saravanan666/pypi-org huggingface dataset:
Package: patio-rabbitmq
PATIO RabbitmqPATIO is an acronym forPythonAsynchronousTask for AsyncIO.This package provides RabbitMQ broker implementation.ExampleTask executorimportasyncioimportoperatorfromfunctoolsimportreducefrompatioimportRegistry,ThreadPoolExecutorfrompatio_rabbitmqimportRabbitMQBrokerrpc=Registry(project="patio-rabbitmq",auto_naming=False)@rpc("mul")defmul(*args):returnreduce(operator.mul,args)asyncdefmain():asyncwithThreadPoolExecutor(rpc,max_workers=16)asexecutor:asyncwithRabbitMQBroker(executor,amqp_url="amqp://guest:guest@localhost/",)asbroker:awaitbroker.join()if__name__=="__main__":asyncio.run(main())Task producerimportasynciofrompatioimportNullExecutor,Registryfrompatio_rabbitmqimportRabbitMQBrokerasyncdefmain():asyncwithNullExecutor(Registry(project="patio-rabbitmq"))asexecutor:asyncwithRabbitMQBroker(executor,amqp_url="amqp://guest:guest@localhost/",)asbroker:print(awaitasyncio.gather(*[broker.call("mul",i,i,timeout=1)foriinrange(10)]),)if__name__=="__main__":asyncio.run(main())
Package: patio-redis
PATIO RedisPATIO is an acronym forPythonAsynchronousTask for AsyncIO.This package provides Redis broker implementation.ExampleWorkerimportasyncioimportoperatorfromfunctoolsimportreducefrompatioimportRegistry,ThreadPoolExecutorfrompatio_redisimportRedisBrokerrpc=Registry(project="test",strict=True)@rpc("mul")defmul(*args):returnreduce(operator.mul,args)asyncdefmain():asyncwithThreadPoolExecutor(rpc,max_workers=16)asexecutor:asyncwithRedisBroker(executor,url="redis://127.0.0.1:6379",max_connections=50,)asbroker:awaitbroker.join()if__name__=="__main__":asyncio.run(main())ProducerimportasynciofrompatioimportNullExecutor,Registryfrompatio_redisimportRedisBrokerrpc=Registry(project="test",strict=True)asyncdefmain():asyncwithNullExecutor(rpc)asexecutor:asyncwithRedisBroker(executor,url="redis://127.0.0.1/",max_connections=50,)asbroker:foriinrange(50):print(awaitasyncio.gather(*[broker.call("mul",i,j,timeout=1)forjinrange(200)]),)if__name__=="__main__":asyncio.run(main())
Package: patlas
A simple, runtime-dependency-free texture atlas packer.Basic usage:frompatlasimportAtlasPacker,loadfromglobimportglobap=AtlasPacker(side=2048,pad=2)ap.pack(glob('images/*.png'))# list of imagesap.pack(['images/image.jpg'])# can call multiple times (packing quality may suffer)ap.atlas# memoryview of RGBA textureap.metadata# dictionary of image locations and image formatap.save('atlas')# serialize as custom .patlas fileatlas,metadata=load('atlas.patlas')Seedemo.pyfor example usage withModernGL.Features/limitations:Usesstb_image,stb_rect_pack, andstb_dxtfromstbCan import any image formatstb_imagecan (seehere)Only square RGBA textures (currently)Optional DXT5/BC3(?) compressionOptional OpenMP support (disabled by default to reduce wheel size) can substantially reduce runtime. To enable, build from source withOMP=1set in the environment, e.g.OMP=1 pip install patlas --no-binary patlasOn Windows, should "just work"?MacOS may need extra packages, e.g.libompfrom brewLinux may need extra packages, e.g.libomp-devon UbuntuSave to a custom.patlasfileUsesqoiimage format + zlib for fast and small encoding/decodingSee thesavemethod ofAtlasPackerfor gory detailsIncludes a command-line utility (seepatlas --helpfor details)Requires Cython at build time (but source distribution should have pre-generated.cfiles)
Package: patlet
Pattern LettersGeting startedThis library has been tested with Python 3.6-3.10 and Pypy 3.Installation using pip$ pip install patletUsehorizontal printingfrompatletimportPatLet# output the entered text to the consolePL=PatLet("PatLet")PL.printer(char='*')writing .txt filefrompatletimportPatLet# write the entered text to a .txt filePL=PatLet("i am reading a book")PL.writer(char="*",filename="book")
Package: patlib
patlibPurposes:Share tools across my projects, such as DAPPER.Define optional dependencies to setup my dev. environments by
"inheriting" from here. The aim is that I only need to keep
pylib up to date (e.g. pinning buggy Jedi or pdbpp),
rather than thepyproject.tomlof each and every project.[tool.poetry.dev-dependencies]# Either:patlib={version="==0.2.8",extras=["mydev","misc"]}# Or:patlib={path="../../py/patlib",extras=["mydev","misc"],develop=true}NB: Maybe this is a bad idea; maybe I will forget to include e.g.
numpy when publishing the other project.Provide pylab replacementPoetry workflowInit projectAbandom project (tmp)Resume projectPublish/realease PyPI/GitHubAdd dependencies (by poetry or pyproject.toml)Update dependenciesVirtual env managementPre-commit, Lint, Test, CI, Docs
Package: patmat
Functional-style recursive pattern matching in Python. Crazy stuff.InstallpipinstallpatmatUsagePattern matching withpatmat:>>>frompatmatimport*>>>Mimic({(1,Val('k')):(3,Val('v'))}).match({(1,2):(3,4)}){'k':2,'v':4}Multiple dispatch generic functions:>>>frompatmatimport*>>>>>>@case>>>deffunc(match,l=[Val('head'),...,3,Val('tail')]):...print('a list with a head{}and a tail{}'.format(match.head,match.tail))>>>>>>@case>>>deffunc(match,l=Val('item')):...print('an item{}'.format(match.item))>>>>>>func([1,2,3,4])alistwithahead1andatail4>>>func(5)anitem:5More dispatch examples:>>>@case>>>deffunc(_,x=int):...print('Do something with an integer.')>>>>>>@case>>>deffunc(_,x=float):...print('Do something with a float.')>>>>>>func(1)Dosomethingwithaninteger>>>func(1.0)DosomethingwithafloatMatcheslist,tuple,dict, types, classes with attributes. Brace
yourself for the power of recursive pattern matching:>>>frompatmatimport*>>>m=Mimic([...1,Type(int,Val(2)),...Mimic(a=3,b=[4,Val(5),6],c=Val(7)),...Val(8),{Val(9):10,Val(11):12},...])>>>classA:...__init__=lambdaself,**kwargs:self.__dict__.update(kwargs)>>>m.match([1,2,A(a=3,b=[4,5,6],c=7),8,{9:10,11:12}]){2:2,5:5,7:7,8:8,9:9,11:11}
Package: patois
patoisis an MIT-licensed compatibility library designed to smooth
over differences in various Python VMs,
e.g., CPython vs. Jython vs. PyPy vs. IronPython. It provides utility
functions with the goal of making it easier to write Python code that is
compatible with all the major Python VMs. See the documentation for more
information on what is provided.patoissupports Python 2.7, because it is the newest Python that is
widely supported by the major VMs.InspirationThis package was inspired bySix.InstallationTo installpatois, simply:$ pip install patoisOr, if you absolutely must:$ easy_install patoisBut, you really shouldn’t do that.If you want to vendor the lib for some reason, it’s a single file, so just drop
it into your project.DocumentationOnline documentation is athttps://readthedocs.org/patoisHow to ContributeBugs can be reported tohttps://github.com/gthank/patoisThe code can also be found there. Please feel free to fork it and submit pull
requests.History0.1.0 (2014-01-08)Initial project creation
Package: patool
PatoolPatool is an archive file manager.Various archive formats can be created, extracted, tested, listed,
searched, repacked and compared with patool. The advantage of patool is
its simplicity in handling archive files without having to remember a
myriad of programs and options.The archive format is determined by the file(1) program and as
a fallback by the archive file extension.patool supports 7z (.7z, .cb7), ACE (.ace, .cba), ADF (.adf), ALZIP (.alz),
APE (.ape), AR (.a), ARC (.arc), ARJ (.arj), BZIP2 (.bz2), BZIP3 (.bz3),
CAB (.cab), CHM (.chm), COMPRESS (.Z), CPIO (.cpio), DEB (.deb), DMS (.dms),
FLAC (.flac), GZIP (.gz), ISO (.iso), LRZIP (.lrz), LZH (.lha, .lzh),
LZIP (.lz), LZMA (.lzma), LZOP (.lzo), RPM (.rpm), RAR (.rar, .cbr),
RZIP (.rz), SHN (.shn), TAR (.tar, .cbt), XZ (.xz),
ZIP (.zip, .jar, .cbz), ZOO (.zoo) and ZSTANDARD (.zst) archive formats.It relies on helper applications to handle those archive formats
(for examplexzfor XZ (.xz) archives).The archive formats TAR, ZIP, BZIP2 and GZIP are supported natively
and do not require helper applications to be installed.Examples# Extract several archives with different formats
patool extract archive.zip otherarchive.rar

# Extract archive with password
patool extract --password somepassword archive.rar

# Test archive integrity
patool test --verbose dist.tar.gz

# List files stored in an archive
patool list package.deb

# Create a new archive
patool create --verbose /path/to/myfiles.zip file1.txt dir/

# Create a new archive with password
patool create --verbose --password somepassword /path/to/myfiles.zip file1.txt dir/

# Show differences between two archives
patool diff release1.0.tar.gz release2.0.zip

# Search for text inside archives
patool search "def urlopen" python-3.3.tar.gz

# Repackage an archive in a different format
patool repack linux-2.6.33.tar.gz linux-2.6.33.tar.bz2WebsiteSeehttps://wummel.github.io/patool/for more info and downloads.APIYou can use patool functions from other Python applications.
Log output will be on sys.stdout and sys.stderr.
On errors,PatoolErrorwill be raised.
Note that extra options or customization
for specific archive programs are not supported.import patoolib
patoolib.extract_archive("archive.zip", outdir="/tmp")
patoolib.test_archive("dist.tar.gz", verbosity=1)
patoolib.list_archive("package.deb")
patoolib.create_archive("/path/to/myfiles.zip", ("file1.txt", "dir/"))
patoolib.diff_archives("release1.0.tar.gz", "release2.0.zip")
patoolib.search_archive("def urlopen", "python3.3.tar.gz")
patoolib.repack_archive("linux-2.6.33.tar.gz", "linux-2.6.33.tar.bz2")
patoolib.is_archive("package.deb")Seehttps://wummel.github.io/patool/for detailed API documentation.Test suite statusPatool has extensive unit tests to ensure the code quality.Bash completionInstall the argcomplete python package withapt-get install python3-argcomplete,
then runeval "$(register-python-argcomplete patool)".
After that typingpatool, a<SPACE>and then<TAB>lists available options and commands.
Package: patpat
UpdateFixed a bug for checking connection with iProXPatpatPatpat is public proteomics dataset search framework that
only requires protein identifiers to be passed in to search for relevant datasetsBase UsageLoad Patpat package and create runtime environment:frompatpatimporthubfrompatpatimportmapperfrompatpatimportutilityutility.init()utility.initiate_uniprot_proteome_catalog()Directory structure of the runtime environment is as follows:patpat_env/
    |-- logs/
    |-- tmp/
    |-- result/
    |-- proteome/
        |-- UP_README_yyyy-mm-ddSearch for the peptide to be searched via the QueryHubidentifier_='P23950'q=hub.QueryHub()q.identifier=identifier_q.simple_query()Having checked that the corresponding FASTA file forMus musculusdoes not exist locally, consider obtaining from UniProt:Choose local peptide search.
The Mus musculus UP000000589 proteome file was not found locally.
Do you want to download it?(y/n)Get the search configs:conf_=q.get_query_config()Set up Mappers for MapperHub, search and get results:mappers_=[mapper.PrideMapper(),mapper.IProXMapper()]m=hub.MapperHub(config=conf_,mappers=mappers_,)m.mapping()result_=m.export()Result files store inpatpat_envs/result/<task_uuid>, you can find<task_uuid>bym.configIn its current version, Patpat supports both PRIDE and iProX databases. In addition,
Patpat is an extensible framework and users are encouraged to extend it with databases of interest to Patpat or
to build their processes.For more information, see GitHub (https://github.com/henry-leo/Patpat).
Package: patpat-viewer
Patpat-viewerA viewer forPatpatInstallationInstall Patpat-viewer by PyPIpip install patpat-viewerUsageAfter installation, running the FLASK server will enterthe sample environment.
As different systems have different methods for setting environment variables, operations may vary:Windows:> set FLASK_APP=patpat_viewer
> set FLASK_ENV=production
> flask runLinux:$ export FLASK_APP=patpat_viewer
$ export FLASK_ENV=production
$ flask runBefore starting the server, specify theanswers ofPatpatpatpat_envby changing the environment variables:Windows:...
> set PATPAT_ENV=<Absolute path of patpat_env>
> flask runLinux:...
$ export PATPAT_ENV=<Absolute path of patpat_env>
$ flask runExample in WindowsWe recommend using conda to manage environments. A clean environment makes me feel comfortable
and can also prevent hair loss.(base)> conda create --name=patpat python=3.10
...
(base)> conda activate patpat
(patpat)> pip install patpat-viewer
...
(patpat)> set FLASK_APP=patpat_viewer
(patpat)> set FLASK_ENV=production
(patpat)> set PATPAT_ENV=D:\patpat_env
(patpat)> flask run
Package: patray
patrayPatray stands for PulseAudioTray. It is "yet another pulseaudio frontend".Default viewConfiguringReasonsBrilliantyktoo sound switcherlacks of volume controlpasystrayhave too much options and heavy interfaceNo simple tray for all in one menu:port switching with radio buttonsvolume control scroll barFeaturesCard profile switchesProfile port switchesProfile volume sliderPort filters by maskConfigurable UI view: combo or radioLicensepatrayis offered under MIT license.Requirementspython 3.7+Installation$python-mpipinstallpatrayUsageCommon usecase is:$python-mpatray~/.patray.config.ymlConfiguration options are built oncocklogic, so you need to run$python-mpatray--helpto see all available options. But you can pass all options via command line interface, or even via environemnt vairables.ExampleFor version0.1.2help output looks like this:$ python -m patray --help
Usage: patray [OPTIONS] [CONFIGURATION_FILE]

Options:
  --profile-enabled BOOLEAN      [default: True]
  --profile-style [combo|radio]  [default: combo]
  --profile-weight FLOAT         [default: 1.0]
  --port-enabled BOOLEAN         [default: True]
  --port-style [combo|radio]     [default: radio]
  --port-maximum-volume INTEGER  [default: 100]
  --port-hide-by-mask TEXT
  --port-weight FLOAT            [default: 1.0]
  --log-level TEXT               [default: INFO]
  --icon-path FILE
  --icon-color TEXT              Use `random` value for random color on each
                                 click  [default: #fff]

  --version                      Show the version and exit.  [default: False]
  --help                         Show this message and exit.  [default: False]You can see all defaults and all «flat» keys. Your configuration file can look like this:icon-color: random
profile:
  enabled: true
  style: combo
port:
  enabled: true
  style: radio
  weight: 0.95
  maximum-volume: 100
  hide-by-mask:
    - "Front*"
    - "Rear*"
    - "Line In*"You can see, that each-in flat cli argument name can be cutted off to create tree-like config.
Package: patreon-archiver
Patreon ArchiverDownload Patreon content. Video content will be saved using yt-dlp. You
should ensure that you are logged into Patreon in the appropriate browser
profile.Recommendations in~/.config/yt-dlp/configor equivalent file:--cookies-from-browser chrome:Default

--add-metadata
--all-subs
--convert-subs srt
--embed-chapters
--embed-metadata
--embed-subs
--embed-thumbnail
--geo-bypass
--merge-output-format mkv
--no-overwrites
--sub-langs all
--write-info-json
--write-subs

--download-archive ~/somewhere-safeUsageRunpatreon-archiver. At minimum, campaign ID of the Patreon content
creator is required. See help with--help.Usage: patreon-archiver [OPTIONS] CAMPAIGN_ID

Options:
  -o, --output-dir TEXT           Output directory
  -b, --browser TEXT              Browser to read cookies from
  -p, --profile TEXT              Browser profile
  -x, --fail                      Do not continue processing after a failed
                                  yt-dlp command.
  -L, --yt-dlp-arg-limit INTEGER  Number of media URIs to pass to yt-dlp at a
                                  time.
  -S, --sleep-time INTEGER        Number of seconds to wait between requests
  -d, --debug                     Enable debug output
  --help                          Show this message and exit.How to get the campaign IDGo to the content creator's main page.View the source and search forpatreon-media/p/campaign/.After the/there should be a number, as inpatreon-media/p/campaign/12345678. In that case the campaign ID is12345678.
Package: patricesorter
patricesorterPatricesorter is a sample Python packaging structure.Installationpip install -e .orpip install patricesorterUsagePS C: patricesorter> patricesorter -h

usage: patricesorter [-h] [-v] [-q] [--nargs NARGS [NARGS ...]] {} ...

positional arguments:
  {}                    sub command help

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  -q, --quiet           suppress output
  --nargs NARGS [NARGS ...]Command LinePS C:patricesorter> patricesorter --nargs 60 20 50 1 4

The ['60', '20', '50', '1', '4'] sorted to  ['1', '20', '4', '50', '60']  , the first price is 1 last price 60InterfacePS C: patricesorter> python

Python 3.7.4 (tags/v3.7.4:e09359112e, Jul  8 2019, 20:34:20) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import patricesorter as ps
>>> ps.sort_prices(['60', '20', '50', '1', '4'])
(['1', '20', '4', '50', '60'], (First 1, Last 60))Using toxtox -e docs  # to build your documentation
tox -e build  # to build your package distribution
tox -e publish  # to test your project uploads correctly in test.pypi.org
tox -e publish -- --repository pypi  # to release your package to PyPI
tox -av  # to list all the tasks availableNoteThis project has been set up using PyScaffold 4.2.1. For details and usage
information on PyScaffold seehttps://pyscaffold.org/.
Package: patrick-helloworld
Create Your Own Python PackageBased on the talk here:https://www.youtube.com/watch?v=GIF3LaRqgXo&ab_channel=CodingTechSetup StepsCreate your Python module (in here it is helloworld.py)Create setup.py file (see setup.py file)Run "python setup.py bdist_wheel" (creates build, dist, and other folders/files)Optional: Create .gitignore (just good practice, checkout gitignore.io)Add the .egg-info file in the src directory to the .gitignore (it is unnecessary apparently).Create README.mdRun "pip install -e ." to install this package locally (run frequently to check your work)Add a license (checkout choosealicense.com). MIT License added here by default.Optional: Run some tests (checkout a package called pytest, it is great)Run "pip install check-manifest", then "check-manifest --create", then "git add MANIFEST.in" (this all helps the next step run properly)Run "python setup.py sdist" to create a .tar.gz file with the source code for distributionRun "python setup.py bdist_wheel sdist"Run "pip install twine", then "twine upload dist/*" and woohoo! you have now uploaded it to pypi!To test with different versions of Python, checkout the "tox" packageTo get started, it is best to use the "cookiecutter" package! Run "pip install cookiecutter" then "cookiecutter gh: ionelmc/cookiecutter-pylibrary
Package: patriotwsgi
patriotwsgi======================================A WSGI Middleware that sends every request and response to an API (that may or may not be fictional) hosted in datacenter that may or may not actually exists somewhere in the US.At NSA we want to help you help your country by sending us all the information that might some day be useful in catching some criminal.This middleware assumes that you haven't done anything illegal and you don't have anything to hide, and therefore it's totally reasonable for us to collect data for your own safety.Installation------------::$ pip install patriotwsgiQuickstart----------::from patriotwsgi import NSAMiddlewarefrom myapp.wsgi import applicationapplication = NSAMiddleware(application)Status------This library doesn't actually exists.License-------You can:* promote this library* redistribute this library* use this libraryYou can't:* tell anyone that you're using this library. Especially your end users.FAQs----Q: Is this for real?A: No. It's supposed to be a joke. We're not the actual NSA.
Package: patrol
PatrolTrigger methods from changed files - e.g. selectively rebuild your project or
run tests as soon as you hit the save button on your text editor or IDE.Patrol works well withProjectKey.UseTo install:pip install patrolExample code:importpatroldefbuild(filenames):touch("output/build_started")time.sleep(2)touch("output/build_finished")defrun_test(filenames):touch("output/test_started")time.sleep(30)touch("output/test_finished")patrol.watch([patrol.Trigger(build,includes=["data/*",],excludes=['data/exclude/*','output/*',],),patrol.Trigger(run_test,includes=["data/*",],excludes=['data/exclude/*','output/*',],reaper=patrol.Reaper(),# If triggered while method is in progress, this will stop it and start it again.fire_on_initialization=True,# When the watch is initiated, this trigger will also fire.),],directory=os.getcwd(),# By default it patrols the present working directory.lockfiles=[".git/index.lock",],# This will wait until git has finished its operations before firing any triggers)FeaturesPatrol does not use polling to detect file changes. It useslibuv, which creates event driven hooks to filesystem events using epoll, kqueue or IOCP.You can queue up triggers when a specified lockfile is present - e.g. you can use to prevent triggers from firing until git operations are done.Patrol comes with a customized Reaper class that can be used to specify how a process is stopped.
Package: patrolify
patrolifyDo some checks every day, so that you can read the "news" in the morning while
drinking coffee.InstallHow to write a check?Define the "target" you want to checkfrompatrolifyimportTargetclassIPTarget(Target):def__init__(self,ip):self.ip=ipDefine how to check that "target"frompatrolifyimportcheck@check(IPTarget)defcheck_ip(target):returnTrue,"it's ok"A check function can:generates more targets: as long as the target can be checked by another
checker;or return True/False to indicate the check was passed or not, plus a string
indicate the extra informationTest Your CheckerIn local environment, you can test your checker from__main__. But you need
to firelocal_test_setup()first.For example, you can write this in yourchecker.py:if__name__=='__main__':frompatrolify.utilsimportlocal_test_setuplocal_test_setup()print(check_ip(IPTarget("127.0.0.1")))How to deploy?Reporter was written in pure Python, requirements:Python 3.11+Redis 5.0+Installation(The namepatrolifywas taken on Pypi):pipinstallpatrolifyThen you need to run 4 components after installation:Component NameWhat for?DependenciesCommand exampleCan deploy instances?adminA portal so that you can see the resultsfilesystem, Redispatrolify --redis-url redis://127.0.0.1:6379 admin --port 8084Yes, as long as the result directory exist.schedulerTrigger the checker jobsRedisrqscheduler --host localhost --port 6379 --db 0(it's redis'hostandport)Yes, supports auto fail overworker(for checker)Get jobs from queue(Redis) and run itRedispatrolify --redis-url redis://127.0.0.1:6379 worker --queue=checkerYes, every worker will get jobs from queue and run it, more workers, more work loadworker(for patrolify)Get jobs from queue(Redis) and run it, only works for collecting the resultsRedispatrolify --redis-url redis://127.0.0.1:6379 worker --queue=patrolifyYes, same above. But it must be deployed onto the same server with adminschedulerworker (2 types, for running checker jobs and patrolify jobs)adminArchitecture: