Saravanan666/pypi-org huggingface dataset:
Package: simple-text-parser
AboutA text parser written in the Python language.The project has one goal, speed! See the benchmark below more details.Project homepage:https://github.com/eerimoq/textparserDocumentation:http://textparser.readthedocs.org/en/latestCreditsThanksPyParsingfor a user friendly interface. Many oftextparser’s class names are taken from this project.InstallationpipinstalltextparserExample usageTheHello Worldexample parses the stringHello, World!and
outputs its parse tree['Hello',',','World','!'].The script:importtextparserfromtextparserimportSequenceclassParser(textparser.Parser):deftoken_specs(self):return[('SKIP',r'[ \r\n\t]+'),('WORD',r'\w+'),('EMARK','!',r'!'),('COMMA',',',r','),('MISMATCH',r'.')]defgrammar(self):returnSequence('WORD',',','WORD','!')tree=Parser().parse('Hello, World!')print('Tree:',tree)Script execution:$ env PYTHONPATH=. python3 examples/hello_world.py
Tree: ['Hello', ',', 'World', '!']BenchmarkAbenchmarkcomparing the speed of 10 JSON parsers, parsing a276
kb file.$ env PYTHONPATH=. python3 examples/benchmarks/json/speed.py

Parsed 'examples/benchmarks/json/data.json' 1 time(s) in:

PACKAGE         SECONDS   RATIO  VERSION
textparser         0.10    100%  0.21.1
parsimonious       0.17    169%  unknown
lark (LALR)        0.27    267%  0.7.0
funcparserlib      0.34    340%  unknown
textx              0.54    546%  1.8.0
pyparsing          0.68    684%  2.4.0
pyleri             0.88    886%  1.2.2
parsy              0.92    925%  1.2.0
parsita            2.28   2286%  unknown
lark (Earley)      2.34   2348%  0.7.0NOTE 1: The parsers are not necessarily optimized for
speed. Optimizing them will likely affect the measurements.NOTE 2: The structure of the resulting parse trees varies and
additional processing may be required to make them fit the user
application.NOTE 3: Only JSON parsers are compared. Parsing other languages may
give vastly different results.ContributingFork the repository.Install prerequisites.pip install -r requirements.txtImplement the new feature or bug fix.Implement test case(s) to ensure that future changes do not break
legacy.Run the tests.make testCreate a pull request.
Package: simpletextprogressbar
SimpleTextProgressBar - A simple progress bar for simple projectsThis Text Progress Bar is made for projects that don't need great, big, confusing, etc. progress bars. It's code is only 3 KB, and It provides any progress bar relative size, with any relative value, with any prefix before the Progress Bar.How to Install?pip install simpletextprogressbarOr usethe .whl provided on GitHubHow to use?Justimport simpletextprogressbarThis imports the Progress Bar into your codesimpletextprogressbar.set_progress_bar()This function sends a unfinished line to the console.simpletextprogressbar.change_position(position, size, optional_prefix, writeTheSameLineWhenFinished)This function sets a new progress bar in the relative position from the relative size, and also prints a text before the progress bar, If specified.ExamplesImagine a example file:import time  
import simpletextprogressbar  
simpletextprogressbar.set_progress_bar()
for x in range(10):  
        simpletextprogressbar.change_position(x+1, 10, "Filling 10% in 500 ms")  
        time.sleep(0.5)It Will return this:What changed?1.1.2Added argument "writeTheSameLineWhenFinished", as a solution for writing after the line when the progressbar is at the same position as the size.Bug fixings1.1.1Bug fixing (not released, as I had the idea for 1.1.2)1.1.0Initial releaseBug Fixing or SuggestionsIf you find any bugs or want anything to be on the code, you are encouraged to use GitHub to tell me :)Enjoy! ðŸ˜‰
