Saravanan666/pypi-org huggingface dataset:
Package: pigeonhole
.. contents::Introduction============Pigeonhole is a tool used to create dashboards from templates rendered with mr.bob:https://pypi.python.org/pypi/mr.bobA complete example of using Pigeonhole is currently under development:https://github.com/maikroeder/encode.mouseTo get an idea of what kind of dashboards you will be able to produce with Pigeonhole, havea look at the ENCODE RNA Dashboards (human and mouse):http://genome.crg.es/encode_RNA_dashboardDesign======The post_render hook of mr.bob is used to get hold of the configuration for individualmr.bob runs. This way, Pigeonhole does not need to know how mr.bob does its magic, andcan concentrate on plugging the individual templates together by calling them on demandwhile rendering the dashboard.Zope Page Template support for mr.bob=====================================Pigeonhole extends mr.bob with a renderer for Zope Page Templates, which can beused instead of the default Jinja2 templates:https://pypi.python.org/pypi/zope.pagetemplateTo use this renderer, place the following line in your .mrbob.ini:[template]renderer = pigeonhole.rendering:pagetemplate_rendererChangelog=========0.1 (2013-04-03)----------------- Integration with mr.bob- Package created using tooth.paste
Package: pigeon-jupyter
🐦 pigeon - Quickly annotate data on Jupyter========================Pigeon is a simple widget that lets you quickly annotate a dataset ofunlabeled examples from the comfort of your Jupyter notebook.Pigeon currently supports annotation for classification tasks (set oflabels), regression tasks (int/float range), or captioning tasks(variable-length text). Anything that can be displayed on Jupyter(text, images, audio, graphs, etc.) can be displayed by pigeonby providing the appropriate :code:`display_fn` argument.Examples------ Text classificationCode:.. code-block:: pythonfrom pigeon import annotateannotations = annotate(['I love this movie', 'I was really disappointed by the book'],options=['positive', 'negative'])Preview:.. image:: http://i.imgur.com/00ry4Li.gif- Image classificationCode:.. code-block:: pythonfrom pigeon import annotatefrom IPython.display import display, Imageannotations = annotate(['assets/img_example1.jpg', 'assets/img_example2.jpg'],options=['cat', 'dog', 'horse'],display_fn=lambda filename: display(Image(filename)))Preview:.. image:: http://i.imgur.com/PiE3eDt.gif
Package: pigeonly-address
Pigeonly AddressFor standardizing addresses.For more information on USPS API keys and terms, seehereInstallationpip install pigeonly-addressExample Usagefrompigeonly_addressimportAddressService,StandardizeAddressError# Example usagetry:address={"name":"aj patel","line_one":"5 reynolds","line_two":"#3","city":"New bedford","governing_district":"MA","postal_code":"02744","country":"USA"}standardized_addr=AddressService("USPS_API_KEY").standardize_address(**address)print(standardized_addr)# Example success# {#     "name": "AJ PATEL",#     "line_one": "5 REYNOLDS ST",#     "line_two": "APT 3",#     "city": "NEW BEDFORD",#     "governing_district": "MA",#     "postal_code": "02740",#     "country": "US",#     "meta": None# }# ------------------------------------------# A `meta` field is also returned.# Usually meta is None.# But sometimes, like if an address is correct,# but the address apt # is not verified,# a message returns => meta["message"]meta=standardized_addr.pop("meta")ifmetaandmeta.get("message"):print(meta["message"])exceptStandardizeAddressErrorase:# Example str(e) == "Address Not Found"print(e)USPS DocsFor US Addresses, it uses the USPS API when possible.USPS Address DocsUSPS Docs HOME
Package: pigeons
pigeonsPigeons is an easy and practical alert tool which enables sending logs to MSTeams.
It also supports dynamic filtering of log records with an option to use
regex to capture records of any logger.InstallationInstalling through pippip install pigeonsBuild from sourcegit clone https://github.com/obss/pigeons
cd pigeons
python setup.py installUsagePigeons is easy to use with just two line of codes.import sys

