Saravanan666/pypi-org huggingface dataset:
Package: pylocalytics
Python Client for Localytics Raw and Audience Data ExportThis is a Python API Client to get data fromLocalytics Raw Data ExportandLocalytics Audience Data Export.It allows to export all events and sessions and user defined audience captured by Localytics. Data is written in JSON (Compressed) and available on hourly basis as log files.Installationistall it bypip$pipinstallpylocalyticsUsageStart by loading the library and also you need to importtimedeltaanddatetimeon most cases.>>>frompylocalyticsimportpyLocalytics>>>fromdatetimeimportdatetime>>>fromdatetimeimporttimedeltaSetup and AuthenticationIn order for you to download Localytics events, you need to authenticate with usingapi_keyandapi_secret.
Once you supply it, it will be used throughout the entire session. You can find you API_KEY and API_SECRET_KEY in your  Localytics Admin Panel onAdmin Setting API Key>>>loctx=pylocalytics(api_key='YOU_API_KEY',api_secret='YOUR_API_SECRET_KEY')Download DataThere is a methoddownload_datathat downloads data to local folder. Example shows how to export data for last 2 days:>>>loctx.download_data(app_ids=['YOUR_APP_ID'],start_date=datetime.today()-timedelta(2),end_date=datetime.today())You can also specify optional parameters. This is more complex example:>>>loctx.download_data(app_ids=[YOUR_APP_ID],start_date=datetime.today()-timedelta(2),end_date=datetime.today(),destination_folder='data',compressed=True)On default data are stored inlocalytics_datafolder and compressed ingzformat.
IF don't want to store the compressed version and just need Json file,  setcompressed = False.Because I'm working on a project which collect our App data from the Localytics and them import them to our Data WareHouse , I'm working on this Library and If I see some global features which is useful for others, I'll add it.
Package: pylocated
## PyLocated[![Build Status](https://travis-ci.org/sourcepirate/pylocated.svg?branch=master)](https://travis-ci.org/sourcepirate/pylocated)A Locatedb interface for python## Installing```pip install pylocated```## Usage```pythonfrom pylocated import locatedb#if you want to use default locatedb path you#can use the class methods for it.buffer = locatedb.find('sample.py', limit=20, ignore_case=False, regex=None)files = buffer.getvalue()print files#if you want to setup you own path to locatedblocate_db = locatedb(db_path='/var/lib/app.db')buffers = locate_db.find("sample.py", limit=20, ignore_case=False, regex=None)print buffers.getvalue()```## API### locatedb.find or instance.find(): [name, limit=None, ignore_case=False, regex=None]used to find the particular files in system.where pattern inside regex find the matches of path.### locatedb.count or instance.count: [name]used find the number of occurences for that particular word.equivalent to locate -c### locatedb.statistics or instance.statistics : [name]used to give the disk statisticsequivalent to locate -S### locatedb.version:return the version of locatedb you are using.## License:<b>MIT</b>&copy; 2015 plasmashadow aka sourcepirateplasmashadowx@gmail.com
Package: pylocator
A little program for localization of EEG-electrodes from MRI-recordings.
Uses VTK for a neat 3d-interface.Building the docsTo build the docs you need to have setuptools and sphinx (>=0.5) installed.
Run the command:python setup.py build_sphinxThe docs are built in the build/sphinx/html directory.Making a source tarballTo create a source tarball, eg for packaging or distributing, run the
following command:python setup.py sdistThe tarball will be created in thedistdirectory. This command will
compile the docs, and the resulting tarball can be installed with
no extra dependencies than the Python standard library. You will need
setuptool and sphinx.Making a release and uploading it to PyPIThis command is only run by project manager, to make a release, and
upload in to PyPI:python setup.py sdist bdist_egg register upload
Package: pylock
Usagefrom pylock import Lock

