Saravanan666/pypi-org huggingface dataset:
Package: pystubs
PyStubs: dummy values for equality testingThis tiny Python module provides various types that can be used to check
for conditions using equality (==) testing. For example, to test whether
a number is less than 5:>>>fromstubsimport*>>>2==LessThan(5)TrueWhich is completely equivalent to:>>> 2 < 5
TrueThis approach comes in handy when comparing nested containers, such as
JSON objects returned by an API:>>>expected_order={...'id':MatchesRegex('[0-9a-z]{10}'),...'quantity':GreaterThan(10),...'shippingAddress':Contains('Dublin'),...'deliveryDate':ANY,...'amount':InRange(200,500),...'items':Contains('apples')&...Contains('bananas')&...~Contains('pears'),...}>>>expected_order=={...'id':'cxw23fac3n',...'quantity':26,...'shippingAddress':'18 Some Street, Dublin, London',...'deliveryDate':'tomorrow',...'amount':300,...'items':[...'apples',...'avocados',...'bananas',...],...}True>>>expected_order=={...'id':'XXX',...'quantity':3,...'shippingAddress':'18 Some Other Street, New York City, USA',...'deliveryDate':'yesterday',...'amount':600,...'items':[...'apples',...'pears',...],...}FalseThis approach can be very useful in unit testing, to make tests cases
shorter and easier to understand.InstallationPyStubs has no external dependencies. To install it:$pipinstallpystubsList of stubsGenerics:StubUsageEquivalent toNotesANYx == ANYTruePLACEHOLDERx == PLACEHOLDERFalseMeant to be used as a placeholder to be replaced at a later timeAnyOfx == AnyOf([...])x in [...]NoneOfx == NoneOf([...])x not in [...]Equality:StubUsageEquivalent toNotesEqualx == Equal(y)x == yUseful when combined with other stubsNotEqualx == NotEqual(y)x != yOrder:StubUsageEquivalent toNotesLessThanx == LessThan(y)x < yLessThanOrEqualx == LessThanOrEqual(y)x <= yGreaterThanx == GreaterThan(y)x > yGreaterThanOrEqualx == GreaterThanOrEqual(y)x >= yInRangex == InRange(a, b)a <= x < bContainers:StubUsageEquivalent toNotesContainsx == Contains(y)y in xHasSizex == HasSize(y)len(x) == yCountOfx == CountOf(y, c)x.count(y) == cWorks on any iterable, even those that don't supportcount()HasItemsx == HasItems({key: value})x[key] = valueStrings:These works on bothstrandbytesobjects.StubUsageEquivalent toNotesStartsWithx == StartsWith(y)x.startswith(y)EndsWithx == EndsWith(y)x.endswith(y)MatchesRegexx == MatchesRegex(p)re.match(p, x) is not NoneContainsRegexx == ContainsRegex(p)re.search(p, x) is not NoneType and identity testing:StubUsageEquivalent toNotesIsx == Is(y)x is yIsNotx == IsNot(y)x is not yInstanceOfx == InstanceOf(type)isinstance(x, type)Combining stubsStubs can be combined with the|(or),&(and),^(exclusive or) and~(not) operators. For example, the following stub expression:>>>'apple'==HasSize(5)&Contains('a')Trueis equivalent to the expression:>>>len('apple')==5and'a'in'apple'TrueLicensePyStubs is placed in the public domain. Feel free to do whatever you want with
it and/or it's source code!
Package: pyStuffing
Python library to performBit StuffingandByte StuffingTo installpip install pyStuffing1. Bit Stuffing usage example.frompyStuffingimportBitStuffingfrompyStuffingimportclearif__name__=="__main__":stuff=BitStuffing()stuff.startStuffing()# START STUFFINGstuff.startUnstuffing()clear()# CLEAR SCREEN# PRINT SEQUENCES TO SCREENprint("Main Sequence:{}".format(stuff.sequence))print("Stuffed Sequence:{}".format(stuff.stuffed))print("Un-Stuffed Sequence:{}".format(stuff.unStuffed))print("Stuffed Sequence:{}".format(stuff.getStuffedColored()))ExplanationInititallise the classBitStuffing()You can pass the bit sequence to the class as a list.BitStuffing([0,0,1,1,1,1,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0])If nothing is passed on to the class, you will be prompted for input.Start the bit stuffing by calling the.startStuffing()method.The input sequence is obtained as.sequenceobject.The bit stuffed sequence is available as the.stuffedobject.The un-stuffed sequence can be obtained as the.unStuffedobject.The.getStuffedColored()returns the stuffed sequence along with the added flags, when printed, explicitly differentiates between the colors of the main sequence, bits stuffed and the flag.2. Byte Stuffing usage example.frompyStuffingimportByteStuffingfrompyStuffingimportclearif__name__=="__main__":stuff=ByteStuffing(list("abcdefghijklmnopqrstuvwxyz".upper()),escape_character="E",flag_character="F")# stuff = ByteStuffing()stuff.startStuffing()stuff.startUnStuffing()clear()print("Sequence:{}".format(stuff.sequence))print("Stuffed:{}".format(stuff.stuffed))print("Un-stuffed:{}".format(stuff.unStuffed))ExplanationInitiallise the classByteStuffing()You can pass the byte sequence to the class as a list.ByteStuffing(list("abcdefghijklmnopqrstuvwxyz".upper()))If nothing is passed on to the class, you will be prompted for input.Start the bit stuffing by calling the.startStuffing()method.The input sequence is obtained as.sequenceobject.The bytes stuffed sequence is available as the.stuffedobject.The un-stuffed sequence can be obtained as the.unStuffedobject.Note:You can set the.stuffedobject to the stuffed sequence and call the.startUnstuffing()to unstuff the sequence and be obtained sa the.unStuffedobject.
Package: pystun
PyStunA Python STUN client for getting NAT type and external IPThis is a fork of pystun originally created by gaohawk (http://code.google.com/p/pystun/)PyStun follows RFC 3489:http://www.ietf.org/rfc/rfc3489.txtA server following STUN-bis hasn’t been found on internet so RFC3489 is the
only implementation.InstallationTo install the latest version:$ pip install pystunor download/clone the source and install manually using:$ cd /path/to/pystun/src
$ python setup.py installIf you’re hacking on pystun you should use the ‘develop’ command instead:$ python setup.py developThis will make a link to the sources inside your site-packages directory so
that any changes are immediately available for testing.UsageFrom command line:$ pystun
NAT Type: Full Cone
External IP: <your-ip-here>
External Port: 54320Pass –help for more options:% pystun --help
usage: pystun [-h] [-d] [-H STUN_HOST] [-P STUN_PORT] [-i SOURCE_IP]
              [-p SOURCE_PORT] [--version]

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Enable debug logging (default: False)
  -H STUN_HOST, --host STUN_HOST
                        STUN host to use (default: None)
  -P STUN_PORT, --host-port STUN_PORT
                        STUN host port to use (default: 3478)
  -i SOURCE_IP, --interface SOURCE_IP
                        network interface for client (default: 0.0.0.0)
  -p SOURCE_PORT, --port SOURCE_PORT
                        port to listen on for client (default: 54320)
  --version             show program's version number and exitFrom Python:import stun
nat_type, external_ip, external_port = stun.get_ip_info()This will rotate through an internal list of STUN servers until a response is
found. If no response is found you will get “Blocked” as thenat_typeandNoneforexternal_ipandexternal_port.If you prefer to use a specific STUN server:nat_type, external_ip, external_port = stun.get_ip_info(stun_host='stun.ekiga.net')If you prefer to use a specific STUN server port:nat_type, external_ip, external_port = stun.get_ip_info(stun_port=3478)You may also specify the client interface and port that is used although this
is not needed:sip = "0.0.0.0" # interface to listen on (all)
port = 54320 # port to listen on
nat_type, external_ip, external_port = stun.get_ip_info(sip, port)Read the code for more details…LICENSEMIT
Package: pystun3
A Python STUN client for getting NAT type and external IP. Supports Python
versions 2 and 3.This project has been forked several times:
-original project by gaohawk-taken over by jtriley-forked and patched to support py3 by zoumi- and, finally, forked byTalkIQPyStun followsRFC 3489. A server following STUN-bis hasn’t been found on
internet so RFC3489 is the only implementation.InstallationTo install the latest version:$ pip install pystun3or download/clone the source and install manually using:$ cd /path/to/pystun3/src
$ python setup.py installIf you’re hacking onpystun3you should use the ‘develop’ command instead:$ python setup.py developThis will make a link to the sources inside your site-packages directory so
that any changes are immediately available for testing.UsageFrom command line:$ pystun3
NAT Type: Full Cone
External IP: <your-ip-here>
External Port: 54320Pass –help for more options:% pystun3 --help
usage: pystun3 [-h] [-d] [-H STUN_HOST] [-P STUN_PORT] [-i SOURCE_IP]
               [-p SOURCE_PORT] [--version]

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Enable debug logging (default: False)
  -H STUN_HOST, --host STUN_HOST
                        STUN host to use (default: None)
  -P STUN_PORT, --host-port STUN_PORT
                        STUN host port to use (default: 3478)
  -i SOURCE_IP, --interface SOURCE_IP
                        network interface for client (default: 0.0.0.0)
  -p SOURCE_PORT, --port SOURCE_PORT
                        port to listen on for client (default: 54320)
  --version             show program's version number and exitFrom Python:import stun
nat_type, external_ip, external_port = stun.get_ip_info()This will rotate through an internal list of STUN servers until a response is
found. If no response is found you will get"Blocked"as thenat_typeandNoneforexternal_ipandexternal_port.If you prefer to use a specific STUN server:nat_type, external_ip, external_port = stun.get_ip_info(stun_host='stun.ekiga.net')If you prefer to use a specific STUN server port:nat_type, external_ip, external_port = stun.get_ip_info(stun_port=3478)You may also specify the client interface and port that is used although this
is not needed:sip = "0.0.0.0" # interface to listen on (all)
port = 54320 # port to listen on
nat_type, external_ip, external_port = stun.get_ip_info(sip, port)Read the code for more details…LICENSEMIT
Package: pystun3-fix
A Python STUN client for getting NAT type and external IP. Supports Python
versions 2 and 3.This project has been forked several times:original project by gaohawktaken over by jtrileyforked and patched to support py3 by zoumiand, finally, forked byTalkIQPyStun followsRFC 3489. A server following STUN-bis hasn’t been found on
internet so RFC3489 is the only implementation.InstallationTo install the latest version:$ pip install pystun3or download/clone the source and install manually using:$ cd /path/to/pystun3/src
$ python setup.py installIf you’re hacking onpystun3you should use the ‘develop’ command instead:$ python setup.py developThis will make a link to the sources inside your site-packages directory so
that any changes are immediately available for testing.UsageFrom command line:$ pystun3
NAT Type: Full Cone
External IP: <your-ip-here>
External Port: 54320Pass –help for more options:% pystun3 --help
usage: pystun3 [-h] [-d] [-H STUN_HOST] [-P STUN_PORT] [-i SOURCE_IP]
               [-p SOURCE_PORT] [--version]

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Enable debug logging (default: False)
  -H STUN_HOST, --host STUN_HOST
                        STUN host to use (default: None)
  -P STUN_PORT, --host-port STUN_PORT
                        STUN host port to use (default: 3478)
  -i SOURCE_IP, --interface SOURCE_IP
                        network interface for client (default: 0.0.0.0)
  -p SOURCE_PORT, --port SOURCE_PORT
                        port to listen on for client (default: 54320)
  --version             show program's version number and exitFrom Python:import stun
nat_type, external_ip, external_port = stun.get_ip_info()This will rotate through an internal list of STUN servers until a response is
found. If no response is found you will get"Blocked"as thenat_typeandNoneforexternal_ipandexternal_port.If you prefer to use a specific STUN server:nat_type, external_ip, external_port = stun.get_ip_info(stun_host='stun.ekiga.net')If you prefer to use a specific STUN server port:nat_type, external_ip, external_port = stun.get_ip_info(stun_port=3478)You may also specify the client interface and port that is used although this
is not needed:sip = "0.0.0.0" # interface to listen on (all)
port = 54320 # port to listen on
nat_type, external_ip, external_port = stun.get_ip_info(sip, port)Read the code for more details…LICENSEMIT
Package: pystunnel
OverviewStart and stop astunnelinstance given astunnel configuration file.Thestunnelexecutable must be available on the system PATH.
The configuration file must specify a PID file.InstallationUse your favorite installer to install the pystunnel library and script.
E.g.:$ pip install pystunnelExamplesFrom the command line:$ pystunnel -c /path/to/stunnel.conf start
started
$ pystunnel -c /path/to/stunnel.conf check
running
$ pystunnel -c /path/to/stunnel.conf stop
stoppedIf the command is omitted, pystunnel enters an interactive shell:$ pystunnel -c /path/to/stunnel.conf
pystunnel> start
started
pystunnel> check
running
pystunnel> stop
stopped
pystunnel> quit
$From Python:from pystunnel import Stunnel
stunnel = Stunnel("/path/to/stunnel.conf")

rc = stunnel.start()
print("stunnel started with rc", rc)

if stunnel.check() == 0:
    print("stunnel is running with pid", stunnel.getpid())
else:
    print("stunnel is not running")

rc = stunnel.stop()
print("stunnel stopped with rc", rc)Return Codes0 means OK, 1 or higher means error.Changelog1.0a1 - 2016-03-14Initial release.
Package: pystun-patched-for-raiden
PyStunA Python STUN client for getting NAT type and external IPThis is a fork of pystun originally created by gaohawk (http://code.google.com/p/pystun/)PyStun follows RFC 3489:http://www.ietf.org/rfc/rfc3489.txtA server following STUN-bis hasn’t been found on internet so RFC3489 is the
only implementation.InstallationTo install the latest version:$ pip install pystunor download/clone the source and install manually using:$ cd /path/to/pystun/src
$ python setup.py installIf you’re hacking on pystun you should use the ‘develop’ command instead:$ python setup.py developThis will make a link to the sources inside your site-packages directory so
that any changes are immediately available for testing.UsageFrom command line:$ pystun
NAT Type: Full Cone
External IP: <your-ip-here>
External Port: 54320Pass –help for more options:% pystun --help
usage: pystun [-h] [-d] [-H STUN_HOST] [-P STUN_PORT] [-i SOURCE_IP]
              [-p SOURCE_PORT] [--version]

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           Enable debug logging (default: False)
  -H STUN_HOST, --host STUN_HOST
                        STUN host to use (default: None)
  -P STUN_PORT, --host-port STUN_PORT
                        STUN host port to use (default: 3478)
  -i SOURCE_IP, --interface SOURCE_IP
                        network interface for client (default: 0.0.0.0)
  -p SOURCE_PORT, --port SOURCE_PORT
                        port to listen on for client (default: 54320)
  --version             show program's version number and exitFrom Python:import stun
nat_type, external_ip, external_port = stun.get_ip_info()This will rotate through an internal list of STUN servers until a response is
found. If no response is found you will get “Blocked” as thenat_typeandNoneforexternal_ipandexternal_port.If you prefer to use a specific STUN server:nat_type, external_ip, external_port = stun.get_ip_info(stun_host='stun.ekiga.net')If you prefer to use a specific STUN server port:nat_type, external_ip, external_port = stun.get_ip_info(stun_port=3478)You may also specify the client interface and port that is used although this
is not needed:sip = "0.0.0.0" # interface to listen on (all)
port = 54320 # port to listen on
nat_type, external_ip, external_port = stun.get_ip_info(sip, port)Read the code for more details…LICENSEMIT
Package: pystv
Python project for adjudicating ranked choice voting elections using the
single transferable vote (STV) method.  For more information on ranked
choice voting, visit theFairVote website on RCV.The project also contains a small flask server for adjudicating and visualizing
election results from a CSV file.  It is automatically deployed at atpyrcv.orgFree software: GNU General Public License v3Documentation:https://pystv.readthedocs.io.FeaturesGeneral standards and APIs for voting data and vote tabulation.Tabulation of ranked-choice elections using the single-transferable-vote (STV) method.Support for both single-winner and multi-winner contests.Generation of Sankey diagram showing the flow of vote counts through the
rounds of a multi-round election.Parser for converting Google Form based election output to voting data standard format.Web server which processes CSV data output from a Google Form based election, and
displays winners and a Sankey diagram.CreditsInspired byFairVoteandCalRCV.  FairVote’s examples were extremely helpful for
development and correctness-testing.This package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.
Package: pystval
Project RelocationThe project has been successfully moved to a new name and address. Now you can find it at the following link:https://github.com/m62624/flexible_inspectThis decision was made due to the fact that the first version of the project encountered some bugs and problems. The new version has been redesigned to take these comments into account and has gained more flexibility and usability, especially when importing into programming languages other than Python. We are confident that these changes will allow the project to work more efficiently and reliably
Package: py-style-flattener
Py Style FlattenerIntroductionThis module is useful to move all the css from style tags to inline style attributeMakes use of pyquery and regex (due to stdlib's re module not supporting recursion)Keeps all the @font-face but removes everything elseInstallationpipinstallpy_style_flattenerUsageIt can be used from cli:$py-style-flattenerINPUTOUTPUT(note that INPUT and OUTPUT can be either paths or stdin/stdout)Or as a python module>>>importpy_style_flattener>>># using files, you need to open them before.>>>py_style_flattener.using_files(INPUT,OUTPUT)>>># using plain strings>>>OUTPUT=dpy_style_flattener.using_strings(INPUT)Current limitations:doesn't fetch remote stylecannot set pseudo elements (limitation inherited from cssselect used by pyquery)only takes care of @media screen{} avoiding all other media queriesContributingbuild & releasepipinstallbuildtwine
python-mbuild
python-mtwineupload--config-file.pypircdist/*
Package: py-stylus-ui
py-stylus-uiMap a Wacom stylus tablet to specific area on the screen.Installationpython -m pip install py-stylus-uiUsageResize the window to the area that you want to map and click the button. The stylus now will work only within those boundaries.How it worksIt is wrapper aroundxsetwacomcommand that defines theMapToOutput.WhyIn cases where the result on the screen has to closely match the physical movement of the hand, e.g taking notes, it may be desirable to adjust the effective area on the screen to achieve this.Planned featuresSave different areas (profiles)Switch between profiles through a shortcut. This will allow to map the tablet buttons to iterate through profiles.Different aspect ratiosTablet rotation1:1 mapping...
Package: pystyx
pystyxPython implementation of Styx ETL declarative TOML.For more information about Styx,please see the definition here.Quick StartIn your Python project,mkdirmapstouchfunctions.styx (TODD: Add init for this) and functions.py (if you want to write custom functions)Infunctions.styx, add an array calledfunctions, with the names of any functions you plan on using in your mappings:# functions.styxfunctions=["to_upper_case"]Infunctions.pyimplement your custom function. Ensure that your function takes the same number of arguments as your expectedinput_paths, or use*args. The# functions.pyfrompystyx.functionsimportstyx_function@styx_functiondefto_upper_case(value):returnvalue.upper()Add any of your Styx Definitions to themaps/directory. For example,from_type="erp_address"to_type="Address"[fields][fields.address1]input_paths=["addr1"][fields.address2]input_paths=["addr2"][fields.city]input_paths=["city"][fields.state]input_paths=["province"]function="to_upper_case"[fields.zip]input_paths=["postalCode"]Initialize maps in your Python code:// blob.json{"addr1":"123 Street","addr2":"Ste. 800","city":"Dallas","province":"tx","postalCode":"75080",}# main.pyimportjsonimportpathlibimportpystyx# Ensure that your decorated functions are evaluatedfromfunctionsimport*withpathlib.Path("blob.json").open()asjson_file:blob=json.load(json_file)maps=pystyx.create_maps()# Defaults to `/maps` and `functions.styx`mapper=maps.get("erp_address")# 'from_type` from the Definition abovemapped_obj=mapper(blob)print(mapped_obj)Prints:{"address1":"123 Street","address2":"Ste. 800","city":"Dallas","state":"TX",// Upper case now"zip":"75080"}Styx Validationpystyx.create_maps()parses (and thereby validates) the Styx files before loading them. I hope to extract this validation as a CLI tool (along with generating Styx structures).Styx ImplementationI wanted this to be a good first example of a Styx implementation, so I believe it currently implements all features of the Styx standard.
Parsing and validation I would like to extract into its own library eventually.FeatureImplementedStructures-  JSON objects:heavy_check_mark:Validation/Parsing- Full parsing:heavy_check_mark:Preprocessing-  input_paths:heavy_check_mark:-  output_paths:heavy_check_mark:-  function:heavy_check_mark:-  or_else:heavy_check_mark:-  on_throw:heavy_check_mark:Fields-  field header:heavy_check_mark:-  input_paths:heavy_check_mark:-  possible_paths:heavy_check_mark:-  const:heavy_check_mark:-  from_type:heavy_check_mark:-  or_else:heavy_check_mark:-  on_throw:heavy_check_mark:-  many:heavy_check_mark:Postprocessing-  input_paths:heavy_check_mark:-  output_paths:heavy_check_mark:-  function:heavy_check_mark:-  or_else:heavy_check_mark:-  on_throw:heavy_check_mark:
Package: pysu
Simple Python-based setuid+setgid+setgroups+exec. A port ofhttps://github.com/tianon/gosuFree software: BSD licenseInstallationpip install pysuDocumentationUsage: pysu [-h] user[:group] commandChange user and exec command.positional arguments:user
commandoptional arguments:-h,--helpshow this help message and exitDevelopmentTo run the all tests run:toxChangelog0.2.0 (2016-05-06)Allow using “:group” as argument, just likegosu(it will use the current user, but with the given group).0.1.0 (2016-04-19)First release on PyPI.