Saravanan666/pypi-org huggingface dataset:
Package: esy-osm-pbf
esy.osm.pbfis a low-level Python library to interact withOpenStreetMapdata files in theProtocol
Bufferslanguage.TheOpenStreetMap PBF formatdefines three primary data types:Node: An annotated point on the earth.Way: An list ofNodeitems forming a path or polygon.Relation: A set of related entries.This library uses Google’sprotobufPython implementation to decode binary data into native Python objects and
offers a convenient interface to iterate over all elements found in a.pbfdata file.FeaturesWhat it provides:A pythonic way to work with.pbfdata file entries.Conversion of lowlevel Protocol Buffer objects to Python objects like
dictionaries and lists.An easy way to filter and process OpenStreetMap data with Python.What itdoesn’tprovide:A mechanism to spatially query OpenStreetMap entries.Visualization of OpenStreetMap data.Installationesy.osm.pbfdepends on a Python version of 3.5 or above as well as on theGoogle Protocol Buffers. Usepipto
installesy.osm.pbf:$pipinstallesy-osm-pbfExampleThe following example selects some entries from the Andorra.pbfprovided bygeofabrik. The entries contained in these files
can be accessed usingesy.osm.pbf.Fileobjects.Openstreetmap definesparksby a tagleisurewith a value ofpark. Filter entries accordingly and store matching ones in
a listparks:>>> import esy.osm.pbf
>>> osm = esy.osm.pbf.File('test/andorra.osm.pbf')
>>> parks = [entry for entry in osm if entry.tags.get('leisure') == 'park']
>>> len(parks)
24In this copy of the Andorra.pbf, there seem to be at least 24 parks. Lets
select all with a name and show the first three of those:>>> [entry.tags['name'] for entry in parks if 'name' in entry.tags][:3]
['Jardins de Juberri', 'Parc Central', 'Plaça Guillemó']Licenseesy.osm.pbfis licensed under theGNU General Public License version
3.0.The Teamesy.osm.pbfis developed at theDLRInstitute ofNetworked Energy Systemsin the departement forEnergy Systems Analysis (ESY).
Package: esy-osm-shape
esy-osm-shapeesy.osm.shapeis a Python library to convertOpenStreetMapprimitives toshapelyobjects.UsageThe following examples operate on a historic dataset for Andorra fromgeofabrik. Let's download the dataset first:>>>importurllib.request>>>filename,headers=urllib.request.urlretrieve(...'https://download.geofabrik.de/europe/andorra-190101.osm.pbf',...filename='andorra.osm.pbf'...)Open the file and generate linestrings for eachhighwayOpenStreetMap entry.>>>importshapely,esy.osm.shape>>>shape=esy.osm.shape.Shape('andorra.osm.pbf')>>>highways=[...shapeforshape,id,tagsinshape(lambdae:e.tags.get('highway'))...iftype(shape)isshapely.geometry.LineString...]Using shapely objects it is also easy to compute geometric properties, like for
example the length of the highways (note that the unit of this length is in
longitude and latitude):>>>sum(linestring.lengthforlinestringinhighways)16.952160743015657For slightly more details, jump to thedocumentation.
Package: et
# etSending and receiving arbitrary data via UDPThis package implements a lightweight, pure-Python client and serverpair that sends and receives simple Python structures via UDP.  The original motivation is toenable a package to send "phone home" messages.The default encoding is zlib-compressed json. (pickle is not used outof security concerns[[example](https://www.smartfile.com/blog/python-pickle-security-problems-and-solutions/)].)# Example```make devready```In one shell, type:```$ python et/server.pyINFO:__main__:Listening on localhost:2233```In another shell, type:```$ python ./et/client.py```(There is no output from the client)In the server window, you should see messages like:```INFO:__main__:Received 4 bytes from ('127.0.0.1', 47750) in format 1INFO:__main__:Received 12 bytes from ('127.0.0.1', 59498) in format 2INFO:__main__:Received 18 bytes from ('127.0.0.1', 42396) in format 1{'test': 'data'}INFO:__main__:Received 26 bytes from ('127.0.0.1', 42598) in format 2{'test': 'data'}INFO:__main__:Received 122 bytes from ('127.0.0.1', 57842) in format 1{'version': '1.2.3rc4', 'sys.version_info': [3, 5, 2, 'final', 0], 'sys.platform': 'linux', 'local_ip': '172.18.20.148'}INFO:__main__:Received 108 bytes from ('127.0.0.1', 44319) in format 2{'version': '1.2.3rc4', 'sys.version_info': [3, 5, 2, 'final', 0], 'sys.platform': 'linux', 'local_ip': '172.18.20.148'}```Format 1 is json; format 2 is compressed json.
Package: et2adem
# et2ademاهم python package في آخر عشر سنين.The python package that you never knew you needed.نسخة من الprogress bar بس مع أغنية اتقدم.Progress bar but with the song [et2adem](https://youtu.be/BUi3OUbjZvU)The song is from the Egyptian movie النمر الاسود “The Black Tiger” performed by Ahmed Ibrahim.
No copyright infringement intended.## To install`pip install et2adem`### Usage`from et2adem import et2adem``for x inet2adem(range(100)):do something`
Package: et3
et3A simple library for Extracting and Transforming data, third incarnation.install$ pip install et3usageYou have a description of your data in the form of a dictionary, with
each key's value being a list of transformers. This description is
applied to a list of items using therenderandrender_itemfunctions.
The first transformer in the list of transformers receives the item, the
next element receives the result of the previous transformation and so on.Examples:example.pytest_render.pybot-lax-adaptor
Package: eta
ETA===This is a python package that will create progress bars for command-line programs.Example usage:from eta import ETAeta = ETA(ticks)for foo in bar:eta.print_status()eta.done()Or, file based usage (calls tell() to get progress)fobj = open(fname)eta = ETA(os.stat(fname).st_size, fileobj=fobj)for line in fobj:eta.print_status(extra="extra message")...eta.done()The output is something similar to:20.0% - 0:04 [====>               ] ETA: 0:17 (Optional messages go here)The default is to only display the progress bar *if* stderr is connected to aterminal (sys.stderr.isatty() is True). If you want to always enable theprogress bar, you need to set the evironmental variable 'SHOW_ETA'.To hide the progress bar (for use in other batch scripts), you can hide theprogress bar by setting the environmental variable 'HIDE_ETA'.The default is to update the progress bar every 0.2 sec, unless we aren'tattached to a tty (and SHOW_ETA is set). If we aren't attached to a TTY, thenno status messages are output to stderr at all.There is also a socket based ETA implementation that will listen to the file/tmp/eta-$pid. If you try to read this file, it will display all of the relevantETA information for the current process. You can (obviously) only have one activeSocket ETA object for each process.  You can start this ETA object by settingan environmental variable 'SOCKET_ETA'.
Package: etabar
Script Queue ManagerA simple library to display an eta bar. Useful to track the progress of long running tasks. It can be included in the project with just 2 lines of code.Installing from pipStable releasepipinstalletabarDevelopment releasepipinstall-ihttps://test.pypi.org/simple/etabarExample usagefrometabar.ETAimportETAimporttimeeta=ETA(100)time.sleep(2)foriinrange(100):eta.update()time.sleep(2)Getting StartedI highly recommend that you fork the project by clicking on theForkbutton and then cloning your fork using the command mentioned below.git clone <your fork URL>PrerequisitesPython 3.5+A code editor or IDE(preferable PyCharm)Setting up for DevelopmentFollow the steps mentioned below to get your dev instance running.After cloning your fork, open the project in an IDE or code editor of you choice.It is highly advisable that you create a new Python environment for the project. Follow the instructions givenhere.Navigate to the project directory and install therequirement.txtpackages.cd<project-directory>
pipinstall-rrequirements.txtTestsNot yet implementedContributingPlease readCONTRIBUTING.mdfor details on our code of conduct, and the process for submitting pull requests to us.AuthorsMayank Vaidya-Initial workSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSE.mdfile for details
Package: etabs
etabsPython library for building and rendering latex tables in an easy way.InstalationpipinstalletabsSimple exampleCode:frometabsimportRuleType,TexTable# Example valuesvalues=[[60,20,20],[50,40,10],[30,10,60],[5,90,5],]row_labels=["A","B","C","D"]col_labels=["C1","C2","C3"]# TexTabel is the main structure for creating tablestable=TexTable(centered=True,caption="Example table")# Add rowstable.add_row(None,*col_labels)# First value empty, rest are column labelsforlabel,rowinzip(row_labels,values):table.add_row(label,*row)# You can optionally add rules at specific rowstable.add_rule(0,RuleType.TOP)table.add_rule(1)# By default, the rule is a midrule# If no row is specified, it will be added at the endtable.add_rule(rule_type=RuleType.BOTTOM)# Finally to get the latex code use the render methodprint(table.render())Output:\begin{figure}[h!]\centering\caption{Example table}\vspace{0.5em}\begin{tabular}{cccc}\toprule&C1&C2&C3\\\midruleA&60&20&20\\B&50&40&10\\C&30&10&60\\D&5&90&5\\\bottomrule\end{tabular}\end{figure}Result:A little more styled examplefrometabsimportRuleType,TexTable# Example valuesvalues=[[60,20,20],[50,40,10],[30,10,60],[5,90,5],]col_labels=["C1","C2","C3"]table=TexTable(centered=True,caption="Example table")# Add valuestable.add_row(*col_labels,start=2)# Colum 0 and 1 are emptyforrowinvalues:# Preprocess each value to show as percentagetable.add_row(*row,prep=lambdax:f"{x}\\%",start=2)# Add a vertical separator before column 2table.seps[2]="|"# Assign values directlytable[1,1]=table[3,1]="A1"table[2,1]=table[4,1]="B2"# Merge cells using slicestable[0,0:2]="Types"table[1:3,0]="Typa A"table[3:,0]="Typa B"# Add some style using slices tootable[0,:].set_bold(True)table[:,0:2].set_bold(True)table[1:,0:2].set_italic(True)# Add rulestable.add_rule(0,RuleType.TOP)table.add_rule(1)table.add_rule(rule_type=RuleType.BOTTOM)print(table.render())Output:\begin{figure}[h!]\centering\caption{Example table}\vspace{0.5em}\begin{tabular}{cc|ccc}\toprule\multicolumn{2}{c|}{\textbf{Types}}&\textbf{C1}&\textbf{C2}&\textbf{C3}\\\midrule\multirow{2}{*}{\textit{\textbf{Typa A}}}&\textit{\textbf{A1}}&60\%&20\%&20\%\\&\textit{\textbf{B2}}&50\%&40\%&10\%\\\multirow{2}{*}{\textit{\textbf{Typa B}}}&\textit{\textbf{A1}}&30\%&10\%&60\%\\&\textit{\textbf{B2}}&5\%&90\%&5\%\\\bottomrule\end{tabular}\end{figure}Result:
Package: etag-cache
etag-response-cacheEtag cache implementation for HTTP requests, to save request bandwidth for a non-modified response. Returns
high-speed accessed dictionary data as cache.ConceptStore Etag value(as hash key:value pair) in the user's home directoryos.path.join(os.getenv("HOME"), ".pyapp")intoetagand successful response data intocacheDBM files.AddIf-None-Matchheader for allGETrequest.Updateetagandcachefor required request url, when none 304 http status is received i.e if response is modified.Returncachedata as dictionary for non-modified response.SampleGETrequest header withIf-None-Match:{'X-Kite-Version': '3', 'User-Agent': 'Kiteconnect-python/3.9.4', 
'If-None-Match': 'W/"i51p01GqP6TRPWsM"', 
'Authorization': 'token api_key:access_token'}InstallationTo-do: Release it as pypi packageUsageimportrequestsfrometag_packageimportEtagCachecache_object=EtagCache()url="https://api.kite.trade/portfolio/holdings"payload=""headers={'x-kite-version':"3",'authorization':"token api_key:access_token"}# Add etag to request headerheaders=cache_object.add_etag("GET",headers,url)response=requests.request("GET",url,data=payload,headers=headers)# Store etag from response headercache_object.save_etag(response)# Store response data as cacheresponse_dict=cache_object.add_read_cache(response)print(response_dict)ResponseDEBUG:urllib3.connectionpool:https://api.kite.trade:443 "GET /portfolio/holdings HTTP/1.1" 304 0

