Saravanan666/pypi-org huggingface dataset:
Package: simple-commons-uploader
Simple Commons UploaderThe Simple Commons Uploader makes it easy to batch upload your self-made photos and videos to theWikimedia Commons.⚠️ You must have an account on Wikimedia Commons to use this program.  Create an account bygoing here.Downloadpipinstallsimple-commons-uploaderUsageusage: __main__.py [-h] [-u username] [folders ...]

Simple Commons Uploader

positional arguments:
  folders      folders with files to upload

options:
  -h, --help   show this help message and exit
  -u username  username to useAuthentication/LoginThe Simple Commons Uploader works with your normal password andBotPasswords.👉 Password is set via env variable<USERNAME>_PW, such that<USERNAME>is the username of the bot in all caps.Behavior DetailsThe Simple Commons Uploader only uploads files inthese file formats.  Any other file types will be skippied.Uploaded files will be named based on local folder name.  For example, if your folder is calledFancy pigeons, contains jpgs of fancy pigeons, and today's date is 2018-01-01, then the resulting files will be namedFile:Fancy pigeons 1 2018-01-01.jpg,File:Fancy pigeons 2 2018-01-01.jpg,File:Fancy pigeons 3 2018-01-01.jpg, etc.Uploaded files will be categorized using the same name as the containing folder on your computer.  To use a different category, add an_character to the end of the folder name, followed by the category (without theCategoryprefix) you would like to add.  For example, a folder with nameFancy pigeons _ Gray birdswill causescuto upload the files with a base name ofFancy pigeonsand categorize them inCategory:Gray birds.
Package: simpleconfig
what?simpleconfig is a Python module that reads INI files into a dictionary. It
is both Python 2 and Python 3 compatible.why?I’ve written this code several times for a couple projects; I got sick of
copying the file over to new project directories.how?Both aparseandparse_stringfunction are provided. The former parses
config files, and the latter parses a config file serialised into a string.return value and exampleBothparse()andparse_stringreturn a dictionary (see below) where each
section is a key at the top level,
and is a dictionary of key=value pairs itself. For example, given the config
file:>>> config = """
# random version information
version = 1.0.5

; last modified 1 April 2001 by John Doe
; example taken from wikipedia
[owner]
name=John Doe
organization=Acme Widgets Inc.

[database]
# use IP address in case network name resolution is not working
server=192.0.2.62
port=143
file="payroll.dat"
"""Parsing this withsimpleconfigyields:>>> import simpleconfig as sc
>>> cfg = sc.parse_string(config)
>>> cfg['owner']['name']
'John Doe'
>>> cfg.owner.name
'John Doe'Note that the dictionary type returned by the parse functions is actually akutils.dicts.AttrDictDict,
which is derived from thedicttype and can be used wherever adictcan.licensesimpleconfig is released under an ISC license.authorsimpleconfigwas written by Kyle Isom <coder@kyleisom.net>.additionalThe module is only tested for compatibility against Python 2.7 and
Python 3.3+. There are no guarantees (or attempts) at compatibility
with previous version of Python.The docs are onRTD.The source forsimpleconfigis online:Github
Package: simple-config
# Simple ConfigA simple configuration file manager for python. Best suited for simple scripts that needto take user defined configuration parameters.Configuration is saved in JSON format to a file of your chosing.## Why?This is mostly intended to be used in quick and dirty scripts and simple CLI apps.This does not intend to replace `configparser`. There are instances where I feelthat bootstrapping `configparser` is an overkill. This is where `simple_config` chips in.## InstallationInstall if using `pipenv` by running the command below.```bashpipenv install simple-config```Or, if you are not using `pipenv`, run the following:```bashpip install simple-config```## Usage`simple-config` provides a `Config` class. It is intended to be instantiatedat the module level once and used the instance everywhere.Put this in a file called `config.py`:```pythonfrom simple_config import Configdefault_settings = {"is_registered": True,"token": "aK3NJe3PnXJr"}settings = Config("/path/to/config.json", defaults=default_settings)```Here, the first argument is the path to the configuration file.The `defaults` keyword argument takes the default configurationoptions for your app.If the config file does not exist, it will be created and populatedwith the default values.Now, import the instance of `Config` i.e. `settings` wherever necessary and use:```pythonfrom config import settingsprint(settings.token)```### Mutating the configSometimes there might be a need to update the config, e.g. to save state ofthe app. The `Config` class provides `update` instance method.```pythonsettings.update(token="Ju901jK1Rb")```The update method will update the parameters and write it to the configfile as well.## Multiple configsThere can exist more than one `Config` instance in an application. For example,the application auto-generated state can be saved in one file and user's configcan be saved in another instance.## Run the testsGo to the root of this project and run:```pythonpython -m unittest discover```## Similar projects* [yapconf](https://github.com/loganasherjones/yapconf)
Package: simple-config-handler
Simple Config Handlerconfig_handler is a python module designed to manage loading and updating config files inside of a program.
capable of a main config and a user config each simultaneously using json files, it makes it easy to locate configs for
your programs every time.How to find config files!Config Storage Location in WindowsGeneral Config FileC:/Users/$USER/APPDATA/Local/<your program name>/base-config.jsonUser ConfigC:/Users/$USER/APPDATA/Local/<your program name>/user-config/<user>-config.jsonConfig Storage Location in MacGeneral Config File/Users/$USER/Library/ApplicationSupport/<yourprogramname>/base-config.jsonUser Config/Users/$USER/Library/ApplicationSupport/<yourprogramname>/user-config/<user>-config.jsonConfig Storage Location in LinuxGeneral Config File/Users/$USER/.config/<yourprogramname>/base-config.jsonUser Config/Users/$USER/.config/<yourprogramname>/user-config/<user>-config.jsonInstall instructionsSimple! Use Pypi!pip3installsimple_config_managerUsageSimple!importsimple_config_handlersimple_config_handler.init("Program name")main_config=simple_config_handler.load_base_config()# get user info and nameuser_data=simple_config_handler.load_user_config(user)
Package: simple-connect
Simplify Connection to your DatabaseSimple Connect allows you to securely access your database and it supports SSH Connection
Currently it only supports SQL Databses.Sample Usagefrom simple_connect import connect