from pigeons import init_logger, pigeon_excepthook

sys.excepthook = pigeon_excepthook
logger = init_logger(
    ...
)With Start FlagsPigeons will look for specified flags in the beginning of the log for
the specified log level. If the log message starts with the flag, then
it will be sent to specified endpoint.import logging

from pigeons import init_logger

endpoint = "https://custom_domain.com/api/..."
my_flag = "!my_flag "
logger = init_logger(
        endpoint=endpoint,
        level=logging.INFO, # Default
        log_to_teams=True,
        tf_capture_flags=[my_flag],
        tf_regex=False
)With RegexPigeons will look for specified regex in the log for the specified log level.
If the log message matches the regex, then it will be sent to specified endpoint.import logging

from pigeons import init_logger

endpoint = "https://custom_domain.com/api/..."
my_regex = "^[a-zA-Z0-9]+$"
logger = init_logger(
        endpoint=endpoint,
        level=logging.INFO, # Default
        log_to_teams=True,
        tf_capture_flags=[my_regex],
        tf_regex=True
)Uncaught ExceptionsPigeons has a custom excepthook for handling uncaught exceptions.
To handle uncaught exceptions just overridesys.excepthookas followsimporty sys
from pigeons import pigeon_excepthook

sys.excepthook = pigeon_excepthookExamples# Lower levels will be ignored.
logger.debug("This log will be ignored.")

# At level=level (logging.INFO)
logger.info("This log is ignored".)
logger.info(my_flag + "This log is captured and sent to Teams.")

# Higher levels will always be captured regardless presence of flag.    
logger.warning("This is sent.")
logger.error("This is also sent.")
logger.critical("Another captured message.")
logger.fatal("And another one.")ContributingPRs are always welcomed.Installationgit clone https://github.com/obss/pigeons.git
cd pigeons
python setup.py develop
pip install -r requirements-dev.txtTestsTo tests simply run.pytest tests/Pigeons uses black to assure code style standard.black . --config pyproject.tomlLicenseLicensed under theMITLicense.
Package: pigeonsai
PigeonsAI SDKThe PigeonsAI SDK is a Python package that provides an interface to interact with the PigeonsDB database. This SDK allows you to search, initialize, get database information, and add documents to the database.InstallationTo install the PigeonsAI SDK, use pip:pip install pigeonsaiUsageTo use the PigeonsAI SDK, first import the PigeonsDB class:from pigeonsai import PigeonsDBInitialize the connectionBefore using the SDK, you need to initialize the connection to the database by providing your API key and database name:api_key = "your_api_key"
db_name = "your_db_name"
PigeonsDB.init(api_key, db_name)Add documentsTo add documents to the database, use the add method:documents = ["document1", "document2", "document3"]
metadata_list = [{"metadata1": "value1"}, {"metadata2": "value2"}, {"metadata3": "value3"}]

PigeonsDB.add(documents, metadata_list)SearchTo search the database, use the search method:query_text = "your_search_query"
k = 10  # Number of results to return
metadata_filters = [{"metadata1": "value1"}]  # Optional metadata filters
keywords = ["keyword"]  # Optional keywords

PigeonsDB.search(query_text, k, metadata_filters, keywords)ContributingIf you'd like to contribute to the PigeonsAI SDK, please submit a pull request or open an issue on the GitHub repository.LicenseThe PigeonsAI SDK is released under theMIT License
Package: piger
pigThis is a simple package named 'pig'. You can see猪猪的主页to write your content.安装pip3 install piger使用函数从运行开始到结束用了多长时间from piger.timecost import tc
@tc
def func():
    print('func开始')
    a=1
    print('func结束')