{'tradingsymbol': 'APOLLOPIPE', 'exchange': 'NSE', 'instrument_token': 3676417, 'isin': 'INE126J01016',
 'product': 'CNC', 'price': 0, 'quantity': 3, 'used_quantity': 0, 't1_quantity': 0, 'realised_quantity': 3,
 'authorised_quantity': 0, 'authorised_date': '2021-12-28 00:00:00', 'opening_quantity': 3, 'short_quantity': 
 0, 'collateral_quantity': 0, 'collateral_type': '', 'discrepancy': False, 'average_price': 582.666667, 
 'last_price': 539.8, 'close_price': 539.65, 'pnl': -128.60000100000002, 'day_change': 0.14999999999997726, 
 'day_change_percentage': 0.027795793569902208} .....
Package: etalumacontrol
etalumacontrolIntroductionThis library provides a simplified Python interface for interacting with Etaluma microscopes and motorized stages (600 and 700 series). Essentially, the code provides a simplified wrapper for Etaluma's own C# SDK usingPython.NET. This package requires Python 3.8 (or higher, but Python.NET currently supports only up to 3.8).Current state and limitationsThis library was written to facilitate our own use case, but may also be useful to others. If there's a particular feature that you feel is lacking, feel free to submit an issue or PR. Etalumacontrol has only been tested on our LS720, but should work on any 600 and 700 series microscope. 32-bit versions of the LumaUSB and WSC DLL's are included, but have not been tested.InstallationYou may install etalumacontrol fromPyPIby entering the following into a shell prompt, preferably after activating a virtual environment:py -m pip install etalumacontrolSample programHere's a sample program which moves the stage to a specified position, acquires an image, and displays it on the screen.frometalumacontrolimportEtalumaStage,LumaScope# use the "with" statement to automatically handle resource allocationwithEtalumaStage()asstage,LumaScope()asscope:# move stage to center of microscopy slidestage.move('x',-62.9)stage.move('y',-38)# turn on the brightfield ledscope.set_led(brightness=20)# turn up the gainscope.gain=10# set shutter speed to 150 msscope.shutter=150# acquire image and show itimg=scope.get_image()img.show()LicenseEtalumacontrol is licensed under a 2-clause BSD license.Etalumacontrol contains microscope firmware and DLL files kindly provided by Etaluma, which are not subject to this license. These files may be distributed as part of the etalumacontrol package, but for other uses please contact Etaluma directly.Etalumacontrol contains code written byJohn Kelley. See its separate license file in the CypressFX directory.
Package: etao
etao is a simple Python library that assists in the creation
of cryptanalysis tools. It takes care of common low-level tasks
such as converting letters to numeric values or splitting a buffer
into a bit stream or series of fixed-size blocks, as well as higher-level
things like frequency analysis.InstallationInstall with pip:pip install etaoAs of version 1.0.0 this library switched from Python 2 to Python 3; for
Python 2 use version 0.6.0.Example ApplicationThe following is a Caesar cipher solving tool that uses etao’s frequency
analysis functions and built-in ciphers.#!/usr/bin/env python# Caesar cipher solverimportargparsefrometaoimportCaesarCipher,NgramFrequencyScorerfrometao.freqimportENGLISH_DIGRAMSdefmain():parser=argparse.ArgumentParser(description="Caesar cipher solver")parser.add_argument('ciphertext',type=str,help='text to decipher')args=parser.parse_args()scorer=NgramFrequencyScorer(freq=ENGLISH_DIGRAMS)# Get every Caesar shift of the ciphertextshifts=[CaesarCipher(n).decrypt(args.ciphertext)forninrange(26)]# Score each shift according to English character frequency.# Get tuples that pair the score with the text.scored_shifts=[(scorer.score(shift),shift)forshiftinshifts]# Sort by score, descending orderscored_shifts.sort(reverse=True)# Print the top 3 resultsforresultinscored_shifts[0:3]:print('"%s" (%02d%%)'%(result[1],int(result[0]*100)))if__name__=="__main__":main()Here’s what it looks like in action:$./caesar_solver.py"O GQFSOAWBU QCASG OQFCGG HVS GYM. WH VOG VODDSBSR PSTCFS, PIH HVSFS WG BCHVWBU HC QCADOFS WH HC BCK.""A SCREAMING COMES ACROSS THE SKY. IT HAS HAPPENED BEFORE, BUT THERE IS NOTHING TO COMPARE IT TO NOW." (75%)
"U MWLYUGCHA WIGYM UWLIMM NBY MES. CN BUM BUJJYHYX VYZILY, VON NBYLY CM HINBCHA NI WIGJULY CN NI HIQ." (36%)
"P HRGTPBXCV RDBTH PRGDHH IWT HZN. XI WPH WPEETCTS QTUDGT, QJI IWTGT XH CDIWXCV ID RDBEPGT XI ID CDL." (35%)
Package: etap2pcap
Tibbo Ethernet Tappcap logger.Requirementspython >=3.8libusb-1.0Install$ pip install etap2pcapRun$ etap2pcap path/to/output.pcapIf output pcap already exists, new packages are appended.Licenseetap2pcap - Tibbo Ethernet Tap pcap loggerCopyright (C) 2021 Bozo KopicThis program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
Package: etatime
ETA TimeA library for tracking, computing, and formatting time estimates in Python. (Based ontqdm.)Why?tqdmis probably the most popular option for Python programmers to show progress in their programs. However, I wasn't happy with the default formatting code options, and wanted something that was easier to read and understand for an average user.In addition, I wanted to be able to access information like ETA in my code. Whiletqdmsort of lets you do this, it's not well documented, and you would have to dig through the source code to get the values and formulas you want.etatimeis my answer to this. It's a minimal wrapper aroundtqdmthat adds additional formatting codes and well-documented progress stats tracking.Basic UsageThe main feature of this library is theEtaBarclass. This is a wrapper for thetqdm.tqdmclass that provides variables which track important ETA state information for use elsewhere in your code.This uses another package I made calledtimefmtto format the times into human-readable text.For more information on the:=(walrus) operator, seethe documentation.importtime,randomimporttimefmtfrometatimeimportEtaBarforitemin(eta:=EtaBar(range(9999999))):# Creates a progress bar which tracks stats...# Do your processing hereprint(f"Done processing{eta.stats.total_items}items in{timefmt.td.long(eta.stats.elapsed_timedelta)}!\n")Here is an example of the sort of output this produces:14%|█▍        | 1432400/9999999 | R: 0:00:02 | ETA: 5:22:13 PM
 ...
