Saravanan666/pypi-org huggingface dataset:
Package: simpleruleengine
simple-rule-engineAlightweightyetpowerfulrule engine that allows declarative specification of business rules andsaves tons of repeated development work.This library has been utilized in authoring & evaluation of a number of complex credit decisioning, upgrade/downgrade, and lender evaulation criteria rules atFundsCornerThis library can also be considered as aPolicy Frameworkfor validating IaC (Infrastructure as Code).At a glancesimple-rule-engine is a Python library that enables declarative specification of decision or scoring rules.Example Decision matrixBureau ScoreMarital StatusDecisionbetween 650 and 800in [Married, Unspecified]GORule specificationfromsimpleruleengine.conditional.when_allimportWhenAllfromsimpleruleengine.expression.expressionimportExpressionfromsimpleruleengine.operator.betweenimportBetweenfromsimpleruleengine.operator.string_inimportInfromsimpleruleengine.rulerow.rule_row_decisionimportRuleRowDecisionfromsimpleruleengine.ruleset.rule_set_decisionimportRuleSetDecisionfromsimpleruleengine.token.numeric_tokenimportNumericTokenfromsimpleruleengine.token.string_tokenimportStringTokenif__name__=="__main__":cibil_score_between_650_800=Expression(NumericToken("cibil_score"),Between(floor=650,ceiling=800))marital_status_in_married_unspecified=Expression(StringToken("marital_status"),In("Married","Unspecified"))rule_row_decision_go=RuleRowDecision(WhenAll(cibil_score_between_650_800,marital_status_in_married_unspecified),"GO")rule_set_decision=RuleSetDecision(rule_row_decision_go)fact=dict(cibil_score=700,marital_status="Married")assertrule_set_decision.evaluate(fact)=="GO"Key FeaturesAbility todeclarativelyauthor both Scoring and Decision Rules.The library offers composable functional syntax that can be extended with various format adapters. Seeherefor an example of such an extension.Ability toversion controlrule declarations thus enabling auditing of rule changes over a period of time.Ability to authorchained rules. Evaluation of one rule can refer to the result of another rule, thus enabling
modular, hierarchical rules.Installationpypi repositorypip install simpleruleengine==2.0.2Source Codesimple-rule-engine GitHub RepositorySimple Rule Engine - Motivation and Under-the-Hoodhttps://jeyabalajis.gitbook.io/simple-rule-engine/
Package: simplerun
AboutRunning shell in a Pythonic way.Installation$pipinstallsimplerunUsageBasic>>fromsimplerunimportrun>>r=run('ls -l')>>r<[0]`ls-l`>0refers to the exit code here.>>printr.std_outtotal8-rw-r--r--1yjstaff664111921:46README.md-rw-r--r--1yjstaff829111822:39setup.pydrwxr-xr-x6yjstaff204111921:46simplerunIterable as input>>withopen('setup.py')asdata:>>r=run('grep def',data)>>print(r.std_out)Result as input>>r_data=run('ps aux')>>r=run('grep Chrome',r_data)Debugger>>r=run('ps aux | stranger | grep keyword')>>r<[-1]`stranger`>>>r.excOSError(2,'No such file or directory')Found thestangeris the evil>>r.history[<[0]`psaux`>]review history, and keep going with good input:>>r.rest[['grep','keyword']]>>>>r2=run(r.rest,'''Good line that contains the keyword
                       but not this line, sorry.''')>>print(r2.std_out)'Good line that contains the keyword\n'Concurrent & Parallel>>batches=['ps','top -n 10','uptime']>>r=prun(batches)# paralell running>>r2=concurrent_run(batches)# or, running in a concurrent mode