conn = connect.Connect('sample_credential.json', 'database_name')

sample_table = conn.query('SELECT * FROM sample_table')Installationpip install simple-connectSecure your Database credentialsSimple Connect tries to find your database / ssh credentials from a json file in ".credentials" folder which is in your home directory.
Example for windows, mac and linux respectively:C:\Users\John\.credentials\sample.json

/Users/John/.credentials/sample.json

/home/John/.credentials/sample.jsonCreate the directory and the json file.Json file should be in your following format:{
  "SQL_HOST": "host_example<127.0.0.1>",
  "SQL_USER": "<username_of_your_sql>",
  "SQL_PASSWORD": "<password_of_your_sql>"
}For SSH, you'll need to add additional keys:{
  "SSH_USERNAME": "<ssh_username>",
  "SSH_PASSWORD": "<ssh_password>",
  "BASTION_HOST": "<sshBastion_host>"
  "SQL_HOST": "host_example<127.0.0.1>",
  "SQL_USER": "<username_of_your_sql>",
  "SQL_PASSWORD": "<password_of_your_sql>"
}UsageImportfrom simple_connect import connectBasic connection:conn = connect.Connect('sample_credential.json', 'database_name')SSH connection:conn = connect.BastionConnect('sample_credential.json', 'database_name')QueryingReadQuery table (returns pandas dataframe):sample_table = conn.query('SELECT * FROM sample_table')For Insert, Update and Delete -> Give dataframe rows that are required to update in table.InsertInsert new table or append to existing table:conn.to_db(dataframe, '<table_name>')Updateconn.update_table(dataframe, 'table_name', ['column_to_set1', 'column_to_set2', ...], ['columns_where_contition_applies', ...])Example:SQL:
UPDATE sample_table SET student = 'john', class = 5 WHERE id = 432 AND id_2 = 'SC'
UPDATE sample_table SET student = 'alisha', class = 5 WHERE id = 525 AND id_2 = 'SC'