100%|██████████| 9999999/9999999 | R: ??? | ETA: ???
Done processing 9999999 items in 2 seconds!You can get more verbose information by replacing the for loop with this:frometatimeimportEtaBarforitemin(eta:=EtaBar(range(9999999),bar_format="{l_bar}{bar}{r_barL}")):...# Do your processing hereHere is an example of the long output:35%|███▌      | 3545009/9999999 | R: 1 second | ETA: 5:26:11 PM MSTAll keyword arguments other thanbar_formatget passed directly totqdm.tqdm.bar_formatis pre-processed byetatimein order to inject some new customformatting codes:startS: The starting time in short digit format.startL: The starting time written out in plain english.currentS: The current (loop start time) time in short digit format.currentL: The current (loop start time) time written out in plain english.elapsedS: The elapsed time in short digit format.elapsedL: The elapsed time written out in plain english.remainingS: The remaining time in short digit format.remainingL: The remaining time written out in plain english.etaS: The ETA time in short digit format.etaL: The ETA time written out in plain english.r_barS=="| {n_fmt}/{total_fmt} | {remainingS} | {etaS}"r_barL=="| {n_fmt}/{total_fmt} | {remainingL} | {etaL}"The following attributes are available in thestatsdata class of theEtaBarinstance:total_itemsrateinitialnpercentstart_time(seconds)start_datetimecurrent_time(seconds)current_datetimeelapsed_time(seconds)elapsed_timedeltaremaining_time(seconds)remaining_timedeltaeta_time(seconds)eta_datetimeFull Documentation
Package: etatimer
This is meant to be a super simple drop in for tracking progress.This is, in essence, a wrapper around [progressbar2][1] with my personallypreferred defaults and ways of doing things.If you need anything even slightly more complicated than what EtaTimerprovides, I recommend looking at the progressbar2 module instead.[1]: https://github.com/WoLpH/python-progressbar# Quickstartfrom etatimer import EtaTimerimport timex = range(5)t = Timer(len(x))for i in x:t.tick()time.sleep(1)# Classes### `EtaTimer(total, name="", stream=sys.stdout)`Create a simple ETA Timer named `name` that tracks `total` number of operationsand prints updates to the stream `stream`.### `DummyEtaTimer()`Timer that supports same API as EtaTimer, but does nothing. Allows for codethat must always pass a timer, but doesn't always have information needed forcreating an EtaTimer.Example: If a file is not seekable, we can't determine the number of lines.if infile.seekable():timer = ETATimer(sum(1 for i in infile))infile.seek(0, 0)else:timer = DummyTimer()process_file(infile, timer)# API### `timer.tick()`Mark that one processing item has been completed.If all items are processed, ding() will be automatically called.The timer can be stopped early through manual calling of ding()Can be used as an arbitrary callback function. Will accept and ignore anynumber of parameters.### `timer.ding()`Timer's done!Prints final statistics.### `timer.finished`Boolean indicating if time is finished.
Package: etawatch
EtawatchLike a stopwatch, but it also gives you an ETA.Example usage:# construction immediately starts timereta_watch=etawatch(5)foriinrange(number_of_laps):# do some worktime.sleep(random.randint(1,3))eta,lap=eta_watch()print(f'Lap:{i+1}| Time:{lap:.2f}sec | ETA:{eta:.2f}min')Another example:fori,(eta,lap)inenumerate(etawatch(5)):# do some worktime.sleep(random.randint(1,3))print(f'Lap:{i+1}| Time:{lap:.2f}sec | ETA:{eta:.2f}min')It can optionally predict ETA by only the lastnnumber of runs.# will only calculate ETAs based on last 3 lap timeseta=etawatch(10,3)
Package: etb-pdf
Pdf.write() args:rows: list of dictionaries of data to be filled into PDFmap(optional): dictionary that maps values from rows to field names in the PDFfor example, if fields are ["Name", "Age"]and rows are [{"foo" : "John", "bar" : 25}, {"foo" : "Jane", "bar" : 30}],then map should be: {"Name" : "foo", "Age" : "bar"}naming(optional): very simple naming convention dict.naming["static_name"] will be the first part of the file namenaming["dynamic_name_key"] will be appended after a underscore. it will pull the (post mapping, if applicable) key value from each row and append it to the file name.for example (using the rows and map from above), if naming = {"static_name" : "output", "dynamic_name_key" : "Name"}then the file names will be: "output_John.pdf" and "output_Jane.pdf"required_keys:if map is not None: if True, all values in map dictionary will be assertedif you pass an iterable, then each value in the map dictionary that is in the iterable will be asserted