Package: simples
simplesO pacote simples contém a seguinte estruturasimples/
        ├── setup.py
        |── simples/
        |       |──── __init__.py
        |       └──── soma.py
        |── tests/
        |      |──── __init__.py
        |      └──── test_soma.py
        └── docs/Criando a pasta docs e construindo o html:Pré requisitos:sphinx-buildpara construir a documentaçãoA pasta docs e seu conteúdo pode ser criada usando os seguintes comandos:foo@bar:~/simples$mkdirdocsfoo@bar:~/simples$cddocsfoo@bar:~/simples/docs$sphinx-quickstartfoo@bar:~/simples/docs$sphinx-apidoc-f-osource/../simplesDentro da pasta vários arquivos são criados, sendo alguns delesconf.pyeindex.rst.Modificando oconf.pyO pacotesimplesutiliza o padrão dedocstring do numpy. Então deverá ser inserida essa informação na listaextensõesque se encontra dentro do arquivo.extensions=['sphinx.ext.autodoc','sphinx.ext.napoleon']Para saber mais sobre docstrings você pode consultar alguns desses tutoriais em português:caderno de laboratorioepython help.Os módulos (tests e simples) se encontram fora da pasta docs, então para eles serem reconhecidos é necessário especificar a sua localização.importosimportsyssys.path.insert(0,os.path.abspath('.'))sys.path.insert(0,os.path.abspath('../simples'))sys.path.insert(0,os.path.abspath('../tests'))Para usar o template doread the docsé necessário realizar a instalação do tema e por fim alterar a variávelhtml_theme.No terminal:foo@bar:~/ pip install sphinx_rtd_themeNo arquivoconf.pyhtml_theme='sphinx_rtd_theme'Modificando oindex.rstNo arquivoindex.rstadicionar a seguinte linhasource/modules.. toctree::
    :maxdepth: 2
    :caption: Contents:

    source/modulesPor fim, para construir o html da sua documentação, execute o terminal o comandomake htmlfoo@bar:~/simples/docs$makehtmlO html será gerado dentro do caminho~/simples/docs/_build/html. Você poderá visualizar a aplicação emhttp://localhost:8000/, realizando os seguintes comandos.foo@bar:~/simples/docs$cd_build/htmlfoo@bar:~/simples/docs/_build/html$python-mhttp.serverServing HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...ReferênciasSphinx for Python documentationFirst Steps with SphinxGetting Started with Sphinx