func()结果func开始
func结束
函数 func 耗时 0.000126 秒
Package: piglatin
piglatinConverts english text to piglatin.Installationpiglatincan be installed from PyPI usingpip.pip install piglatinUsage>>>importpiglatin>>>piglatin.translate("hello world!")'ello-hay orld-way!'Command Line Usagepiglatincan also be used as a command line tool.$python-mpiglatin"hello world!"ello-hayorld-wayOr read and write to files.$python-mpiglatin-iinput.txt-ooutput.txt
Package: pig-latin
# Python Pig LatinTranslate text into Pig Latin using Python## How it worksThis script converts English text in Pig Latin following these steps:Strips non-alpha or single space characters from input textConverts input text to all lower caseFor words that start with consonants, moves all consonants before the first vowel to the end of the word (“the” becomes “ethay” not “hetay”)For words that start with vowels, nothing is changed, only the suffix is addedAdds suffix “ay” to the end of words## InstructionsInstall with Pip/PyPi in the command line interface:` pip installpig-latin`In your Python code, import the library:` import piglatin `Call the translator in your code:`piglatin.translate('Yourtext goeshere!')`Your text will be translated into Pig Latin and returned as a string.
Package: piglet-templates
piglet-templates is a text and HTML templating engine in the genshi/kajiki
templates family.The Piglet template engine offers:Template inhertitance through <py:extends>/<py:block> (similar to Jinja2)Compiles templates to fast python byte code.HTML templating: templates produce well formed HTML. Template variables are
autoescaped to protect against XSS attacks.Reusable template functions.Good i18n support.Clear tracebacks from exceptions raised in templates.Piglet Template Engine Documentation|RepositoryExample piglet template:<py:extendshref="layout.html"><py:blockname="content"><h1>This is the content block.</h1><p>Hello $user.firstnames $user.lastname!</p><ppy:for="verse in poem"><py:foreach="line in verse">$line<br/></py:for></p></py:block></py:extends>There’s a text templating mode too:Hello $user.firstnames $user.lastname!