with Lock('a_key', expires=60, timeout=10):
    # do something that should only be done one at a timeConfigurationBackendsThere are three available backends:Open (non-locking) backendDEFAULT_BACKEND = {
    'class': 'pylock.backends.open_lock.OpenLock',
    'connection': 'open://'
}WarningThis backend is not a real lock since it can always be
acquired even if another instance has acquired it already. It is meant
to be used for testing when you don’t want to depend on a running redis
or memcache instance and don’t care about the lock working.Redis backendDEFAULT_BACKEND = {
    'class': 'pylock.backends.redis_lock.RedisLock',
    'connection': 'redis://'
}Note: all fields after the scheme are optional, and will default to
localhost on port 6379, using database 0.Memcache backend (coming soon)DEFAULT_TIMEOUT(default: 60)If another client has already obtained the lock, sleep for a maximum of
this many seconds before giving up. A value of 0 means no wait (give up
right away).The default timeout can be overridden when instantiating the lock.DEFAULT_EXPIRES(default: 10)We consider any existing lock older than this many seconds to be invalid
in order to detect crashed clients. This value must be higher than it
takes the critical section to execute.The default expires can be overridden when instantiating the lock.KEY_PREFIX(default'pylock:')This is used to prefix the key for the generated lock.ForLock('somekey'), the generated key will be'pylock:somekey'Inspired byRedis backendThe redis backend is almost an exact copy of Ben Bangert’s`retools.lock<https://github.com/bbangert/retools/blob/master/retools/lock.py>`_
which is based onChris Lamb’s
exampleMemcache backend (coming soon)The memcache backend is inspired by the following: -https://github.com/snbuback/DistributedLock-http://jbq.caraldi.com/2010/08/simple-distributed-lock-with-memcached.html-http://www.regexprn.com/2010/05/using-memcached-as-distributed-locking.htmlNotes related to the 0.4 releaseAdded a poetry lock file, but did not setup circleci builds
To build and publish a release:
poetry publish -r gemfury -u $GEMFURY_PUSH_TOKEN -p NOPASS –buildFor testing I would suggest that you build and publish patch releases till it works in your app THEN publish a minor or major version
because if you republish multiple builds at the same version it is very difficult to get your app to install the new ones.Poetry builds do not include test code the way that setup.py builds did.
Package: pylocked
pylocked provides utility classes (and functions) to lock any resource (or function) and thus make them thread and / or concurrency safe.InstallFrom pip:pipinstallpylockedFrom repository:pipinstallgit+https://github.com/Eyal-Shalev/pylockedExamplesAsyncIOpylocked.asyncio.AsyncLockedfrompylocked.asyncioimportAsyncLockedlocked_arr:Locked[list[int]]=Locked([])asyncdefdouble():asyncwithlocked_arrasarr:foriinrange(len(arr)):arr[i]+=arr[i]asyncdefreset():awaitlocked_arr.replace(list(range(10)))asyncdefduplicate():awaitlocked_arr.update(lambdaarr:arr*2)pylocked.asyncio.async_locked()fromtypingimportOptionalfrompylocked.asyncioimportlockedclassLockedSingleton:_instance:Optional[LockedSingleton]=None@locked@staticmethodasyncdefget_instance()->LockedSingleton:ifLockedSingleton._instanceisNone:LockedSingleton._instance=LockedSingleton()returnLockedSingleton._instanceThreadingpylocked.threading.RLockedYou can usepylocked.threading.Lockedif you want to usethreading.Lockinstead.frompylocked.threadingimportRLockedlocked_arr:RLocked[list[int]]=RLocked([])defdouble():withlocked_arrasarr:foriinrange(len(arr)):arr[i]+=arr[i]defreset():locked_arr.replace(list(range(10)))defduplicate():locked_arr.update(lambdaarr:arr*2)pylocked.threading.rlocked()You can usepylocked.threading.locked()if you want to usethreading.Lockinstead.fromtypingimportOptionalfrompylocked.threadingimportrlockedclassLockedSingleton:_instance:Optional[LockedSingleton]=None@rlocked@staticmethoddefget_instance()->LockedSingleton:ifLockedSingleton._instanceisNone:LockedSingleton._instance=LockedSingleton()returnLockedSingleton._instance
Package: pylocker
PYthon LOCKER or pylocker package provides a pythonic way to create
locking mechanism that can be used for general purposes as well as
for locking files upon reading or writing.
The locking system works by creating and updating a general locking
file anytime a lock is requested with a certain pass. Lock pass is
used to specify the user who sets the lock and who can have access
to whatever is locked. Any user who knows the lock pass can access
whatever is locked.
Package: pylockfile
lockfileСоздание файла блокировки, для предотвращения выполнения нескольких копий скрипта.Использованиеfrom pylockfile import * #Импорт модуля