Package: simple-s3fs
simple-s3fsA simple (read-only) FUSE-based file system for S3 buckets.Usagesimple-s3fs --aws-profile default -f -l /tmp/s3.log /tmp/s3/<bucket>
less /tmp/s3/<bucket>/folder/file.txtPlease note: Folders in buckets cannot have.in their names and files must have an extension (i.e. a.)Unmountingumount /tmp/s3/<bucket>DevelopmentThe recommended way to developsimple-s3fsis to use acondaenvironment and
installsimple-s3fswith develop mode:pipinstall-e.ImportantThis is a FORK of Peter Kerpedjiev'ssimple-httpfspackage. It was adapted to the needs of projects at the4D Nucleome Data Coordination and Integration Center (4DN-DCIC).
Package: simple-salesforce-extends
simple-salesforce-extendsAboutThis package extends the simple-salesforce package to support the use of AWS Secrets Manager to store the Salesforce credentials.API request with the stored token if hold the token.If the token is expired, re-authenticate and store the new token.RequiredPython 3.11+simple-salesforceboto3Install$ pip install simple-salesforce-extendsPrepareCreate a secret in AWS Secrets Manager with the following format:{"Domain":"yourdomain.my","ConsumerKey":"3MV.....","ConsumerSecret":"1234ABCD...."}Usageimportboto3fromsimple_salesforce_extendsimportSalesforceClientCredentialsfdc_credential_secrets_arn="arn:aws:secretsmanager:us-east-1:123456789012:secret:your-secret-arn"secrets_client=boto3.client("secretsmanager",region_name="us-east-1")sf=SalesforceClientCredential(secrets_client=secrets_client,credentials_secrets_manager_arn=sfdc_credential_secrets_arn,)soql="SELECT Id, Name FROM Account LIMIT 1"result=sf.query(soql)print(result["records"][0])Test$ python -m unittest discover -s src/
Package: simple-sample
This package contains a simple sample of a Python package prototype.
It is part of theeducational repositoriesto learn how to write stardard code and common uses of the TDD.See the documentation and how to do it onreadthedocs.
And see the development of this code step by stepwithsee-git-stepsonreadthedocs / step by stepInstallationThe package is self-consistent. So you can download the package by github:$gitclonehttps://github.com/bilardi/python-prototypeOr you can install by python3-pip:$pip3installsimple_sampleUsageRead the unit tests intests/testMyClass.pyfile to use it. This is a best practice.
You can read also the documentation by command line,$python3>>>fromsimple_sample.myClassimportMyClass>>>print(MyClass.__doc__)>>>help(MyClass)>>>quit()If you want to see the local documentation, that you have downloaded by github, you can use the same steps but before you must to change the directory$cdpython-prototypeDevelopmentIt is common use to test the code step by step and unittest module is a good beginning for unit test and functional test.Test with unittest module$cdpython-prototype$python3-munittestdiscover-vChange LogSeeCHANGELOG.mdfor details.LicenseThis package is released under the MIT license.  SeeLICENSEfor details.
Package: simplesbml
simplesbmlThank you for downloading SimpleSBML!  This package supports easy SBML model construction and editing.The documentation can be found at:http://simplesbml.readthedocs.io/en/latest/libSBML documentation:http://sbml.org/Software/libSBML/docs/python-api/index.htmlSBML main page:http://sbml.org/Main_PageVersions:The current version is 2.2.0. Compared to 1.2.x series, this adds 'get' functions to interrogate an existing SBML model.How to install SimpleSBMLSimpleSBML can be installed via pip:pip install simplesbmlPython version supportSimpleSBML in theory supports Python versions 2.7, 3.3, 3.4, and 3.5. It definitely supports Python 3.6, 3.7 and 3.8. SimpleSBML is a pure Python package, but relies on libSBML, which must be compiled for each supported version.HelpYou can go to the package documentation to read about the package's classes and methods.  For an example of how to use sbmlModel() and writeCode(), look at 'example.py' in this folder.  For other issues, report them at github.com/sys-bio/simplesbml/issues.
Package: simpleschema
simpleschemasimpleschemais a library for validating dicts or objects to ensure they have a given structure. A use case for this might be to verify integrity of received data, parse event types based on a specification, or ensure arbitrary objects provide certain required methods.It is intended to provide advanced validation methods with a simple, no-fuss interface.Validation constraints can be a specific value, a type (or typelike), a set of options, a user-defined validation callable, or even another schema. SeeValidation Detailsorhelp(simpleschema.validateSchema)for more information.simpleschema.validateSchemavalidates an item against a schema, returningTrueor raising asimpleschema.SchemaValidationFailureif it fails to validate.simpleschema.isValidprovides a convenience wrapper tovalidateSchema, instead returningFalseon validation failure.Example Usage:importsimpleschemamy_schema={'method':['GET','POST'],'timestamp':int,'version':lambdav:v>='1.0.0',}my_item={'timestamp':1667515052,'method':'GET','status':200,'json':{'key':'value'},'version':'2.1.1',}bad_item={'timestamp':'1667515052','method':'PUT','version':'0.1.9',}simpleschema.isValid(item=my_item,schema=my_schema)# Truesimpleschema.isValid(item=bad_item,schema=my_schema)# FalseSchemata can also be used to validate object structure:importsimpleschemamy_schema=simpleschema.ObjectSchema({'required_method':callable,'required_string_attribute':str,('required_a_or','required_b'):object,})classValidClass:required_string_attribute='string'defrequired_method():passdefrequired_b(self):passclassValidOnlyIfInstantiated:def__init__(self):self.required_string_attribute='different string'defrequired_method():passdefrequired_b(self):passclassInvalidClass:required_string_attribute=123required_method='not_a_callable'defrequired_b(self):passsimpleschema.isValid(ValidClass,my_schema)# Truesimpleschema.isValid(ValidClass(),my_schema)# Truesimpleschema.isValid(ValidOnlyIfInstantiated,my_schema)# Falsesimpleschema.isValid(ValidOnlyIfInstantiated(),my_schema)# Truesimpleschema.isValid(InvalidClass,my_schema)# Falsesimpleschema.isValid(InvalidClass(),my_schema)# FalseInstallationpip install simpleschemaValidation DetailsKeys-value pairs in the schema are compared as constraints against each pair in the item, by the following methods, in order:Direct value comparisonIf the constraint is re.Pattern, check if there is at least one match in the itemIf the constraint is typing.Literal, compare its value to the value of the itemIf the constraint is a dictionary, recursively validate the item against the constraint as a schemaIf the constraint is a type (or type hint, like typing.Iterable), check if the item is an instance of that typeIf the constraint is iterable, try each value as a constraint against the item. If any validate, the constraint validates.If the constraint is callable, evaluate it against the itemIf every pair in the schema succesfully validates against at least one pair in the item, the item validates.
Package: simplescraper
Python Scraper==============A simple web scraper made in python with love:Install with pip:-----------------.. code:: shpip install simplescraperUsage:------Make a simple call to a web page, lets call 'www.test.com'.. code:: pythonfrom simplescraper import SimpleScrapertest = SimpleScraper()result = test.get_scraped_data('www.test.com')print resultoutput:~~~~~~~.. code:: javascript{url: 'http://www.test.com',source: 'www.test.com',image: 'http://www.test.com/some/random/image.png',title: 'Just a test page'}You can also call it without using the 'www' as 'test.com' if the web page has a redirection. If the web page needs the usage of the https protocol to be accessed you can call it as: 'https://www.test.com', this is not mandatory since the scraper checks if the protocol is needed.Get iframe:~~~~~~~~~~~.. code:: pythonresult = test.get_scraped_data('https://www.youtube.com/watch?v=dQw4w9WgXcQ')output:~~~~~~~.. code:: javascript{description: 'Rick Astley - Never Gonna Give You Up (Official Music Video) - Listen On Spotify: http://smarturl.it/AstleySpotify Download Rick\'s Number 1 album "50" - http...',title: 'Rick Astley - Never Gonna Give You Up',url: 'https://www.youtube.com/watch?v=dQw4w9WgXcQ',image: 'https://i.ytimg.com/vi/dQw4w9WgXcQ/maxresdefault.jpg',source: 'www.youtube.com',iframe: '<iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ" height="720" width="1280"></iframe>'}This is on `GitHub <https://github.com/ROZ32/pythonScraper>`__ so let meknow if I've broked it somewhere.Stuff used to make this:~~~~~~~~~~~~~~~~~~~~~~~~-  `beautifulsoup4 <https://github.com/getanewsletter/BeautifulSoup4>`__for Markdown language parsing-  `html5lib <https://github.com/html5lib/html5lib-python>`__ for theawesome html5 parser
Package: simple-sds011
simple-sds011A minimal library for reading samples from a Nova Fitness SDS011 particulate sensor.In a nutshell>>> import simple_sds011
>>> pm = simple_sds011.SDS011('/dev/ttyUSB0')
>>> pm.mode = simple_sds011.MODE_PASSIVE
>>> pm.period
{'type': 'period', 'value': 0, 'id': b'\xcb\xc2', 'checksum': True}
>>> pm.query()
{'type': 'sample', 'value': {'pm2.5': 8.5, 'pm10.0': 12.4}, 'id': b'\xcb\xc2', 'checksum': True}Quick helpWritable propertiesSDS011.active: Whether the device fan and laser are powered (1) or not (0).SDS011.mode: Continuous (0) or passive (1) sampling. In continuous mode, the device sends sample data once a second or once asample period. In passive mode, the device only sends sample data when queried.SDS011.period: The period between air samples. Can be 0 or any value between 1 and 30. The device will sleep for N * 60 - 30 seconds, then take a single sample at the end of a 30-second warm up.Read-only propertiesSDS011.device_id: A two-byte identifier unique to the sensor.SDS011.firmware: The device firmware identifier.SDS011.port: The open serial port the device is attached to.CommandsSDS011.query(): Get a dictionary containing the current pm2.5 and pm10.0 levels as read by the sensor.Caveats/to-doObviously unfinished and delicate. Most useful in the interactive shell for casual readings.Properties are not stored in the instance, but queried to the device. If the device is not active at that moment, an exception is returned. This includes the sleep phase when period != 0.The continuous-report mode is not yet supported—only single queries.The port and ID cannot be changed.
Package: simplesecretsmanager
A Simple Secrets Manager for pythonInstalling:pip3installsimplesecretsmanagerHow to use:Storingfromsimplesecretsmanagerimportmanagersecrets_manager=manager.SecretsManager("password","file.bin")secrets["MY_SECRET"]="the_secret"...secrets_manager.update_secrets(secrets)secrets_manager.update_secret("ANOTHER_SECRET","the_other_secret")secrets_manager.save()There are 2 additional options when creating your SecretsManager, you can pass a non-default algorithm (defautls to Pbkdf2Algorithm):fromsimplesecretsmanagerimportmanager,utilityalgorithm=utility.Argon2Algorithm()secrets_manager=manager.SecretsManager("password","file.bin",algorithm=algorithm)You can also choose to not have the password saved in memory:fromsimplesecretsmanagerimportmanagersecrets_manager=manager.SecretsManager("password","file.bin",save_password=False)secrets_manager.update_secret("MY_SECRET","the_secret")# Must give password when saving if save_password = False, throws SecretsError otherwisesecrets_manager.save("password")Note: when giving a password to save(), this will be used to encrypt the file, in place of whatever was orinally storedRetrievingfromsimplesecretsmanagerimportmanagersecrets_manager=manager.SecretsManager("password","file.bin")try:my_secret=secrets_manager.get_secret("MY_SECRET")exceptSecretsErrorase:print("Issue retrieving 'MY_SECRET':{e}")By default, it will throw an error SecretsError if the secret does not exist. If you instead pass a default value, you'll be able to get that returned no matter what.You can also use the secret manager with the 'with' clause so that it auto saves after:withsecrets_manager:secrets_manager.update_secret("MY_SECRET","newvalue")and then upon exiting, newvalue will be saved into "MY_SECRET"Note: This won't work and will throw an error if used when save_password is false, since we won't be able to save the value when we get thereProvided under MIT License
Package: simple-ses-mailer
simple-ses-mailerSimple Python mailer for AWS SESInstallationpip install simple-ses-mailerExample Usagefromsimple_ses_mailer.mailersimportSesEmailMessagemsg=SesEmailMessage(subject='Test Subject',body_html='<span>Test Body</span>',mail_from='d@verbin.dev',mail_to=['test@example.com'])msg.send()More informative readme will be pushed later
Package: simpleset
[Documentation|Cheatsheet|Changelog]Disclaimer!tl;dr — Expect breaking changes in the future, and pin the version you use to protect yourself.This package is very new and has only been used by me as far as I know.When others start using it in different contexts, providing useful feedback on the quality of the API, and guiding its evolution to a mature 1.0 release, I will then offer API stability guarantees and adhere to SemVer.In the meantime, I see no harm in using it in production given how simple it is.  However,please make sure to pin your package dependency to an exact versionso your code doesn't break if and when I decide to change something.SynopsisI dislike PythonEnums.  They behave strangely and are difficult to build on top of or extend.  This package provides a Python class namedConstantwhich facilitates the creation and usage of enumerated values.  This plain old Python class is both simpler to understand and more powerful/flexible then native enums.Even a Python beginner should be able to understandmostof the source code.  The exceptions are discussed in thedocs.PreviewfromsimplesetimportConstant# simplest formColor=Constant.define_set("Color","RED","GREEN","BLUE")Color.RED=="RED"# -> True  (equality to strings)Color.RED.cname# -> "RED"Color.all# -> [ Color.RED, Color.GREEN, Color.BLUE ]Color.max_length# -> 5  (useful for a VARCHAR db column)# more complexColor=Constant.define_set("Color",RED=dict(hex="ff0000",like=True),GREEN=dict(hex="00ff00",like=True),BLUE=dict(hex="0000ff",like=False),)Color.RED.hex# -> "ff0000"Color.select(like=True)# -> [ Color.RED, Color.GREEN ]Color.get(like=False)# -> Color.BLUELearn more.Historical Note:  This package was originally namedpy-objects.
Package: simplesettings-py
simplesettings-pyPython settings files done simple.Simple docssimplesettings.clear()Clears the settings filesimplesettings.save()Saves a variable to the settings file, example:importsimplesettings_pyassettingssettings.save("Data",123)settings.save("MoreData","real")settings.save("MoreMoreData",{"You can save":"a dictionary!"},table="dictionaries")settings.save("EvenMoreMoreData",("A","B","C"),table="tuples")Outputted settings file (by default .settings):(main)
Data = 123
MoreData = real