{% for verse in poem %}
    {% for line in verse %}$line
    {% end %}
{% end %}LicensePiglet-templates is licensed under the Apache license version 2.0.Piglet-templates is developed byOlly Copeand was created forskot.be
Package: pig-manager
Pig ManagerA simple pretty printer for Pig Latin scripts because it looks really bad!InstallationTo install Pig Pretty Printer, simply use pip:pipinstallpig-managerUsageAfter installation, you can run pig-manager from the command line:pig-manager -f <file> [options]Options-f, --file_path: Path to the Pig script file.
-dl, --dump_log: Flag to dump error output.
-do, --dump_out: Flag to dump standard output.
-l, --dump_loc: Location to dump output and error files.ExampleA sample of how pig-manager works:pig_pretty_printer -f ./example_script.pig -dl -do -l ./logs+-----------------+--------+
| Category        | Count  |
+=================+========+
| Furniture       | 517447 |
+-----------------+--------+
| Technology      | 807396 |
+-----------------+--------+
| Office Supplies | 588687 |
+-----------------+--------+
|                 |        |
+-----------------+--------+## License
This project is licensed under the MIT License.
Package: pigment
PigmentPigmentis a set of Python utilities for colors.>>>red=Color(255,0,0)>>>blue=Color(0,0,255)>>>blend(red,blue).hsv(300,100,50)InstallationPigment is available on PyPI:$python-mpipinstallpigmentPigment officially supports Python 3.5+.API ReferenceSeeRead the Docsfor Pigment's documentation.
Package: pignacio_scripts
Reusable python scripts and snippets I find useful.This is a bundle of scripts and snippets I packaged to avoid copypasting code.Some are tested, some are not. Some are not tested at all.You’ve been warned: here be dragons.Suggestions, comments, bug reports and pull requests are always accepted. :)Free software: LGPLv2.1 licenseDocumentation:https://pignacio_scripts.readthedocs.org.FeaturesI like namedtuples, so:Namedtuple with default valuesMock namedtuples for testingA helper for creating alarms/checks for nagios/icingaSome testing utilities:An extended TestCase classA helper for capturing and testing writes to stdoutQuick coloring functions for terminal output… and some more stuff not worth mentioning :)History0.0.3 (2015-05-10)FIX: setup.py correctly sets packages now. Updated makefile.Setting empty__slots__onnamedtuple_with_defaults. This fixes__dict__and reduces memory usage.0.0.2 (2015-04-30)SimplerNagiosLoggerinterface. (backwards incompatible)Feature:Testcase.assertSoftCalledWithmethod for mock partial call
assertions.FIX:NagiosLoggerwas not restoring stdout.FIX:NagiosLoggerchoked when output contained empty lines.Feature:namedtuple_with_defaultsuses alambdainstead of a
classmethod for mutable defaults. (backwards incompatible)0.0.1 (2015-03-29)PackagingNamedtuple with defaultsMock namedtupleNagiosLoggerCustom TestCasecapture_stdoutColors for the terminal
Package: pi-gpio-api
API to access Raspberry Pi GPIO based on Python, Flask & Rpi.GPIO library. The software launches an web API that controls IO pins using theRpi.GPIOlibrary.This was meant to be used to remotely control relays, thus, it only sets the outputs as high or low.The pins are referenced through their number printed in the board. Further information about pins can be foundhere.APIRouteRequestDescription/api/gpio/GETReturns a json object with the status of all pins/api/gpio/power/<PIN>GETReturns a json object with the power pins position and description (5V, 3V3, GND)/api/gpio/io/<PIN>GETReturns a json object with de description and status for a pin. If no pin number is given, returns the status of all io pins./api/gpio/io/<PIN>POSTSets up a particular pin. Receives a json object that must have the keystypeandvalue.typemust be a string with eitherinputoroutputandvaluemust be a boolean, with the status to write to the channel of the request.Sample response{"io":[{"pin":3,"pin_function":"IO","pin_state":1},...],"power_pins":[{"pin":1,"pin_function":"3V3 Power"},...]}InstallationLatest release through PyPI:$pipinstallpi_gpio_apiDevelopment version:$gitclonegit@github.com:jcapona/pi-gpio-api.git$cdpi-gpio-api$pipinstall-e.CLIThe api can be run as a daemon using thegpioapicommand in the Raspberry Pi shell.$gpioapi-husage:gpioapi[-h][-HHOST][-pPORT]commandGPIOwebAPIcontrollerpositionalarguments:commandControlprocess:start,stop,restart,statusoptionalarguments:-h,--helpshowthishelpmessageandexit-HHOST,--hostHOSThostwherethewebserverwillbelistening-pPORT,--portPORTportwherethewebserverwillbelisteningThis way, the API can be launched throughgpioapi startand stopped throughgpioapi stop.Use as a libraryIn a python shell:>>>importpi_gpio_api>>>pi_gpio_api.app.run(host='0.0.0.0',port=5000)This will launch a server that listens requests on the given host & port.ContributionFeel free to open issues, report bugs or open pull requests.
Package: pigpio-dht
DHT11 and DHT22 Driver Library based on thepigpioGPIO library.Installationpip installpigpio-dhtSupported Versions of PythonTested against Python >= 3.5.May work with earlier 3.X versions but this has not been confirmed. Does not work with Python 2.7.LinksGitHub RepositoryDHT Sensors are SlowDHT sensors are slow to take readings, and need to settle between reads. For instance, the maximum read rates for the sensors are:DHT11 once every 1 secondsDHT22 once every 2 secondsThis library monitors the read rate and will pause between successive calls toread()to honor these limits.ExamplesOne-Shot ReadTake a single reading from the sensor.Code# NOTE: The import has a _ not - in the module name.
from pigpio_dht import DHT11, DHT22

gpio = 21 # BCM Numbering