Python:
conn.update_table(dataframe, 'sample_table', ['student', 'class'], ['id', 'id_2'])Deleteconn.delete_row(dataframe, 'table_name', ['columns_where_contition_applies', ...])Example:conn.delete_row(dataframe, 'sample_table', ['id', 'id_2'])
Package: simple-console-menu
Simple Consol Menuthis module allows you to create simple console menu.linksSourceDocumentationBug ReportPyPiInstallationpip install simple-console-menuUsagefromsimple_console_menuimportMenuExamplefromsimple_console_menuimportMenuexample_menu=Menu.menu("Menu",["item 1","item 2","item 3"])example_menu.display()user_input=example_menu.get_user_input()print(user_input)
Package: simplecoremidi
Simple CoreMIDI for Python is the simplest way of using MIDI in Python
on Mac OS X. Period.Installationpip install simplecoremidiUsageTo send midi out from your application:from simplecoremidi import send_midi
send_midi((0x90, 0x3c, 0x40))This sends a MIDI Note On signal. To receive it you’ll have to
configure your DAW or software to receive from the “simple core midi
source” MIDI source.To receive midi from another application:from simplecoremidi import recv_midi
data = recv_midi()This returns all the midi data sent to the “simple core midi
destination” MIDI destination since your last call. Put it inside a
loop and poll it.Look at the example in the simplecoremidi/examples directory.NotesIt only works on Macs. It will never work on Windows or Linux.It is not configurable.
Package: simple-co-train
A simple co-training library built with Keras.Free software: MIT licenseInstallationBefore installing simple-co-train, please install one of Keras’ backend engines: TensorFlow, Theano, or CNTK.pip install simple-co-trainDocumentationBasic usage:fromsctrainimportCoTrainer,SelectionStrategyfromsctrain.resultsimportprint_resultstrainer=CoTrainer(data_path='imdb.csv',# this can be a directory, e.g. 'data'x_name='review',# optional, defaults to 'text'y_name='sentiment',# optional, defaults to 'label'unlabelled_size=0.9,# optional, what portion of total data should be used as unlabelledtrain_size=0.8,# optional, what portion of labelled data should be used as training datamapping={'negative':0,'positive':1}# optional mapping, y column must be 0 or 1selection=SelectionStrategy.UNSURE_ONLY# optional, can be CONFIDENT_ONLY or BOTH)# run the co-training, this may take a while...trainer.run()# print out accuracy, f1 score, precision, recall, and labelled samples at each co-training roundprint_results(trainer)DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.1.0 (2020-05-07)First release on PyPI.
Package: simple-countdowntimer
Countdown TimerThis simple class allows you to simplify project that require a countdown timer. Simply set the duration of the timer either usingcountdowntimer.durationorcountdowntimer.duration_in_secondsand then runcountdowntimer.reset(). It will then countdown from the future time -current_time + duration. Once the timer is up theisalarmvariable will becomeTrue. This can be put into a simple loop such as:c=CountDownTimer()c.duration=1# minutec.reset()whilenotc.isalarm():c.status()sleep(0.25)print("Timer is done")Functional referenceBelow is a description of each of the functionstickThe countdowntimer class has atickfunction that will return the remaining time as a simple printable time string:countdowntimer.tick()target_timeReturns the Target time, that is the start_time + the duration in minutescountdowntimer.target_timetarget_strThe countdowntimer class has atarget_time_strfunction that will return the future, or target time as a pretty printable string.countdowntimer.target_time_str()start_time_strThe countdowntimer class has astart_time_strfunction that will return the start time - the time the counter started counting from as a pretty printable string.countdowntimer.start_time_str()remaining_strReturns the remaining time as a pretty printable string.countdowntimer.remaining_str()isalarmReturnsTrueif the countdown timer target time has been reached, andFalseif the time has yet to be achieved.countdowntimer.isalarm()statusIf the timer hasn't reached its target time, this function prints out a single line showing:The Start timeThe Current TimeThe Remaining Timecountdowntimer.status()Why this class was createdThis library was created for both the AI Assistant Pomodoro skill as well as theBuild your own Cute Pomodoro Desk Robot - HeyBot!see video below.The full BYO Cute Pomodoro Desk Robot code isavailable here.YouTube VideoClick the thumbnail below to watch the show all about this build.
Package: simple-coverage
simple-coverageVery basic coverage tool for educational purposes.Installationpipinstallsimple-coverageUsageJust import the package and add the @print_coverage decorator above functions you want to inspect.fromsimple_coverage.coverageimportcoverage@print_coveragedefdemo(x,y)->int:"""Demo function"""product=x*yifproduct<10:returnproduct*2else:returnproductif__name__=="__main__":demo(3,5)When simply runnning the Python-file, this will create the following output:Function:demo(3,5)CALLEDline9:product=x*y
CALLEDline10:ifproduct<10:
MISSEDline11:returnproduct*2IGNOREline12:else:
CALLEDline13:returnproduct

Instructioncoverage:75.0%
Branchcoverage:50.0%DoctestsIf you want to use it with doctests, use the meta wrapper@doctest_wrapperand thelog_coveragedecorator. This will create asimple-coverage.jsonfile in the current working directory since writing into the console would collide with the doctests.fromsimple_coverage.coverageimportlog_coverage,doctest_wrapper@doctest_wrapper(log_coverage)defdemo(x,y)->int:...Look at thedemo.pyfile for reference. To start the doctest use pytest as usual.pytest--doctest-modulesdemo.pyAfterwards you can create the report:python3-msimple_coverage.reportNote that all runs will be saved for the next report. To start over and delete to report run:python3-msimple_coverage.clean
Package: simple-cpf
Simple CPFA simple package to validate and format the CPF -Brazil Identification Card.Installationpipinstallsimple-cpfHow to useimportsimple_cpf.simple_cpfimportCPF# validating a cpfCPF.is_valid('117.762.459-11')# TrueCPF.is_valid('117.762.459-19')# False# generating a fake cpfCPF.fake()# '917.350.558-75'# formatting a valid cpfCPF.formatted('10757246354')# '107.572.463-54'# in case of invalid cpf, it will return:# 'Enter a valid CPF.'Made by:cesargodoi  -https://github.com/cesargodoi/simple_cpf
Package: simplecpreprocessor
simplepreprocessorUsageimport simplecpreprocessorThere will be one function called preprocess. It can either be called with a file object or
something that looks sufficiently like a file object. See unit tests to find out what's enough
for a compatible wrapper.
Line endings are by default normalized to unix but a parameter can be given to customize this
behaviour.GotchasSupported macros: ifdef, ifndef, define, undef, include, else,
pragma (only "once")If using for FFI, you may want to ignore some system headers eg for typesLimitations:Multiline continuations supported but whitespace handling may not be 1:1
with real preprocessors. Trailing whitespace is removed if before comment,
indentation from first line is removedSemi-colon handling may not be identical to real preprocessors
Package: simple-crawler
Installpip3 install simple-crawlerSet environmentAUTO_CHARSET=1to passbytesto beautifulsoup4 and let it detect the charset.ClassesURL: define a URLURLExt: class to handleURLPage: define a request result of aURLurl: typeURLcontent,text,json: response content properties from libraryrequeststype: the response body type, is a enum which allowsBYTES,TEXT,HTML,JSONis_html: check whether is html accorrding to the response headers'sContent-Typesoup:BeautifulSoupcontains html ifis_htmlCrawler: schedule the crawler by callinghandler_page()recusivelyExamplefrom simple_crawler import *


class MyCrawler(Crawler):
    name = 'output.txt'
    aysnc def custom_handle_page(self, page):
        print(page.url)
        tags = page.soup.select("#container")
        tag = tags and tags[0]
        with open(self.name, 'a') as f:
            f.write(tag.text)
        # do some async call

    def filter_url(self, url: URL) -> bool:
        return url.url.startswith("https://xxx.com/xxx")


loop = get_event_loop(True)
c = MyCrawler("https://xxx.com/xxx", loop, concurrency=10)
schedule_future_in_loop(c.start(), loop=loop)TODOSpeed up using async or threading
Package: simple-crypt
What Does Simple Crypt Do?Simple Crypt encrypts and decrypts data.  It has two functions,encryptanddecrypt:from simplecrypt import encrypt, decrypt
ciphertext = encrypt('password', plaintext)
plaintext = decrypt('password', ciphertext)That’s it.  You can see the implementation ongithub.Why Should I Use Simple Crypt?It uses standard, well-known algorithms, closely following the
recommendationshere.The established, efficientpycryptolibrary provides the algorithm implementations (the cipher used is AES256).It includes a check (an HMAC with SHA256) to warn when ciphertext
data are modified.It tries to make things as secure as possible when poor quality
passwords are used (PBKDF2 with SHA256, a 256 bit random salt
(increased from 128 bits in release 3.0.0), and 100,000 rounds
(increased from 10,000 in release 4.0.0)).  But that doesn’t mean
you should use a poor password!Using a library, rather than writing your own code, means that we
have less solutions to the same problem.  That means more chance of
finding bugs, which means more reliable, more secure code.If simple-crypt does have a bug, the use of a header in the
ciphertext data will help support an upgrade path (I can’t promise
full backwards support, because any solution will depend on the
attack, but at least the needed information is present).What Else Should I Know?You must also installpycrypto.Notethat pycrypto has
parts written in C so requires a full python install.  On some unix
systems that may mean adding a package likepython-devfrom your
package manager.In Python 3 the outputs fromencryptanddecryptarebytes.  If you started with string input then you can convert
the output fromdecryptusing.decode('utf8'):mystring = decrypt('password', ciphertext).decode('utf8')Moredocumentation and examples.Later versionscandecrypt data from previous versions, but data
encrypted by later (major) versionscannotbe decrypted by earlier
code (instead, an error is raised asking the user to update to the
latest version).(c) 2012-2015 Andrew Cooke,andrew@acooke.org;
2013d10n,david@bitinvert.com.
Released into the public domain for any use, but with absolutely no warranty.
Package: simplecrypto
Cryptographic library with really simple API.Includes functions for hashes, symmetric and asymmetric crypto, along with
helper functions. Acts as a wrapper forPyCryptoand a few standard
libraries.DocumentationDocumentation is available athttp://simplecrypto.readthedocs.org.The full source code repository is athttps://github.com/boppreh/simplecrypto.Installationpip install simplecryptoThis library depends onPyCrypto. On Linux this is installed automatically by
pip. If the dependency installation fail on Windows, you may want to
use aprebuilt installer.
If you wish to compile it I suggest using the Mingw toolsas indicated
here.Usagefrom simplecrypto import sha1, encrypt, decrypt, RsaKeypair, base64

sha1('The quick brown fox jumps over the lazy dog')
# '2fd4e1c67a2d28fced849ee1bb76e7391b93eb12'

# `encrypt` and `decrypt` use AES-256.
m = encrypt('secret message', 'secret key')
print(m)
# 'uRKa9xX7zW6QT1yJxIQb5E/0DzaxQglVggnFam5K'
decrypt(m, 'secret key')
# b'secret message'

skey = RsaKeypair(2048)
pkey = skey.publickey

m = pkey.encrypt('secret message')
skey.decrypt(m)
# b'secret message'

s = skey.sign('authenticated message')
pkey.verify('authenticated message', s)
# True

base64('message')
# 'bWVzc2FnZQ=='Last Updates0.3.4 (2022-08-24)Update metadata.0.3.3 (2015-8-07)Package tests.0.3.2 (2014-3-30)Add HMAC support.Use SHA256 as default RSA hashAllow selection of PRNG used for RSA key generationMinor changes for better Python2 support0.3.1 (2013-12-06)Add project to Travis and Coverall.Increase test coverage to 100%.Add installation instructions.Renameguess_hashtoguess_transformation.0.3.0 (2013-12-05)Addserializeto RSA keys.Allow RSA keys to receive PEM encoded keys in the constructor.Implement__repr__method in base Key class (you can now print keys).Split package into moduleskey,formats,hashes,randomandexceptions.0.2.3 (2013-12-05)Update project information (keywords, classifiers, description, etc).0.2.2 (2013-12-04)Addsendandreceivefunctions for secure message building.RaiseEncryptionErrorinstead of generic errors.Slightly better test coverage.0.2.1 (2013-12-03)Add baseKeyclass.Introducerawversions of encrypt and decrypt.Implemented key printing and comparison.0.2.0 (2013-12-03)Return str fromto_base64and allowfrom_base64to receive str.Create classes for different key types.Change return fromto_hexto str for consistency with base64.guess_hashfunction moved to different module.Automatically use session keys when encrypting large messages.0.1.0 (2013-11-26)Initial release.