(dictionaries)
MoreMoreData = {'You can save': 'a dictionary!'}

(tuples)
EvenMoreMoreData = ('A', 'B', 'C')simplesettings.save_dict()Saves an entire dictionary to the settings file in simplesettings format, example:importsimplesettings_pyassettingsa_dictionary={"Data":123,"MoreData":"One Two Three","MoreMoreData":{"You can save":"a dictionary!"},"EvenMoreMoreData":("A","B","C")}settings.save_dict(a_dictionary,table="saved_dict")Outputted settings file:(saved_dict)
Data = 123
MoreData = One Two Three
MoreMoreData = {'You can save': 'a dictionary!'}
EvenMoreMoreData = ('A', 'B', 'C')simplesettings.load()Loads the settings file into a dictionary; example:importsimplesettings_pyassettingsprint(settings.load())Output:{'saved_dict': {'Data': 123, 'MoreData': 'One Two Three', 'MoreMoreData': {'You can save': 'a dictionary!'}, 'EvenMoreMoreData': ('A', 'B', 'C')}}You can use this to get certain values, example:importsimplesettings_pyassettingssettings=settings.load()print(settings["saved_dict"]["Data"])Output:123simplesettings.loads()The same assimplesettings.load()but takes a simplesettings string as an argument, example:importsimplesettings_pyassettingsprint(settings.loads("""(main)Data = 123MoreData = real(dictionaries)MoreMoreData = {'You can save': 'a dictionary!'}(tuples)EvenMoreMoreData = ('A', 'B', 'C')"""))Output:{'main': {'Data': 123, 'MoreData': 'real'}, 'dictionaries': {'MoreMoreData': {'You can save': 'a dictionary!'}}, 'tuples': {'EvenMoreMoreData': ('A',  'B', 'C')}}Note that theload()andloads()functions will automatically convert strings of integers, floats, booleans, tuples, lists and dictionaries to the right type, don't forget to convert them back to the type you want (which you should be doing anyway x))Please feel free to create a pull request if you encounter any issues or something that could be improved
Package: simpleshare
simpleshareA local file sharing utility written in Python. Uses multicast UDP to share the list of files, and TCP to transfer the files themselves.Installation:Source:Install Python 3$ git clone https://github.com/ssebs/simpleshare
$ cd simpleshare/
$ python -m venv venvLinux:$ source ./venv/bin/activateWindows:> .\venv\Scripts\activate(venv) $ pip install -r requirements.txtBinary:Download a binary for your platform in thereleases page.PyPI:$ pip install simpleshare$ simpleshareUsage:CLIusage: simpleshare.py [-h] [--type {client,server}] [--ip IP] [FILENAME]