Package: simpleth
Simpleth(Simplified Ethereum) simplifies
the use of Python to interact with a Ganache Ethereum blockchain and its Solidity
smart contracts.Simplethis a set of five Python facade classes that use theweb3.pyAPI
to interact with the smart contracts through a Ganache Ethereum client.Simplethonly supports a portion of theweb3.pyfunctionality - the
portion that a Python developer uses to interact with contracts.The aim is to provide Python developers a quick and easy way to:deploycontracts onto the blockchainrun transactionsin those contractscall functionsin those contractsget valuesfor public state variables in those contractsuse filtersto find events emitted by those contractsget dataabout the blockchain, contracts, transactions, and eventsThe intended audience:Python developerswho want to:learn to code smart contracts in Solidityplay around with Ethereum and smart contracts using the Python interpreter
and scriptsbuild proof-of-concept dapps with Python scripts orflaskbuild production dapps using Python in a single-user test environmentsee a working example of theweb3.pyAPI by looking atsimplethinternalsSolidity developerslooking for examples of:basic functions in a smart contract, esp. if just starting outmore advanced functions in a smart contract, esp. for use in
medium-complexity dapps.Full documentationatRead the Docs:https://simpleth.readthedocs.io/en/latest/
Package: simple-threadpool
simple_threadpoolA simple threadpool, supports large iterable job queue(add on demand, compared toconcurrent.futures.ThreadPoolExecutorandmultiprocessing.pool.ThreadPool).Installpipinstallsimple_threadpoolUsagefrom__future__importprint_functionimportrandom,timefromthreadingimportcurrent_threadfromsimple_threadpoolimportThreadPooldefmy_worker(arg):'''custom worker'''print('%s: '%current_thread().name,arg+1)time.sleep(random.random())deflarge_iterable(size):foriinrange(size):print('getting%s'%i)yieldidefcallback(result):print(result)# create a ThreadPool instance with 2 threadstp=ThreadPool(my_worker,max_workers=2)print('max_workers:%d'%tp.max_workers)print('chunksize:%d'%tp.queue.maxsize)# produce and send some data to the poolprint('First round:')tp.feed([1,2,3,4,5])print('Second round:')tp.feed([6,7,8,9,0])print('Large jobs:')tp.feed(large_iterable(15))# close the queuetp.close()print('Using callback (callback function will be threadsafe)')tp=ThreadPool(my_worker,result_callback=callback)tp.feed([1,2,3])tp.close()
Package: simpletime
# simpletime##### A module for converting dates and times.*****Supported objects include :**1. datetime.datetime2. datetime.date3. datetime.time4. timestamp(float/int)5. time.time.struct_time6. string(%Y-%m-%d %H:%M:%S)***+ if date argument is lost, use the current date instead+ if time argument is lost, use 00:00:00 instead+ if date and time are lost, use now instead*****Function list:**1. toDatetime()2. toDate()3. toTime()     #always return int object4. toStamp()5. toTuple()6. toString()**If do not provide a object to conver, the function return current time*****```>>> import simpletime as st>>> st.toDatetime()datetime.datetime(2019, 1, 15, 22, 29, 8, 185436)>>> st.toString()'2019-01-15 22:29:13'>>> st.toStamp()1547562563>>> st.toDatetime('2019-01-01 01:02:03')datetime.datetime(2019, 1, 1, 1, 2, 3)>>> st.toStamp('2019-01-01 01:02:03')1546275723```
Package: simple-timebox
TimeboxDescriptionTimebox is a simple yet effective tool for staying efficient during a workday.Timeboxing is a time management technique that is believed to boost productivity by limiting the time during which a task is supposed to be completed. A time box is a fixed period of time alloted for a task or activity. The period of time to spend on the task is decided first (default 45 minutes). The duration of a time box may depend on the task or activity. Alternatively, the task may be scoped in a manner that it can be completed in a fixed size time box. Then a timer is started with the decided time interval. Once the timer notifies that the time interval has expired, any activity or work on the task is stopped, and a short break is taken before beginning another time box.Timebox is inspired bysusam/timeboxGetting StartedInstall timebox by running the following commandpip install simple-timeboxStart a timbeox session with the default config by runningtimeboxGet a full list of all available parameters by runningtimebox --help
---

Usage: timebox [OPTIONS]

