Saravanan666/pypi-org huggingface dataset:
Package: totalsize
totalsizeScript that uses yt-dlp to calculate total size of all videos in a playlist (also works with single videos).Installationpip3 install totalsizeTotalsize requires python 3.6+.Usageusage: totalsize [-h] [-f FORMAT_FILTER] [-m] [-n] [-r NUM] [-c FILE]
                 [--media] [--size] [--duration] [--views] [--likes] [--dislikes] [--percentage]
                 [--cookies FILE] URLSeehttps://github.com/yt-dlp/yt-dlp#format-selectionfor details on formats.Specify the-moption for additional info on each video.Specify the-noption to suppress output of progress info.When specifying any of the raw data options, data will always be printed in this order:media,size,duration,views,likes,dislikes,percentage
Package: totaltimeout
Get timeouts right, without the hassle.So you’re writing a function that takes a timeoutdeffoo(timeout):...and inside it you do something likebar(timeout)qux(timeout)Wrong!The right way is to subtract the time spent in the first
function, and pass just the remaining time as the timeout to the
second function.Or maybe you want to put a retry loop around a function that takes
a timeout:while...:foo(timeout)The right way is to set a timeout for the whole loop, subtract the
time each iteration took, pass the remaining time to the function,
and break out once we’re out of time.totaltimeoutlets you code timeouts the right way, without
writing all that boilerplate to calculate the remaining time.VersioningThis library’s version numbers follow theSemVer 2.0.0
specification.Installationpip install totaltimeoutUsageImport theTimeoutclass.fromtotaltimeoutimportTimeoutWaiting in a “timed loop” for an API with retries (useful
for unreliable APIs that may either hang or need retries):fortime_leftinTimeout(SOME_NUMBER_OF_SECONDS):reply=requests.get(api_url,timeout=time_left)ifreply.status==200:breakSame as above, but with a wait between retries:timeout=Timeout(SOME_NUMBER_OF_SECONDS)fortime_leftintimeout:reply=requests.get(api_url,timeout=time_left)ifreply.status==200:break# If you need to get the remaining time again in the same# loop iteration, you have to use the .time_left() method:iftimeout.time_left()<=RETRY_DELAY:breaktime.sleep(RETRY_DELAY)Waiting for multiple tasks to finish:timeout=Timeout(10.0)thread_foo.join(timeout.time_left())thread_bar.join(timeout.time_left())thread_qux.join(timeout.time_left())# Works out almost as if we waited 10# seconds for each thread in parallel.Waiting for multiple tasks within each iteration of a “timed loop”:timeout=Timeout(SOME_NUMBER_OF_SECONDS)fortime_leftintimeout:some_work(timeout=time_left)some_more_work(timeout=timeout.time_left())some_other_work(timeout=timeout.time_left())Using a monotonic clock instead of the wall clock:importtimetimeout=Timeout(10.0,clock=time.monotonic)You can also set the starting time of the timeout. This lets timeouts
count down from a well-known point in time, which can be useful for
testing, for synchronizing timeouts across networks, and so on:start_of_this_minute=(time.now()//60)*60timeout=Timeout(10.0,start=start_of_this_minute)moment_in_time=time.now()timeout=Timeout(10.0,start=moment_in_time)time.sleep(1)identical_timeout=Timeout(10.0,start=moment_in_time)# both timeouts have exactly the same amount of time leftFinally,totaltimeoutcan be an ergonomic way to put a time
limit on a loop even if the code in the loop does not support
timeouts, so long as each iteration does not block for too long:counter=0for_inTimeout(30):counter+=1
Package: totango
Totango (http://www.totango.com) Python LibraryFree software: Apache License, Version 2.0Installationpip install totangoUsageimport totango

tt = totango.Totango('SP-XXXX-XX', 'user_id')
tt.track('module','action')Changelog0.3.2 (2017-06-1)Updates to the setup script so that requests doesn’t need to be installed
manually0.3.1 (2017-06-1)Licensing and ownership change0.3.0 (2014-05-02)Set the user agent correctly when sending data to totango0.2 (2014-04-30)Fixed some typos in payload keys0.1 (2014-04-30)Initial Release
Package: tothemoon
tothemoon evx ML modelThis is a simplified version ofevxpredictorpackage used to generate buy and sell signals for crypto and conventional stock markets based on the excess volume indicator(EVX). EVX is a concept where the bid-ask spread is estimated inherently from current market prices.You can read more about Evx in the free whitepaperhereInstallationInstall tothemoon withpython3 -m pip install tothemoonUsageIn your python script simply import the module and use as follows:from tothemoon.moon import signal
print(signal(20,65,utcdatetime))The above methods take an assets open, close prices of the asset based on the time interval you have chosen in OHCLV type. A zero classification output would instruct the user to sell, while one output means don't sell or buy if the asset is not already present in the orders.Testing an entire dataframeTesting of a dataframe for correct buy, sell signals is as simple as applying the function as follows:import pandas as pd
from moon import signal, Regbot

df = pd.read_csv('path/toyour/file.csv')

def getSignal(open,close,utcdatetime):
    return signal(open,close,utcdatetime)

# select long profitable trades
df2 = df[df['close_profit_abs'] > 0]
df2 = df2[df2['is_short'] == 0]
print(df2.head())

# Run all predictions
df2['enter_long_pred'] = df.apply(lambda row: getSignal(row['open'], row['close'], row['date']), axis=1)

print(len(df2[df2['enter_long_pred'] == df2['is_short']]), len(df) )

print(df2[df2['is_short']==0].head(15))Your original data must already have some presumed 'buy' signal.WarningThis is not financial advise. tothemoon is entirely on its preliminary stages. Use it at your own risk.
Package: to-tmx
Пакет с несколькими скриптами для конвертации txt-файлов в tmx-файлыЭти скрипты позволяют токенизировать текстовые файлы на предложения, а затем
конвертировать получившиеся файлы в формат tmx (translation memory exchange,
по сути -- xml-файлы), в том числе в формат, понимаемый программой SDL Trados Studio 2017.Установка в Windows в терминале Anaconda Prompt$ python -m venv .venv
$ .venv\Scripts\activate.bat  # в терминале Git Bash: source .venv/Scripts/activate
$ python -m pip install --upgrade pip
$ pip install to-tmx
$ python -m nltk.downloader punkt  # для токенизации на русском языкеВнешние зависимостиПакет устанавливает NLTK. Кроме того, последняя строчка в разделе про установку
скачивает модели для токенизации на предложения из NLTK Corpora. Эта команда может
выдывать предупреждение при исполнении, но все равно работает.ИспользованиеПримеры исходных, промежуточных и финальных файлов лежат в репозитории проекта
на Гитхабе в папкеdata/.Токенизация файлов на предложения$ sent-tok "path\file name.txt" language  # английский по умолчаниюНапример:$ sent-tok "data\Madrid System_eng.txt" english
$ sent-tok "data\Madrid System_rus.txt" russianНа выходе получаем два токенизированных на предложения файла,Madrid System_eng.txt_sent_tokиMadrid System_rus.txt_sent_tok.Их следует открыть в текстовом редакторе (Notepad++) и проверить, что все токенизировалось
правильно. Обычно ошибок хватает. Нужно, чтобы количество строк в обоих файлов стало одинаковым.Конвертация в tmx$ to-tmx "path\file name_eng.txt_sent_tok" "path\file name_rus.txt_sent_tok"Например:$ to-tmx "data\Madrid System_eng.txt_sent_tok" "data\Madrid System_rus.txt_sent_tok"Скрипт создаст файл"data\Madrid System_eng-Madrid System_rus.tmx".Конвертация в tmx, понимаемый программой SDL Trados Studio 2017$ tmx-tradosize "path\file name_eng-file name_rus.tmx "path\file_name_trados_style.tmx"Первый аргумент -- исходный tmx-файл (полученный на предыдущем этапе), второй аргумент -- путь и желаемое название выходящего файла. Например:$ tmx-tradosize "data\Madrid System_eng-Madrid System_rus.tmx" "data\madrid_system_trados_style.tmx"Конвертация многих файлов в tmx-файлы, понимаемые программой SDL Trados Studio 2017Командаtmx-batch-tradosizeпопросит выбрать папку с несколькими tmx-файлами,
а результат сохранит в папкуtmx-trados-style\
Package: toto2titi
paste2file💾 Save clipboard content as a file.paste2qrcode🔳 Display clipboard content as a QR codewifi2qrcode🌐 Display wifi credentials as a QR code. Scanning this code with your smartphone will automatically connect it to this network.paste2sms📲 Send clipboard content as a SMSpaste2smsis a small tool which send the content of your clipboard as a SMS: do you want to share that cool link you just found (on your computer) to your friend? Copy it, and runpaste2smsto send it as a SMS.What’s new?Seechangelog.Download and installFrom sources:Download:https://pypi.python.org/pypi/toto2titiInstall:python3 -m pip install .From pip:pip install toto2titiDo-it-yourself Debian packageThis requiresstdeb(andsetuptools-scm) to be installed:python3 setup.py --command-packages=stdeb.command bdist_deb
sudo dpkg -i deb_dist/toto2titi-<VERSION>_all.debThis will also install the launchers.DocumentationThe compiled documentation is available onreadthedocsTo compile it from source, download and run:cd doc && make html
Package: toto9
Toto9 - The Missing GCP Python ClientThe Google Python Client Library is missing stuff! This package fills in the gaps.InstallationDevelopment EnvironmentRunpip install -e .from the root level of this repository. This symlinks the package so that source files are available as soon as they are updated.Developmentexport GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_YOUR_CREDENTIALS_FILEexport GOOGLE_PROJECT_ID=YOUR_PROJECT_ID(for tests)virtualenv -p python3 venvsource venv/bin/activatepip install -r requirements.txtpip install -e .All Other Environmentspip install toto9UsageAuthenticationSet theGOOGLE_APPLICATION_CREDENTIALSenvironment variable to the path of your credentials. Alternatively, pass in the path to your credentials and list of scopes to the service classes withcredentials_pathandscopeskwargs.ContributingCreate an issue in gitlabWrite the codeWrite tests, make sure they are meaningful and passSubmit MR against issueMergeReferenceshttps://developers.google.com/api-client-library/python/https://google-cloud-python.readthedocs.io/en/latest/index.htmlTestYou should test your modules! Tests are in thetestsdirectory. Name your filetest_*.pyso the unittest module will pick it up.DocumentationUpdate documentation indocs/sourceand then runmake htmlfrom thedocsdirectory.Setup and Runexport GOOGLE_PROJECT_ID=YOUR_PROJECT_ID export GOOGLE_APPLICATION_CREDENTIALS=PATH_TO_YOUR_CREDENTIALS_FILERun all tests withpython -m unittest.
Package: totokenizers
totokenizersA model-agnostic library to encode text into tokens and couting them using different tokenizers.installpip install totokenizersusagefromtotokenizers.factoriesimportTotoModelInfo,Totokenizermdoel="openai/gpt-3.5-turbo-0613"desired_max_tokens=250tokenizer=Totokenizer.from_model(model)model_info=TotoModelInfo.from_model(model)thread_length=tokenizer.count_chatml_tokens(thread,functions)ifthread_length+desired_max_tokens>model_info.max_tokens:raiseYourException(thread_length,desired_max_tokens,model_info.max_tokens)
Package: totolo
totoloThis repository contains a Python package, totolo, for working with data from the Theme Ontologytheming repository.InstallationInstall from PyPi:pip install totoloOr clone this repository and copy thetotolodirectory wherever you need it. No dependencies are required.Basic Usage#: import package>>>importtotolo#: get the latest main branch version of the ontology>>>ontology=totolo.remote()>>>print(ontology)<2945themes,4475stories>#: write it or read it locally>>>ontology.write("/home/mo/themes")>>>ontology=totolo.files("/home/mo/themes")>>>print(ontology)<2945themes,4475stories>Explore the themes:#: go over all the themes and find the ones you want>>>forthemeinontology.themes():...if"romantic love"intheme.name:...print(theme)b'personal freedom vs. romantic love'[3]b'romantic love'[3]#: check the definition of a theme>>>love=ontology.theme["love"]>>>love.print()(...)Explore the stories:>>>forweight,themeinstory.iter_themes():...print(f"{weight:<15}{theme.name}")Choice Themes   betrayal
Choice Themes   the lust for power
(...)Convert it to a pandas dataframe:>>>df=ontology.dataframe()>>>dfstory_id             title        date                      theme        weight
0                 theamericanshortstory01  The Music School        1974      human self-reflection  Major Themes
1                 theamericanshortstory01  The Music School        1974                     murder  Major Themes
...                                   ...               ...         ...                        ...           ...
52453  videogame: Final Fantasy VI (1994)  Final Fantasy VI  1994-04-02  feral children in society  Minor Themes
52454  videogame: Final Fantasy VI (1994)  Final Fantasy VI  1994-04-02             father and son  Minor Themes

[52455 rows x 5 columns]SnippetsCreate an excel sheet with all the usages of the theme "loyalty" as well as any child theme of the same:df=ontology.theme['loyalty'].descendants().dataframe(motivation=True,descriptions=True)df.to_excel("/mnt/d/repos/themelist-loyalty.xlsx","loyalty")Find theme entries in stories according to some criteria. For example, find empty motivations:empty_motivations=[(story,weight,part)forstoryinontology.stories()forweight,partinstory.iter_theme_entries()ifpart.motivation.strip()==""]Getting HelpIf you encounter a bug, please file a minimal reproducible example onGitHub issues. For
feature requests and other matters, please post on theGitHub discussions
board.Code Test CoverageLicenseAll code in this repository is published with theMITlicense.
Package: toto-logger-nicolasances
Toto LoggerThis library standardizes the way that toto microservices will log information.Logs in toto have the following structure:> [correlationID] - [logType] - [logLevel] - MessageWhere:correlationIDshould be always present for apis and reactive microservices and is the identifier that can be used to track the flow of data through sync and async callslogTypeis the type of log. The following log types are accepted:api-in-reserved- to be used only when receiving an API call. This log typemustbe usedonly onceand onlyat the moment the API call is received: it shouldn't be used for subsequent log entries. It is only used torecord the fact that an API call has been received!api-out-reserved- to be used only when making an outbound API call.event-in-reserved- to be used only when receiving an Event. Same logic applies as for theapi-*log type.event-out-reserved- to be used only when publishing an Event. Same logic applies as for theapi-*log type.compute- can be used for any log happening during the computation that results from the receiving an event or an api call.logLevelis the level of the log. Should only be:debug- only used for debugging purposesinfo- used for standard info loggingwarn- used to log warningserror- used to log errorsHow to use itInstantiate it:from TotoLogger import TotoLogger

logger = TotoLogger()Log, based on the type of loglogger.api_in(correlation_id, method, path);
logger.api_out(correlation_id, microservice, method, path);
logger.event_in(correlation_id, topic);
logger.event_out(correlation_id, topic);
logger.compute(correlation_id, message, log_level);
Package: totoml
TotoML Python SDKThis library is an SDK for Toto MLThis library provides the following key components:Model Controller: the Model Controller is a wrapper for your models. It provides:REST APIs to trigger the training, scoring and predictionsEvent-based access to the same (training, scoring, predicting)How to use itIn your main python file (e.g. app.py), import theModelControllerandControllerConfigclasses, create a Flask app, instantiate your model (in this exampleERCBOD()) and pass it to the ModelController constructor.from totoml.controller import ModelController
from totoml.config import ControllerConfig

app = Flask(__name__)

model_controller = ModelController(ERCBOD(), app, ControllerConfig(enable_batch_predictions_events=False, enable_single_prediction_events=False))In order for the Model Controller to work, you have to provide to it your model (in the exampleERBOCD()): that's called here a Model Delegate.ModelDelegateis anabstract classprovided by this SDK (delegate.ModelDelegate). Your model has to implement its methods.Those methods are:get_name()This method has to return the name of the model. This is very important because the name of the model is used for everything in TotoML (internal folders, registry, file storage, etc..), so the namehas to be unique.get_model_type()Not very used for now. Should return the type of model: sklearn, tf, etc..Has to be an instance of ModelTypepredict()andpredict_batch()These methods perform predictions.score()This method scores the current champion model: it has to recalculate the metrics for the model and return themtrain()This method performs the training of the model and returns the trained model and all the associated files.It's important to note that also any file containing training data or built features should be returned, so that Toto ML can grant the persistence of those files and make sure there is lineage.
Package: totoro
Celery integration with Tornado.InstallationYou can install Totoro either via the Python Package Index (PyPI) or from source.To install using pip, simply:$sudopipinstalltotoroor alternatively (you really should be using pip though):$sudoeasy_installtotoroor from source:$sudopythonsetup.pyinstallTotoro can only support AMQP(RabbitMQ) by default. To use the Redis, you can specify the requirements on the pip comand-line by using brackets.$sudopipinstalltotoro[redis]Hello, worldHere is a simple “Hello, world!” example for calling celery tasks from Tornado RequestHandler:#!/usr/bin/env pythonimporttornado.httpserverimporttornado.ioloopimporttornado.webfromtornadoimportgenimporttotorofromtotoro.test.celery_tasksimporttasksclassMainHandler(tornado.web.RequestHandler):@gen.coroutinedefget(self):response=yieldgen.Task(tasks.echo.apply_async,args=['Hello world!'])self.write(response.result)defmain():totoro.setup_producer()application=tornado.web.Application([(r"/",MainHandler),])http_server=tornado.httpserver.HTTPServer(application)http_server.listen(8888)tornado.ioloop.IOLoop.instance().start()if__name__=="__main__":main()To run celery worker for the example:$python-mtotoro.test.runtasksworker-lINFOConfiguration and defaultsTOTORO_AMQP_CONNECTION_POOLNew in version 0.1.2The setting must a dict that used to configure the AMQP(RabbitMQ) connection pool. It supporting the following keys:max_idle_connections - Max number of keeping connections. Defaults to 3.max_open_connections - Max number of opened connections, 0 means no limit. Defaults to 10.max_recycle_sec - How long connections are recycled. Defaults to 3600.Example configuration:celery=Celery("totoro_celery_tasks")celery.conf.update(BROKER_URL='amqp://guest:guest@localhost:5672//',CELERY_TASK_SERIALIZER='json',CELERY_ACCEPT_CONTENT=['json'],# Ignore other contentCELERY_RESULT_SERIALIZER='json',CELERY_TIMEZONE='Asia/Shanghai',CELERY_ENABLE_UTC=True,TOTORO_AMQP_CONNECTION_POOL={'max_idle_connections':1,'max_open_connections':10,'max_recycle_sec':3600},)TestsTo run the tests for the AMQP(broker/backend):$python-mtotoro.test.runtasksworker-lINFO$python-mtotoro.test.runtestsTo run the tests for the AMQP broker with the Redis backend:$CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0python-mtotoro.test.runtasksworker-lINFO$CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0python-mtotoro.test.runtestsTo run the tests for the Redis(broker/backend):$BROKER_URL=redis://127.0.0.1:6379/0CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0python-mtotoro.test.runtasksworker-lINFO$BROKER_URL=redis://127.0.0.1:6379/0CELERY_RESULT_BACKEND=redis://127.0.0.1:6379/0python-mtotoro.test.runtests
Package: totp
totp-cli is a simple command line application to generate OTP tokens for two
factor authentication usingRFC6238.These are compatible with many popular services such as Facebook, GitHub,
Google, eve-online, battle.net, etc.totp-cli fetches your shared key (aka: code) frompass, generates the
token, outputs it to stdout and copies it to your CLIPBOARD X selection.
Default X selection can be overridden with the PASSWORD_STORE_X_SELECTION
environment variable.Shared keys should be stored in your pass storage under2fa/SERVICE/code,
for example2fa/github/code. The-aflag (or alternatively theaddsubcommand) can be used to add this less painfully.UsageUsage:totp SERVICEFor example:$ totp github
621787You don’t need to runtotpfrom the command line if you just want to paste
the code; you can run it fromdmenu, or whatever your application launcher
is.To offset the clock by a number of seconds:totp -s SECONDS SERVICEFor example:$ totp -s +60 github
735092
$ totp -s -90 github
909651To add a service:totp -a SERVICE
# OR
totp add SERVICEFor example:$ totp -a github
Token length [6]: 6
Shared key: KEYNote that if the service already exists, it will be overwritten without
warning.About pass entriesPass entries are expected to have the TOTP secret in their first line (as
provided by the third party).
The amount of digits token must have (for example, battle.net uses 8), must be
provided in a separate line, with a format like:Digits: 8For the moment, only customizing the token length is possible.Requirementspasspython >= 3.3There are also some platform-specific requirements for copying code into the
clipboard:xclipfor Xorg (Linux/BSD).InstallationInstallation is quite simple:$ pip install totpThere is also anAUR packageavailable for ArchLinux users.You can also configure shell completion for totp-cli:Bash: Downloadtotp-cli-completion.bashand source it from your bash configuration file (e.g..bash_profile)Zsh: Downloadtotp-cli-completion.zshas_totpto site-functions directory (e.g./usr/local/share/zsh/site-functions)Licensetotp-cli is distrbuted under the terms of the ISC licence. See LICENCE for
details.Copyright (c) 2014-2017 Hugo Osvaldo Barrera <hugo@barrera.io>
Package: totra
totraan unofficial TopTracker CLI helperPurposeTopTrackeris great time tracking tool, but when
it comes to making polls, reports etc. I find CLI tools much more productive then
clicking around web page.The idea went from simple question:how much hours I've worked i.e this week ?With TopTracker web page, to know such information I had to: login to web page, click on
date range, export activities to csv, open spreadsheet software and import this csv,
and then sum.
With this tool I can just:totra how_much_hours --workers="Andrzej Bargański" --from=Monday -l my@login.com -p mypassword...and in second you see result !UsageNotice:Application is still in planning stage. Commands, options etc. can change, and everyTopTracker user is invited to post thoughts, wishes and participate in development.totra activities [--format=<format>] [--projects=<projects>] [--workers=<workers>] --from=<from_date> [--to=<to_date>] [-l login] [-p password] [-o output_filename]
   totra how_much_hours [--projects=<projects>] [--workers=<workers>] --from=<from_date> [--to=<to_date>] [-l login] [-p password]
   totra -h | --help
   totra --version

 Commands:
   activities                Output activities in --format.
   how_much_hours            Shows how much work hours are registered according to given parameters.

 Options:
   --format=<format>         Output format. Can be: json, excel. [default: json]
   --projects=<projects>     Projects names as coma separated list. Ex. 'Project 1' or 'Project 1,Project 2'
   --workers=<workers>       Workers as coma seprated list. Ex. 'Worker Name' or 'Worker Name 1, Worker Name 2'
   --from=<from_date>        Date as beginning of period for data retrieval. Format is: YYYY-mm-dd , ex: 2018-05-01
   --to=<to_date>            Date as end of period for data retrieval. Format is: YYYY-mm-dd , ex: 2018-05-01. [default: now].
   -o output_filename        Output filename to write data. Default is stdout (print on your screen) [default: stdout]
   -h --help                 Show this screen.
   --version                 Show version.
   -l login                  User login name.
   -p password               User password.InstallationFirst if you missing Python 3.6 on your system, download it fromhere.
Next execute on command line :pip install totra