sensor = DHT11(gpio)
#sensor = DHT22(gpio)

result = sensor.read()
print(result)Output{'temp_c': 20, 'temp_f': 68.0, 'humidity': 35, 'valid': True}Also seeread()Sampled ReadTake many readings (by repeating callingread()) from the sensor and return a normalised result.Code# NOTE: The import has a _ not - in the module name.
from pigpio_dht import DHT11, DHT22

gpio = 21 # BCM Numbering

sensor = DHT11(gpio)
#sensor = DHT22(gpio)

result = sensor.sample(samples=5)
print(result)Output{'temp_c': 20, 'temp_f': 68.0, 'humidity': 35, 'valid': True}Also seesample()APIThe classesDHT11andDHT22both extend the base classDHTXXand share a common API.Constructor: DHT11 | DHT22(gpio, timeout_secs=0.5, use_internal_pullup=True, pi=None)ParametersgpioGPIO (BCM) pin that data leg of sensor is connected totimeout_secsSensor timeout in second. Default should be adequate unless you receive a TimeoutError advising you to increase the value wuth callingread()orsample()use_internal_pullup- Enable internal pull-up resistor on gpiopia custom instance ofpigpio.pi()read(retries=0) raises TimeoutErrorTake a single reading from the sensor.Parametersretriesnumber of times to keep retrying when the result containsvalid = FalseReturnsA Dictionary in the form{'temp_c': 20, 'temp_f': 68.0, 'humidity': 35, 'valid': True}Where:temp_cis the temperature in degrees Celsiustemp_fis the temperature in degrees Fahrenheithumidityis the relative humidityvalidis true only if sensors checksum matches with returned data.Discard readings wherevalue == Falseand try again.RaisesTimeoutErrorIf the sensor ongpiodoes not respondIf the sensor responds withintimeout_secs(see _Constructor), but the response cannot be understood by the library. Try increasingtimeout_secsAlso seeDHT Sensors are Slowsample(samples=5, max_retries=None) raises TimeoutErrorTake many readings (by repeating callingread()) from the sensor and return a normalised result.Please note that a call tosample()takes time. For example for the DHT11 with a maximum read rate of once every 1 seconds, 5 samples will take approximately 1 second * 5 samples = 5 seconds.Parameters:samplesnumber of samples to takemax_retriesmaximum number of times to keep retryingper samplewhen the result containsvalid = False. Default to samples * 2RaisesTimeoutErrorSame as forread(),plusIfmax_retriesis reached
Package: pig-py
Pig-PyPig-py is a python console application that creates icon and splash images for android and ios platformsInstalationpip install pig-pyUsagepig [platform] [options]For more experience use 1024x1024 images for icons and 2732x2732 for splashPlatform typesioniciosandroidto doOptionsSee options too usingpig --helpCommandRequiredDescription-f--filetruefile name-o--outputfalsedestination folder of imagesExamplepig ionic -f file.png
Package: pigra
pigraWhat is it ?A Python parsing library for the IGRA v2 format.Key Featuresparses IGRA data according to theIGRAv2 specificationsdefines a clean Sounding data-structure easy to work withstreams records (don't operate the whole dataset in memory)handles incoming data from standard input (default), text file and compressed file (gz/zip)allows to filter soundings by providing your own function (including geoboxing)outputs to JSON format and human-readable headerscomputes statisticsno dependenciesunit-testedWhere to get itThe source code is currently hosted on GitHub at :https://github.com/pixel-ports/pigraBinary installer for the latest released version is available at thePython
package index.pipinstallpigraUsageUse it as a library from your code.Or basically from command line.catigra-data.txt|python-mpigra>output.jsonLicenseApache 2.0DocumentationHave a look at theexamplesdirectory.BackgroundWork onpigrastarted atOrangein 2019 for the needs of thePIXELeuropean project.Fundingpigrahas been developed as part of thePIXELproject, H2020, funded by the EC under Grant Agreement number769355.
Package: pigrometer
Raspberry Pi Temperature and HumidityThis app can be used to measure temperature and humidity with a DHT11 or DHT22 sensor connected to your raspberry pi.Installation>sudoaptinstalllibgpiod2
>pipinstallpigrometerUsageConnect a DHT11/DHT22 sensor to your raspberry pi on port GPIO 4. You can then run the app with the shell commandpigrometer. After starting the app you should be able to connect to the server athttp://<raspberry_pi_ip>:5000on your local network.To change which DHT sensor you're using or which pin you want to connect it to, run with--dht-versionor--dht-pinset. --dht-version can be set to either'DHT11'or'DHT22'. For possible pin names seethis circuit python guide. For other options type--help.To change the amount of data shown on the chart add params to the url?granularity=900&history=3where granularity is the number of seconds between points on the graph and history is the number of days to display.Upcoming featuresMore readable timestamps at the bottom of the chartBetter loggingMore features in the web ui, ability to easily set time range and granularityAbility to download data .csv with data from the web uiFeel free to create an issue if you run into any problems, or if there's any features you think would be a nice addition. Contributions are welcome as well.
Package: pigsqueeze
pigsqueezeA library to write and read arbitrary data to and from image files. You probably already know why you need it.pigsuqeeze is a command line tool as well as a Python library for easily writing arbitrary data to (and later retrieving it from) image files. Currently only JPEG and PNG are supported, but I'm open to add support for more file formats if they support this.For JPEG's, pigsqueeze stores binary data in one or more chunks of app-specific data segments as enabled by the JPEG specification. pigsqueeze automatically handles splitting large blobs of data across multiple chunks, since the limit per chunk is ~65KB. pigsqueeze's method allows for payload sizes of up ot ~15MB per segment. Multiple unused segments are available, so there is a theoretical limit of 135MB per image, which is probably plenty. If you need more, you should probably look at a different solution to your problem.For PNG's, data is stored in out-of-spec chunks, which each have a limit of ~2GB. Because this is plenty large, pigsqueeze does not support chunk splitting for this format.Installationpigsuqeeze can be installed via pip:$pipinstallpigsqueezeUsageUsage:pszread-jpg[OPTIONS]INPUT_IMAGEOUTPUT_FILE

Options:-s,--segmentINTEGER[required]-i,--identifierTEXT[required]--helpShowthismessageandexit.Usage:pszwrite-jpg[OPTIONS]INPUT_IMAGEDATAOUTPUT_FILE

Options:-s,--segmentINTEGER[required]-i,--identifierTEXT[required]--helpShowthismessageandexit.Usage:pszread-png[OPTIONS]INPUT_IMAGEOUTPUT_FILE

Options:-c,--chunkTEXT[required]-i,--identifierTEXT[required]--helpShowthismessageandexit.Usage:pszwrite-png[OPTIONS]INPUT_IMAGEDATAOUTPUT_FILE

Options:-c,--chunkTEXT[required]-i,--identifierTEXT[required]--helpShowthismessageandexit.As a Python library:frompigsqueezeimportload_image# Write some text to App segment 4 with identifier PSZimage=load_image("path/to/image.jpg")image.write(4,"PSZ",b"Some bytes to save in the file.")image.save("path/to/output.jpg")# Retrieve the text from the modified image fileimage=load_image("path/to/output.jpg")result=image.read(4,"PSZ")Usage NotesJPEGWhen adding data, a segment number needs to be specified. Available segment numbers are:[4,5,6,7,8,9,10,11,15]PNGWhen adding data, a chunk name needs to be specified. The name must be 4 characters long. The first letter must be lowercase.
It cannotbe any of the following segment names:IHDRPLTEIDATIENDtRNScHRMgAMAiCCPsBITsRGBiTXttEXtzTXtbKGDhISTpHYssPLTtIME