Options:
  -t, --time INTEGER              Duration of the time box in minutes
                                  [default: 45]
  -b, --beeps INTEGER             Numbers of beeps to notify that the session
                                  is finished  [default: 3]
  -be, --before_end INTEGER       Notify with an alert X minutes before the
                                  session ends.  [default: 15]
  -bis, --beeps_in_session INTEGER
                                  Number of beeps to notify you that there is
                                  X minutes left of session  [default: 1]
  --alert-midway / --no-alert-midway
  --help                          Show this message and exit.Set a custom time box session lengthtimebox --time 30LicenseThis is free and open source software. You can use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of it,
under the terms of the MIT License. SeeLICENSE.mdfor details.This software is provided "AS IS", WITHOUT WARRANTY OF ANY KIND,
express or implied. SeeLICENSE.mdfor details.SupportTo report bugs, suggest improvements, or ask questions, please create a
new issue athttp://github.com/stigoleg/Timebox/issues.
Package: simple_timer
A timer module. Makes it easy to track elapsed time.InstallationLatest stable version on PyPI:$ pip install simple_timerLatest stable version on bitbucket:$ pip install -e hg+http://bitbucket.org/barseghyanartur/timer@stable#egg=simple_timerUsage exampleRequired imports.>>> from simple_timer import TimerInitialise timer.>>> timer = Timer()Print elapsed duration.>>> print timer.duration
0.16Print elapsed timedelta.>>> print timer.timedelta
datetime.timedelta(0, 0, 7)Stop the timer. Stopping the timer makes thedurationandtimedeltaproperties to freeze.>>> timer.stop()Print frozen timedelta value.>>> print timer.timedelta
datetime.timedelta(0, 2, 943660)Print frozen duration value.>>> print timer.duration
2.94366Once stoped, when calling thestopmethod again unfreezes the timer, calculates the new values and
freezes the timer again.Shortcut for stopping and returning the duration value.>>> timer.stop_and_return_duration()
143.230978Shortcut for stopping and returning the timedelta value.>>> timer.stop_and_return_timedelta()
datetime.timedelta(0, 170, 351115)LicenseGPL 2.0/LGPL 2.1AuthorArtur Barseghyan <artur.barseghyan@gmail.com>
Package: simpletimer-kafka
SimpleTimerA repo containing an object that be wrapped to record time taken for operations withinTo UseInstall requirements usingpip install -r requirements.txtImport from the timer.py file the Stopwatch object and initialise it, setting it toFalseif you do not wish to see a log of the time takenSimply use a 'with' statement with the object and add all operation inside of the statementStopwatch ExampleCodefrom timer import Stopwatch
import time

timer = Stopwatch(True)

with timer:
    for x in range(10):
        time.sleep(1)
        print(x)Output0
1
2
3
4
5
6
7
8
9
[02/12/2022 04:03:30 PM] [INFO] Time taken to complete operations: 10.0755204sStopwatchKafka ExampleCodefrom timer.timer import StopwatchKafka

import time

timer = StopwatchKafka(kafka_topic="numtest")