lf = pylockfile('<PATH_TO_FILE>') #Указание пути до файла блокировки

lf.create() #Создание файла блокировки в начале скрипта

lf.delete() # Удаление файла блокировки в конце скрипта
Package: pylocksfile
pylocksfilepylocksfile is a simple python package for linux-based systems. This package takes advantage of linux's internal file-system locking mechanism and provided a simple read/write locking interface for inter-process communication.Advantagespylocksfilehas several advantages over the native python locks:Allow read/write (shared/exclusive) locking mechanising.Significantly smaller over-head foracquire/releaseoperations.Supports many different locks within a singlepylocksfiles(hence thelocksinpylocksfile).Interval-based locking mechanising. Supports multipleacquire/releaseoperations simultaneously, as long as locks indices are consecutive.Locks are shared via linux file-system, so there is no need to pass the lock object upon process creation, any process may share it at any time.Linux provides dead-lock detection, for up to 10 locks dependencies.Similar librarieshttps://github.com/benediktschmitt/py-filelocklibrary"which implements a platform independent file lock in Python".Usage and Examplesfrompylocksfileimportpylocksfile#Create a pylocksfile object. "dataLocksFile.lock" will be the locking filelocksfile=pylocksfile(locksfile_path="dataLocksFile.lock",verbose=False,l_id='process_1')#Acquiring lock 0 for reading (shared lock) with blockinglocksfile.acquire(writeLock=False,lock_n=0,blocking=True)# Do some reading (shared) operation assosiated lock 0.#Acquiring locks 1,2,3 for writing (exclusive lock) with blockinglocksfile.acquire(writeLock=True,lock_n=(1,3),blocking=True)# Do some writing (exclusive) operation assosiated locks 1,2,3.# Do some reading (shared) operation assosiated lock 0.#Using 'with' statement. Notice (2,1) means offset of 1 locks from lock 2, hence it is equivalent to 'lock_n = 2'.withlocksfile(writeLock=False,lock_n=(2,1)):#Converts lock 2 to read (shared). Do read (shared) operation on 0,2 and write (exclusive) on 1,3pass# Do some writing (exclusive) operation assosiated locks 1,3.# Do some reading (shared) operation assosiated lock 0.#Releasing lock 0.locksfile.release(lock_n=(0,1))#Releasing all locks from 3 to 1000locksfile.release(lock_n=(3,997))#Release all the lockslocksfile.release()#End of script. On destruction of pylocksfile object, all remaining locks will be freed.returnTestingtest.pyconsists of two tests.testReadWriteLocks(*args)test is a simple hard-coded script where two processes block each other at each step. It show general correctness of the locking mechanism,testRace(*args)tests not only the correctness of the locking mechanism, but also it's speed. The test consists of several process performing hand-over-hand iteration
over a cyclic list several times.n_processis the number of processes,n_tracksis the length of the list andn_racesis the number of cycles.
It show that asn_tracksandn_racesincreases,pylocksfileis up to 3 times faster than native python locks. Asn_processincreases, andn_tracksdecreases,
the speedup decreases to 1 due to context switch over-head.
Package: pylocluster
PyloClusterPyloCluster provides basic functionalities for distance-based clustering procedures in Python, including implementations of the Neighbor-joining and the UPGMA algorithm for phylogenetic reconstruction.Installation$pipinstallpyloclusterUsageThe following examples requires thepython-newickpackage.>>>frompyloclusterimport*>>>fromnewickimportloads>>>matrix=squareform([0.5,0.67,0.8,0.2,0.4,0.7,0.6,0.8,0.8,0.3])>>>nwk=linkage(matrix,taxa=['G','S','I','E','D'],method='upgma')>>>print(loads(nwk).ascii_art())┌─S┌───┤│└─I────┤│┌─E└───┤│┌─G└───┤└─D
Package: pylodata
Data Samples and Data Handling Routines for Pylogeny PackagesInstallation$ git clone https://github.com/pylogeny/data
$ pip install -e dataUsage>>> from pylodata import data_path, patterns, wordlist
>>> from lingpy import Wordlist
>>> patterns, characters = wordlist.get_multistate_patterns(Wordlist(data_path("wichmannmixezoquean.tsv")))
Package: pyLodStorage
pyLoDStoragepython List of Dict (Table) Storage libraryWhat it ispyLoDStorage allows to store table like data (List of Dicts) viaSqlite3JSONSPARQLInstallationpipinstallpylodstorageGet Sourcesgitclonehttps://github.com/WolfgangFahl/pyLoDStoragecdpyLodStorage
scripts/installTestingscripts/testUsageseetest casesDocumentationWikiAuthorsWolfgang FahlTim Holzheim
Package: py-log
Function descriptionpy-log is a simple logging tool(support file,email,dingtalk, wechat) ,mutil thread and process safeVersion descriptionSupported version: Python 3.0+Pip installationpipinstallpy-logDemo# log consolefrompy_logimportget_loggerlog=get_logger('test')log.info('123')# log write filefrompy_logimportget_loggerlogger=get_logger('test1',log_filename='test1.log')logger.info('aaaa')logger.debug('bbbb')logger.warning('cccc')logger.error('dddd')# log send dingdingfrompy_logimportget_loggerding_talk_token='xxxxxxxx'logger=get_logger('ding_talk_test',ding_talk_token=ding_talk_token,at_mobiles=('13790000000','13790000001'))logger.info('钉钉调试')# log send wechatfrompy_logimportget_loggerlogger=get_logger('weichat_test',agentid='xxx',at_users='aa|bb',corpid='yyy',corpsecret='zzz')logger.info('企业微信通知')# log send emailfrompy_logimportLogManagerfrompy_log.log_managerimportMailHandlerConfigmail_config=MailHandlerConfig()mail_config.mailhost=('smtp.sohu.com',465)mail_config.fromaddr='aaa@sohu.com'mail_config.toaddrs='bbb@qq.com'mail_config.credentials=('mail_username','mail_password')logger_mail=LogManager('log_mail_test').get_logger_and_add_handlers(mail_handler_config=mail_config,is_add_mail_handler=True)logger_mail.info('test send mail content')
Package: pylog2pdf
PyLog2PDFPDF, a visualisation of your calculation, can have essentials of your code.FeaturesThis library provides:Log of Python classes and/or functions you employed.Interface to save the log to PDF file.Installationpipinstallpylog2pdfUsageLog your classes and/or functions>>>frompylog2pdfimportLoggedClass,LoggedFunction# Define your class or function with decorator>>>@LoggedClass...classMyNewClass:...pass>>>@LoggedFunction...defmy_new_function():...pass# Or using them as normal functions>>>OtherLoggedClass=LoggedClass(OtherClass)>>>other_logged_function=LoggedFunction(other_function)I strongly recommend the use of class inheritance like the following. It's quite useful when determining which parameter is employed in calculation.@LoggedClassclassSun:distance:u.Quantityradius:u.Quantitydefsome_calculation(self,...):passdefother_calculation(self,...):passclassThisThesis(Sun):distance=1.5e8<<u.mradius=696e3<<u.kmclassOtherThesis(Sun):distance=1<<u.AUradius=695e3<<u.kmWhen you useThisThesisclass, the log will be:>>>pylog2pdf.LOG{'Sun':'ThisThesis'}Of cource you can manually add anything you want to save:>>>pylog2pdf["ThisParameter"]=100<<u.KSave the log to PDF fileWrite the log to pdf file:>>>pdf_path="path/to/figure.pdf">>>fig.savefig(pdf_path)# Create a pdf file first>>>pylog2pdf.write_log(pdf_path)Then you can read the log:>>>pdf_path="path/to/pdf/you/saved.pdf">>>pylog2pdf.read_log(pdf_path){'Sun':'ThisThesis'}This library is usingSemantic Versioning.
Package: pylogan
This is pylogan version 0.3.2This script is a Log Analyzer. It is inspired by the modlogan idea of input,
process and output isolation.It was created because of the need of a log analyzer for squid that use the
syslog lines. The only option the author find was modlogan but it is
discontinuated. The goal was to get a good code, capable of been developed and to solve the needs of the author.The author have almost no time to spend on it but belives that it worth the
effort, there are a lot of posibilities and maybe is good to write it here.Version 1.0.0 ToDo:
- Add lxml and do a lot more of getElementByID or XPath OR use XQuery with … (lxml?)
- Remove the abuse of dictionaries in favour of tuples and lists.
- The whole cosmetic job, work with the CSS to make it look pretty, format the tables for a better reading (CSS)
- Use some kind of internationalization.
- Review all the text and correct the author’s poor english ;-)Future ToDo:
- Make more reports (more processing)
- Support of detailed reports (with hyperlinks)
- Implementation of other inputs and outputs (SQL, XML, SOAP, plane text, etc.)
Package: pylogcat
PyLogcatPyLogcatis an application log system similar to Android Logcat for Python.PyLogcat currently supports the following log levels.Error: Critical messages which can cause application malfunctionWarning: Priority messages which indicate the potential problem in applicationInformation: Proirity messages which help users tracing application executionVerbose: Debug messages which help developers debugging application under developmentHow ToInstall packagepipinstallpylogcatImport modulesfrompylogcatimportLog,LevelLogmodule privodes main functions for application log.Levelenumerates supported log levels asv,i,w, andefor verbose, informatin, warning, and error messages.Setup log levelLog level is set asverbose which means all messages will be shown. Users can set log level aserror,warning,information, orverbose as required. For example, users can set log level as information by adding the following line of codeLog.level=Level.iCreate log messageVerbose log messageLog messages will be shown only if log level is set asv.Log.v(tag,message)Information log messageLog messages will be shown only if log level is set asvori.Log.i(tag,message)Warning log messageLog messages will be shown only if log level is set asv,i, orw.Log.w(tag,message)Error log messageLog messages will be shown no matter what log level is set.Log.e(tag,message)LimitationsPyLogcatcan only print log messages on console now.
Package: pylogd
pylogdpylogd is a python interface tologd.  It pushes log messages or statistics
to logd over a UDP socket.usagepylogd ships various utilities to deal withlogd, pythonlogginghandlers,
and aStatsobject which makes it trivial to record statistics.loggingTo log to logd using the python logging module, create a new handler with your
logd server’s host and port and then set it up as your default logging handler:from pylogd.handlers import PylogdHandler
handler = PylogdHandler('mylogpath.log', '127.0.0.1', 8126)
logger = logging.getLogger()
logger.setHandler(handler)Now, subsequent calls tologger.(error|warn|etc)will log to your logd
server.  If you do this on the root logger (getLogger('base')), it will
apply to all subsequently created loggers.To delete a log, usepylogd.delete_logwith the host and port of logd:from pylogd import delete_log
delete_log('mylogpath.log', host='127.0.0.1', 8126)statsTo use stats, create a stats handle:from pylogd.stats import Logd
stats = Logd('127.0.0.1', 8126)You can also supply an optional prefix which will be prepended to all of your
stats, so that multiple applications can use the same logd/graphite server
without having to repeate their per-app key for every stats call.Once you have a Logd object, you can increment & decrment counters (with an
optional sample rate):stats.increment('my.counter')
stats.change_by('my.counter', 10)
stats.decrement('my.counter', 0.05) # only update 5% of the timeYou can also set the value of a meter:stats.set('my.meter', 30)
stats.set('my.meter', 30, 0.25) # only set 25% of the timeThere’s a basic time interface as well as a convenient timer interface:stats.time('my.timer', 11.43) # time manually

