Saravanan666/pypi-org huggingface dataset:
Package: simple-factory-pattern
Simple Python Factory patternThis module provides a simple way to prevent the direct creation of an instance of a class. Instead aclassmethodof this class can be used.InstallYou can install this python module viapip:pipinstallsimple-factory-patternOtherwise the module can be downloaded from PyPI:https://pypi.org/project/simple-factory-pattern/UsageImport the module:fromsimple_factory_patternimportFactoryPatternMetaCreate a class that uses the above meta class:classNewClass(metaclass=FactoryPatternMeta):passAdd aclassmethodto the new class that returns an instance of the class:@classmethoddefcreate_instance(cls):returnNewClass()You can choose any name for the method. But it must be aclassmethod!It's also possible to define multipleclassmethods. Only in those methods a new instance of the class can be created.Behavior of the new classIt's not possible to create an instance of the class directly:instance=NewClass()# this will failThis throws aFactoryException(also included in thesimple_factory_patternpackage).The only way to get an instance is to call the above defindedclassmethod:instance=NewClass.create_instance()# this works
Package: simplefancontroller
# SimpleFanController
RaspberryPi fan management and control system for 2-pin and 4-pin (PWM controlled) fans connected via the onboard GPIO pins.The system will consist ofSFController: responsible for managing and controlling the fans and GPIO pinsSFCAPI: provides a REST API for interacting withSFController(OAuth2 bearer token authentication)SFCUI: is a Web UI for accessing the API (missing)Documentation is available at [ReadTheDocs](https://simplefancontroller.readthedocs.io/en/latest/index.html).WarningThis piece of software is still being developed. Use with care!## Usage
### Start SFC
Usage with docker-compose:download [docker-compose.yml](https://gitlab.com/tiuri/simplefancontroller/-/blob/main/docker-compose.yml)runsetup.shto create an initial.envconfiguration filerundocker-composeup-dto start the containers.Usage without Docker is possible but not encouraged:clone the git repository``shell git clonehttps://gitlab.com/tiuri/simplefancontroller.gitcd simplefancontroller ``runsetup.shto create a.envconfiguration fileentercd simplefancontrollerand runpython main.pyYou can use tools like [supervisor](http://supervisord.org/) to run SFC in the background.### Control SFC
SFC controls fans connected via either two or four GPIO pins.
Package: simplefbchat
SimpleFbChatSimple Facebook Chat library for students. Do not use at production.Example:from simplefbchat import SimpleFbChat

login = "example@tfbnw.net"
password = "passw0rd"

fb = SimpleFbChat(login, password)

while True:
    received_message = fb.receive()

    text = received_message.text

    received_message.reply("Hello: " + text)
Package: simple-fbmessenger
Simple Facebook MessengerThis is an unofficial, simple library to provide basic communication with Facebooks Messenger API:https://developers.facebook.com/docs/messenger-platform/introductionSupported FeaturesSend & receive messagesSupport for Buttons and QuickRepliesSupport for imagesIt is currently Work in progress, Pull Requests are more than welcome! Examples can be found inexamples/.Uses:aiohttp, Apache Software License (Apache 2)
Package: simplefeature
This repository provides an incredibly light-weight implementation of the gray-scale feature extractor from:
"Beyond simple features: A large-scale feature search approach to unconstrained face recognition"Usepip install simplefeatureorgit clone https://github.com/joelb92/simplefeature.git && cd simplefeat && python setup.py installimport simplefeature
   import cv2
   im = cv2.imread("/home/face.jpg")
   embedding = simplefeature.extract(im)Inputs will be scaled to 200x200px
The system outputs a 51200-d vectorPlease cite this paper:Cox, David, and Nicolas Pinto. "Beyond simple features: A large-scale feature search approach to unconstrained face recognition."
2011 IEEE International Conference on Automatic Face & Gesture Recognition (FG). IEEE, 2011.
Package: simplefetch
simplefetchSimplified Paramiko Library to Fetch Data From MultiVendor Network DevicesSupportsCisco IOSCisco IOS-XECisco NX-OSCisco IOS-XRJuniper JunosHuawei VRP5/8ZTE ZXROSDELL OS10Ericsson IPOSScript is based on paramiko and catches device-prompt to understand the output is fetched, thus there is a strong possibility that script could work with many network devices from different vendors, i  only do not have the chance to test.Accepted Network Device OS Typeshuawei-vrpcisco-ioscisco-iosxecisco-iosxrcisco-nxosjunosdell-os10zte-zxrosericsson-iposnokia-srosFor the above device type pagination commands (e.g. "terminal length 0") send automatically.Simple Exampleimport simplefetch

test_router = simplefetch.SSH("192.168.1.1", port=22,user="admin", passwd="secret", network_os="cisco-ios")
print (test_router.fetchdata("show version"))
test_router.disconnect()Example with Loggingimport simplefetch,logging
logging.basicConfig(filename='info.log', filemode='a', level=logging.INFO,
                    format='%(asctime)s [%(name)s] %(levelname)s (%(threadName)-10s): %(message)s')

test_router = simplefetch.SSH("192.168.1.1" port=22, user="admin", passwd="secret", network_os="cisco-ios")
print (test_router.fetchdata("show version"))
test_router.disconnect()Example with Multithreading Python3# -*- coding: utf-8 -*-
import simplefetch
import logging, time
from threading import Thread
timestr = time.strftime("%Y%m%d-%H%M%S")
log_filename="connection_logs"+str(timestr)+".txt"

#================== Logging
logging.basicConfig(filename=log_filename, filemode='a', level=logging.INFO,
                    format='%(asctime)s [%(name)s] %(levelname)s (%(threadName)-10s): %(message)s')

#==================USER, PASS, ROUTER_LIST==============
username= "username"
password="password"
router_list=["router_name1","192.168.1.1"]

#================== MEMORY check function for huawei devices
def get_memory_usages(router_name):
	try:
		connection = simplefetch.SSH(user=username, passwd=password, network_os="huawei-vrp")
		try:
			display_health_raw= connection.fetchdata("display startup")
			print (router_name)
			print (display_health_raw)
		except:
			logging.warning ("could not get output of command from %s",router_name)
			connection.disconnect()
	except:
		logging.warning ("connection unsuccessful to %s",router_name)

#================== multithread part 
import concurrent.futures 
with concurrent.futures.ThreadPoolExecutor(max_workers=10) as executor: 
	for items in router_list:
		executor.submit(get_memory_usages,items) 
executor.shutdown(wait=True)
Package: simple-file-backup
Simple File BackupOverviewThis module lets you back up a single file periodically. It is possible to configure
more than one backup period, and limit the maximum number of backup files to keep (per
backup period).InstallationInstall this module with:pip install simple_file_backupThe module exposes thesimple-file-backupcommand-line application.Command Line UsageAccess the command line help withsimple-file-backup -h:simple-file-backup -h
usage: simple-file-backup FILE_PATH BACKUP_DIR_PATH [-ext EXT] [-conf CONF]

Console application for periodically backing up a single file.

positional arguments:
  file_path        path of file to back up
  backup_dir_path  path of the directory for the backups

optional arguments:
  -h, --help       show this help message and exit
  -ext EXT         file extension of the backups; default is '.bak'
  -prefix PREFIX   backup file name prefix; default is 'backup'
  -conf FILE       path to an optional config file that defines the backup intervals,
                   subdirectories and file limits; by default hourly, daily, weekly and
                   30-day interval backups are created with 48, 14, 12 and unlimited
                   number of files respectively
  -method METHOD   backup method; the default is 'copy' (simple file copy), for sqlite3
                   database files, use 'sqlite3' to avoid corrupting the backupsA separate subdirectory for every backup period will be created within the passed
backup directory.Configuration FileThe configuration file is JSON. Backup subdirectory name, backup period (in hours) and
file limit per backup period must be configured. For no file limit, pass "inf" as
string.[{"dirname":"every_minute","period":0.166667,"limit":10},{"dirname":"every_hour","period":1,"limit":24},{"dirname":"every_day","period":24,"limit":30},{"dirname":"every_30days","period":720,"limit":"inf"}]Python ExampleThe module can be imported. It exposes theSimpleFileBackupclass.
In this use case the configuration must be passed as a list of dicts (with the same
scheme as the config JSON file).fromsimple_file_backupimportSimpleFileBackupbackup_inst=SimpleFileBackup(file_path="file_to_back_up.txt",backup_dir_path="backup_dir",prefix="file_backed_up",# optional, defaults to "backup"extension=".txt"# optional, defaults to ".bak"backup_config=[{"dirname":"hourly","period":1,"limit":24},{"dirname":"daily","period":24,"limit":"inf"}],# optional, defaults to the same backup periods as the command line versionbackup_method="copy"# optional, defaults to "copy" (alternative: "sqlite3"))# this gets an asyncio loop, creates the backup tasks and runs the loop forever:backup_inst.run()Optionally, if integrating into another asyncio application, the tasks can be created
on the existing loop without creating and running the loop with thecreate_tasks(loop)method.
Package: simple-file-cache
simple_file_cachePython Simple cache based on pickle or json fileUsagedata={"hi":"hello"}# usage 1: as a file cache@file_cache(file='export.json',type='json')defdo_job():returndata# usage 2: load file as fast asrs=load_file(file='export.json',type='json')# usage 3: dump file as fast asrs=dump_file(file='export.json',type='json',data=data)
Package: simple-file-checksum
Simple File ChecksumReturns the MD5, SHA1, SHA256, SHA384, or SHA512 checksum of a fileInstallationRun the following to install:pip3installsimple-file-checksumUsagePython:>>>fromsimple_file_checksumimportget_checksum>>>get_checksum("tst/file.txt")'9e107d9d372bb6826bd81d3542a419d6'>>>get_checksum("tst/file.txt",algorithm="MD5")'9e107d9d372bb6826bd81d3542a419d6'>>>get_checksum("tst/file.txt",algorithm="SHA1")'2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'>>>get_checksum("tst/file.txt",algorithm="SHA256")'d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592'>>>get_checksum("tst/file.txt",algorithm="SHA384")'ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1'>>>get_checksum("tst/file.txt",algorithm="SHA512")'07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6'Terminal:$simple-file-checksumtst/file.txt
9e107d9d372bb6826bd81d3542a419d6
$simple-file-checksumtst/file.txt-aMD5
9e107d9d372bb6826bd81d3542a419d6
$simple-file-checksumtst/file.txt-aSHA1
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
$simple-file-checksumtst/file.txt-aSHA256
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592
$simple-file-checksumtst/file.txt-aSHA384
ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1
$simple-file-checksumtst/file.txt-aSHA512
07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6DevelopingTo installsimple-file-checksum, along with the tools you need to develop and run tests, run the following:pip3install-e".[dev]"
Package: simple-file-cryptography
simple-file-cryptographyTable of ContentsInstallationLicenseExamplesInstallationpip install simple-file-cryptographyLicensesimple-file-cryptographyis distributed under the terms of theApache-2.0license.ExamplesActivate the GUI:python-m"simple_file_cryptography"-gGenerate a key:python-m"simple_file_cryptography"-kgEncrypt a file:python-m"simple_file_cryptography"-mencrypt-k"c2ebbce1532c050164ff9edc28fa4ee5"-i"some_file.txt"-o"some_file.txt.enc"Encrypt a file with automatically generated key (key will be printed out):python-m"simple_file_cryptography"-mencrypt-kg-i"some_file.txt"-o"some_file.txt.enc"Decrypt a file:python-m"simple_file_cryptography"-mdecrypt-k"c2ebbce1532c050164ff9edc28fa4ee5"-i"some_file.txt.enc"-o"some_file.txt"To encrypt or decrypt with Python code, use functions provided insimple_file_cryptography.crypto_utilitymodule.fromsimple_file_cryptography.crypto_utilityimportdecrypt_file,encrypt_file,generate_keykey=generate_key()encrypt_file("in.txt","in.txt.enc",key)decrypt_file("in.txt.enc","out.txt",key)
Package: simple-file-handler
simple_file_handlerTheFileHandlerclass provides an interface to perform most file operations easily and intuitively. All you need is the file path.importsimple_file_handlerassfh# Use in a with statement to ensure the file is closed after usewithsfh.FileHandler('path/to/file.txt')ashdl:try:# Read the handled file's contentdata=hdl.read_file(mode='r')# Write to the handled filehdl.write_file(b'Hello World!',mode='ab')# Make a copy of the handled filecopy_hdl=hdl.make_copy('path/to/directory',filename='file_copy')print(copy_hdl.file_path)# Delete the handled filehdl.delete_file()exceptsfh.FileErrorasexc:print(exc)InstallationDo a pip install from the command line:pipinstallsimple-file-handler
Package: simple-file-lock
title: README
author: Jan-Michael RyeSynopsisA context manager for rudimentary file locking. Lock files are generated next to the target path using the current hostname, process ID (PID) and a random hexadecimal token. Access to the file is then granted in order of ascending modification times of the associated lock files. If two or more lock files for the same path have the same modification time, access is granted in the sort order of the lock file paths. Each context waits for its turn to access the file.The associated lock file is deleted on exit from the context. The context also automatically deletes dead lock files for non-existent processes on the same host. Dead locks are detected by checking if the associated process has exited withpsutil.LinksHomepageRepositoryDocumentationIssuesPyPI PackageSoftware HeritageUsagefromsimple_file_lockimportFileLock# ...# Gain exclusive access to a path by creating a context with FileLock:withFileLock(path):# Do whatever you want with the file here. When the context is exited, the# lock is released.FileLockalso accepts anintervalparameter to configure the polling interval when waiting for existing locks to be released.The Sphinx-generated API documentation is availablehere.Unit TestsSome basic unit tests have been implemented and can be run in a virtual environment withtest.sh.
Package: simple-file-logger
Simple File LoggerThis python package provides aLoggerclass which is easy to use
for basic logging to files.Installpipinstallsimple-file-loggerUsagefromsimple_file_loggerimportLoggerlogger=Logger("my_log_file","path/to/log/directory")logger.info("Hello!")# writes to `my_log_file_YYYYMMDD_HHMM_SS.log`# 2022-01-26 11:57:14,182 - INFO - Hello!The constructor provides various options to configure the logger.logfile_name:str,log_dir:Union[Path,str,None]=None,level=logging.DEBUG,mode="w",add_timestamp_to_filename=True,log_to_console=False,is_null_handler=False,is_rolling_handler=False,process:str=None,To disable to console in addition to the file (default behavior), passlog_to_console=False.Theis_rolling_handlerparameter controls whether the logger automatically writes to a new file when the existing one becomes larger than5mb. It will archive the current log with a serial number and transition to a new file automatically. The limit of archived files is5so the oldest one will get deleted when archiving for the 6th time.Theis_null_handlerparameter initializes a logger that does nothing. This is useful for unit testing libraries where functions log messages but you don't want any actual logging to take place.Theprocessparameter is a little addition to provide some info about what process the currently running script represents. It can be any arbitrary string, such asdownloading_dataormonitoring_filesetc. This process will also appear on each log line. As the script executes, you can set theprocessin the logger object to a new value. This is helpful for producing files which facilitate easy line extraction related to a specific process when the file is big.logger.process="downloading_file"# ... logic to download some file which does some logging.# The lines will have `downloading_file` before the log message.# update file contentslogger.process="update_contents"# set process to indicate the context of log messages to follow# ... logic to update file contents and do some logging.# no need for further process logs, and just want to log messages.logger.process=""# prevents addition of process string to log message.
Package: simplefilemirror
A simple - one way only - file mirroring packageIn fact, it is more like a file update mechanism. Update actions are:Source file is present, destination missing, not tagged -> CopySource file is present, destination missing, tagged -> [No action]Source file is present, destination present-> [No action]Source file is missing, destination present-> [No action]‘Tagging’ is done via a json-file, which tracks files already copied.
Package: simple-file-ops
Super simple file operationsAre you tired of doing this each time to just modify a part of a json file?withopen(filepath,'r')asfile:fd=json.load(file)fd[key]='new value'withopen(filepath,'w')asfile:json.dump(fd,file)Don't worry! Now you can do it just like this! -fd=fileops.read_json(filepath)fd[key]='new value'fileops.write_json(filepath,fd)No hassle of context managers, or saving files, just do things simpler!
Package: simple-file-poller
Simple Python framework for performing file polling.It polls for files in the specified input directory and moves them to the output directory. Methods for checking
the files (e.g., whether an image is valid) and processing them can be supplied to the poller instance.
Optionally, the input files can be deleted rather than moved.For more information and examples see:https://github.com/waikato-datamining/simple-file-pollerChangelog0.0.10 (2021-03-18)added theoutput_num_filesboolean property to thePollerclass, which extends the logging output by
outputting ax/ystring as well (x=current file index, y=total number of files in a batch)0.0.9 (2021-01-05)thePoller.loggingproperty no longer returns thecheck_filemethod0.0.8 (2020-12-11)fixed high CPU usage (ie constant polling) when using unlimited files to list (max_files=0)poll_waitandwatchdog_check_intervalare now float instead of int to allow for sub-second poll waitsinternal delays when poller is busy have been dropped from 1s to 0.1s0.0.7 (2020-12-10)keyboard_interruptmethod is now public0.0.6 (2020-12-10)fixed race condition between watchdog reacting to new files and watchdog checking for files at specific intervalslogging now distinguishes between DEBUG/INFO/ERROR levelskeyboard interrupts via CTRL+C are now handled correctlyin watchdog mode, an initial scan of the input directory is now performed, in case files were already present0.0.5 (2020-12-10)addedparamsobject to allow attaching of arbitrary parameters to be used by thecheck_fileandprocess_filemethods; this avoids accidentally overriding Poller attributes that were
introduced in later versions.0.0.4 (2020-12-10)added support for using watchdog for reacting to file creation events, speeding up polling0.0.3 (2020-12-04)pollmethod now skips directories, which could be listed if no extensions are supplied to restrict the polling.0.0.2 (2020-12-03)addedother_input_filesglob list anddelete_other_input_filesto manage additional files that may
reside in the input directory along side the actual files that are being processed.0.0.1 (2020-12-02)initial release
Package: simple-file-repository
Simple File RepositoryA simple file and photo repository.
Underlying storage is a filesystem or a S3-compatible service.Installationpip install simple_file_repositoryUsageFile storage>>>importuuid>>>fromsimple_file_repositoryimportFileStorage>>>storage=FileStorage(storage_directory='/tmp/repo',database='cats')>>>storage.store(b'content')UUID('72fc4a76-1ab7-4d60-9f6a-94aa0ad45b5b')>>>storage.get(uuid.UUID(hex='72fc4a76-1ab7-4d60-9f6a-94aa0ad45b5b'))b'content'>>>list(storage.list())['72fc4a76-1ab7-4d60-9f6a-94aa0ad45b5b']Photo storage using S3fromsimple_file_repositoryimportPhotoStoragesstorages=PhotoStorages()storages.init_app(names=['cats','dogs'],storage_directory='/tmp/repo',names_for_s3=['cats'],imagemagick_convert='/usr/bin/convert',access_key_id='',secret_access_key='',region='us-east-1',bucket='my-s3-bucket')storages['cats'].store(b'image')LicenseMIT
Package: simplefileserver
Project: simplefileserver-----------------------```Simple File Server By Bottle with Paste(Multi-threaded Library)```Usage:-----------------------```python>>> from simplefileserver import server>>> server()>>> server(8080) # server(server_port)``````shell$ simplefileserver$ simplefileserver 8000```Installation:-----------------------``` bash$ pip install simplefileserver```Project History: simplefileserver-----------------------## 0.0.3 (2015-02-03)--------------------------#### Behavioural Changes* split file and directory with slash '/'#### Bugfixes* null## 0.0.2 (2015-02-03)--------------------------#### Behavioural Changes* null#### Bugfixes* add MANIFEST.in file: include data files/directories## 0.0.1 (2015-02-03)--------------------------#### Behavioural Changes* simple server ok#### Bugfixes* null
Package: simple-file-sorter
FileSorter - A simple file sorterWhat is it?Sometimes you have a folder with a lot of files, and you want
to sort them into folders. This is where FileSorter comes in.
It will sort your files into folders based on the file extension.How to install$pipinstallsimple_file_sorterHow to useusage:simple_file_sorter[-h][-sSRC][-dDST]Filesorter

options:-h,--helpshowthishelpmessageandexit-sSRC,--srcSRCSourcedir-dDST,--dstDSTDestinationdirExample$simple_file_sorter-s~/Downloads
Package: simplefin4py
SimpleFIN4PYThis library helps you access simpelFIN with python"""Example file."""importasynciofromdotenvimportload_dotenvimportosfromsimplefin4pyimportSimpleFin# Read info from .env fileload_dotenv()access_url:str=os.getenv("ACCESS_URL","")asyncdefmain()->None:"""Main function."""sf:SimpleFin=SimpleFin(access_url)data=awaitsf.fetch_data()print(data)# Run the async main functionif__name__=="__main__":asyncio.run(main())
Package: simple-firebase-realtime-db
simple_firebase_realtime_dbDescriptionsimplified usage of firebase realtime databaseInstallpipinstallsimple_firebase_realtime_db# orpip3installsimple_firebase_realtime_dbUsagefromsimple_firebase_realtime_dbimportFirebaseRealtimeDBasDBimporttimeDB.initialize(certificate_path='',database_url='')path='desired/path'print('set',DB.set({'test-key':'test-value'},path))time.sleep(10)importjsonprint(json.dumps(DB.get(path),indent=4))time.sleep(10)print('delete',DB.delete(path))Dependenciesfirebase-admin,jsoncodable,noraise