for x in range(5):
    with timer:
        time.sleep(2)Output (from Kafka Consumer Side){'time_taken': 2.0093802999999997}
{'time_taken': 2.0095709000000004}
{'time_taken': 2.0142518000000003}
{'time_taken': 2.0143922000000005}
{'time_taken': 2.0023295999999995}
Package: simpletiming
Simple TimingInstallationpipinstallsimpletimingUsageAs decoratorfromsimpletimingimportTimerfromtimeimportsleep@Timer(name="Potato")defpotato():sleep(1)potato()# Elapsed time: 1.0011 secondsAs objecttimer=Timer()timer.start()sleep(1)timer.stop()# Elapsed time 1.0011 secondsAs context managerwithTimer(message="Elapsed time:{minutes:0.4f}minutes"):sleep(1)# Elapsed time: 0.0167 minutesOn all class methods@Timer(name="MyClass",message="{name}:{seconds:0.4f}seconds")classMyClass:defpotato(self):sleep(1)obj=MyClass()obj.potato()# MyClass: 1.0011 secondsLicenseThis project is licensed under the terms of the MIT license.
Package: simpletkinter
simpletkinterA simple approach to create and display tkinter widgetsInstallationpipinstallsimpletkinterVersion HistoryVersion 0.0.6 5 Dec 2023Add ComboboxExpose tkwidgetsVersion 0.0.4 3 Dec 2023Clean import tkframes (again)Version 0.0.3 3 Dec 20231.Clean import tkframesVersion 0.0.2 3 Dec 2023Clean tkframesVersion 0.0.1 3 Dec 2023Initial version
Package: simple-token-bucket
Simple Token BucketAsimpletoken bucket implementation.Project philosophysimple-token-bucketis meant to be a light and very simple to use
token bucket library.Simple is better than
complex.Installationsimple-token-bucketis available on PyPI:python -m pip install simple-token-bucket[redis]This project requires Python 3.8 or newer to run.Usage examplefromsimple_token_bucketimportSimpleTokenBucketfromsimple_token_bucket.backends.redisimportRedisBackend# Create a new bucketthird_party_api_rate_limit_bucket=SimpleTokenBucket(name="third_party_api",bucket_size=3,interval=10,backend=RedisBackend.from_url("redis://localhost:6379/0"))third_party_api_rate_limit_bucket.try_get_token()third_party_api_rate_limit_bucket.try_get_token()third_party_api_rate_limit_bucket.try_get_token()# will raises a NotEnoughTokens exception.third_party_api_rate_limit_bucket.try_get_token()# after 10 seconds everything works again.importtimetime.sleep(10)third_party_api_rate_limit_bucket.try_get_token()The latest documentation can be found herehttps://simple-token-bucket.readthedocs.io/en/latest/ContributingContributions are welcome. See Contributing section in docs.
Package: simple-toml-settings
Simple TOML SettingsA Python library to save your settings in a TOML file.Development softwareInstallationUsageSetupUsing the settingsDevelopment setupLicenseCreditsDevelopment softwareNote that this library is still in development and may contain bugs and/or
change in the future.  Please report any bugs you find on theissue
trackerand feel free
to make suggestions for improvements.InstallationYou should install this package into a virtual environment.  You can usePoetryto do this:$poetryaddsimple-toml-settingsIf you don't want to use Poetry, you can use pip from inside your virtual
environment:$pipinstallsimple-toml-settingsUsageThis is a library to save your settings in a TOML file.  It is designed to be
simple to use and to be able to save and load settings from a TOML file with a
minimal of configuration.The below is a minimal example, for full documentation and information on
available options, see thedocumentation
site.Usage is simple:Setupfromsimple_toml_settingsimportTOMLSettingsclassMySettings(TOMLSettings):"""My settings class."""# Define the settings you want to savename:str="My Name"age:int=42favourite_colour:str="blue"favourite_number:int=42favourite_foods:list=["pizza","chocolate","ice cream"]settings=MySettings("test_app")The above will automatically create a TOML file in the user'shomedirectory
calledconfig.toml, in the subdirectory.test_app/, and save the settings to
it. If the file already exists, the settings will be loaded from it.The file contents for the above example would be:[test_app]age=42favourite_colour="blue"favourite_number=42name="My Name"schema_version="none"favourite_foods=["pizza","chocolate","ice cream"]Using the settingsOnce you have created your settings class, you can use it like any other class:settings=MySettings("test_app")settings.favourite_colour="red"settings.save()Note that the current library access methods are not set in stone and may
change in the future.We will try to keep the changes to a minimum and will
provide a migration path (and backwards compatibility) if we do change them.Development setupSee theContributing Guidelinesfor details of how to
contribute to this project and set it up for development.LicenseThis project is released under the terms of the MIT license.CreditsThe original Python boilerplate for this package was created usingPymakerbyGrant
Ramsay (seapagan)(Me!! 😄).
Package: simple-toolbelt
python-simple-toolbeltA growing collection of simple utilities functions for PythonInstallationpipinstallsimple-toolbeltFunctionspath.ensure_dirpath.ensure_dirCreate the directories, include subs, if don't exist.fromsimple_toolbath.pathimportensure_dirwithopen(ensure_dir('this/path/to/file.txt'),'w')asf:...Check on GitHub:https://github.com/mbiemann/python-simple-toolbelt
Package: simpletoolkit
A sample project that exists as an aid to thePython Packaging User Guide’sTutorial on Packaging and Distributing
Projects.This projects does not aim to cover best practices for Python project
development as a whole. For example, it does not provide guidance or tool
recommendations for version control, documentation, or testing.This is the README file for the project.The file should use UTF-8 encoding and be written using ReStructured Text. It
will be used to generate the project webpage on PyPI and will be displayed as
the project homepage on common code-hosting services, and should be written for
that purpose.Typical contents for this file would include an overview of the project, basic
usage examples, etc. Generally, including the project changelog in here is not
a good idea, although a simple “What’s New” section for the most recent version
may be appropriate.
Package: simple-tools-jacobitosuperstar
# simple_toolsSimplifield tools to ease the use of the more advanced tools of Python.The point of the library is to ease the use of tools that aren’t in most of the
beginner proyects, that are making their way into entry level jobs.At the moment, the things that I have my eye on are logging and threads. Yeah I
know, you should never use threads, just use async, but sometimes changing sync
code to async is a pain, so my goal is to help with that.
Package: simpleTorch
simpleTorchThis repo aims to train neural networks with pytorch simple. The data are normalized insede the class. The validation is performed automatically. The output model gets the unscaled data and returns the output unscaled (The scaling is performed inside). This way the user do not interact the scaling,; however the user can select to not use the default scaling and scale the data before the trainingInstallationUse the package managerpipto install foobar.pipinstallsimpleTorchUsageA more detailed example in example_of_usage.ipynb# X array with inputs in np# F labels in np# model is the neural net written in pytorchimportsimpleTorch.train_anntrain_ann(model,X,F,plot=True)ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT
Package: simple-torn-wrapper
Simple Torn WrapperA simple basis wrapper for the torn API. Handles sending and converting the response into a Python dictionary.ExampleAn example of the usage:fromsimple_torn_wrapperimportTornWrapperwrapper=TornWrapper(api_key='API_KEY')# Find your API key in Tornselections=['selection1','selection2']# Examples of selections are listed in the Torn API.section='user'# Other sections can be found in Torn APIdata=wrapper.request(section,id,selections)Request also accepts parameterstsfromandtstofor a timestamp search range.These can be chosen from the API as referenced on:https://www.torn.com/api.html#.
Section is one of the 6 main categories and selections should be a list of strings.Issues and ContactDiscord @https://discord.gg/myTajWNU6qissue @https://github.com/SolitudalDeveloper/SimpleTorn/issuesemail @innominatusofficial@gmail.comDevelopmentTo develop onto this repository, feel free to fork/clone.
Pipfile has all requirements.
Testing is done using Pytest.Will add guide on development setup later.
Package: simple-totp
simple-totpA simple TOTP CLITired of fumbling around with Google Authenticator just to generate a simpleTOTPtoken? Well,simple-totpis the simplest TOTP CLI you will ever need. Just set it up once,
and you are ready to go.simple-totpoffers nothing fancy beyond printing out
TOTP tokens on the terminal.DemonstrationInstallationIt should be quite easy to installsimple-totp, provided you have python >= 3.pip install simple-totpUsageRunningsimple-totpcannot be simpler.otpConfigurationsimple-totpreads from the configuration file in~/.otp.ymlto
generate TOTP tokens. All secrets are stored there as plain text, so
just be mindful about it.Here is the minimal configuration needed to verify thatsimple-totpis working properly:totp:-secret:7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQXTo generate multiple TOTP tokens with proper namespacing:totp:-issuer:googlename:test@example.comsecret:7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQX-issuer:facebookname:test@example.comsecret:HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZBy default,otpgenerates 6-digit TOTP tokens where the refresh
interval is every 30 seconds. If you need to override this
behavior, you may try the following:totp:-issuer:googlename:test@example.comsecret:7TO66UM5PZ2M5CB2GWZMYZX5YAVWATQXdigits:10interval:60DevelopmentBefore developing, make surejustis
installed. This project usesjustas the command runner instead of the
usualmake.Start avirtualenvif needed. It is
highly recommended for development.Install the dependencies for the project:just setupAfter that, installsimple-totpin editable mode:just installNow, you can start developing. You can run the CLI directly:otpDistribution can be done with:just publish