# automatically start & stop a timer
stats.timer.start('my.timer')
do_some_timed_operation()
stats.timer.stop('my.timer')

# time this function with a 10% sample rate
@stats.timed('my.long_operation', 0.1)
def long_operation():
    pass

# accumulate time done doing various similar tasks
stats.timer.start_accumulator('timers.mysql')
do_some_mysql_stuff()
stats.timer.stop_accumulator('timers.mysql')
non_mysql_things()
stats.timer.start_accumulator('timers.mysql')
do_some_more_mysql_stuff()
stats.timer.stop_accumulator('timers.mysql')

# send this timing information to logd
stats.timer.flush_accumulator('timers.mysql')twisted supportFor twisted users, usepylogd.twisted(included) instead ofpylogd, and
note that log messages and stats will not go to logd until the reactor has been
started.
Package: pylogdc
PyLogDcPyLogDc is Python package, you can log actions of your code / alert to your Discord server using webhook.
You can use color that you want (using HEX code) or use some of prepared colors.Prepared colorsSuccess = #5cb85c
Info = #5bc0de
Warning = #f0ad4e
Danger = #d9534fInstallFor install, run this command in your console / powershellpipinstallpylogdcUsagefrompylogdcimportlog_thiswebhookURL="https://discord.com/api/webhooks/......."# Replace with your actual Discord webhook URLlog_this('Test Header','Test message','info',webhookURL)# Without footerlog_this('Test Header','Test message','info',webhookURL,"Test Footer")# With footerRemember to replace webhookURL with your actual Discord webhook URL.
Package: pylogenetics
pylogeneticsA python package containing classes and functions for phylogenetic analyses.IncludesA tree classA matrix classFunctions for reading tree files in newick formatA function for creating a MRP (supertree) matrix of a set of treesInstallingA step by step series of examples that tell you how to get a development env runningSay what the step will beGive the exampleAnd repeatuntil finishedEnd with an example of getting some data out of the system or using it for a little demoUsage examplesRunning the testsExplain how to run the automated tests for this systemAuthorsBillie Thompson-Initial work-PurpleBoothSee also the list ofcontributorswho participated in this project.LicenseThis project is licensed under the MIT License - see theLICENSE.txtfile for details
Package: pyloger
pyloger written in Python, for human beings.This module is based on python’s syslog,it provides an interface to the Unix syslog library routines. Refer to the Unix manual pages for a detailed description of the syslog facility.1.0e.g.
from pyloger import log
log._info(info = ‘Message had been inserted!’)
log._warning(err = True,a = ‘Warning!Connection is time out!’)
log._err(info = ‘Something error!’)
Package: pylogfaces
Python client for logFaces.This is basically just the client written by Stojan Jovic that can be found on the
logFaces download page, only with a setup.py file for easier installation.http://www.moonlit-software.com/logfaces/web/download/Currently requires setuptools.  The setup script hasn’t been tested with python
versions other than 2.7.To install:pip install pylogfacesAnd you’re done.