Local file sharing utility. Can be used as server and as a client. Run this
without any arguments to run GUI.

positional arguments:
  FILENAME              Name of the file you want to share, if running as the
                        server.

optional arguments:
  -h, --help            show this help message and exit
  --type {client,server}
                        Type, how do you want to use this tool
  --ip IP               IP address, only used if you're the serverGUIDouble click the exe / binary.BuildingLinux:$ makeWindows:> .\Makefile.bat(venv) $ pyinstaller simpleshare/__main__.py --clean -F -n simpleshareScreenshotsHomeUploadDownloadTODO:Structure program3 connectionsServer: Share filename (Multicast)Client: Reply to server saying that you want the file (UDP)Server: Send file to client (TCP)CLIGUIServer"Broadcast" (multicast) that you're sharing "x" fileHave server send files if requested to IP found.CLIGUIDnDCustom timoutClientListen to see if anyone is sharing filesList available filesDownload files to specified file name/pathCLIGUIMake this work with 1 file, 1 clientMake this work with 1 file, 2 clientsMake this work with 2 files (2 servers), 1 clientMake this work with 2 files (2 servers), 2 clientBinary output (.exe, .app, etc.)Icon supportRefactor + documentUnit TestsBugs:Threads won't stop properlyCan't have 2 clientsCan't have 2 serversGUIStylingOnly Choose IP if more than 1 availableShare Thread issuesLicenseMIT© 2019 Sebastian Safari