Saravanan666/pypi-org huggingface dataset:
Package: simple-sharepoint
Simple way to handle sharepoint with python.
Provides the ability to upload files and directories.Installationinstall the latest stable version usingpip$pipinstallsimple-sharepointUsagefromsimple_sharepoint.clientimportClientclient_id=<CLIENT_ID>client_secret=<CLIENT_SECRET>base_url=<BASEURL>c=Client(client_id,client_secret,base_url)See the link below for instructions on creatingCLIENT_IDandCLIENT_SECRETMake TokenBASE_URLrefers to the main URL of the sharepoint.( format ) https://<SHAREPOINT_DOMAIN>/sites/<SHAREPOINT_SITE>( ex )https://test.sharepoint.com/sites/testsiteFunctionsupload_fileA function that uploads a specific file to sharepoint.default_path=<SHAREPOINT_BASE_PATH>src=<LOCAL_FILE_PATH>dst=default_path+<SHAREPOINT_TARGET_PATH>upload_file(src,dst)SHAREPOINT_BASE_PATHrefers to the default path for a sharepoint document entry.( format ) /sites/<SHAREPOINT_SITE>/Shared Documents( ex )/sites/testsite/Shared DocumentsLOCAL_FILE_PATHmeans the path to the file to be uploaded.( ex )/home/ubuntu/test.txtSHAREPOINT_TARGET_PATHmeans the actual path to be uploaded to sharepoint.Think of the document menu in sharepoint as the root directory and enter the path thereafter.You do not need to include the file name.( ex )excel/exampleIf you run it as above, it will be uploaded as below./sites/testsite/Shared Documents/excel/example/test.txtupload_dirA function that uploads a particular directory and all its contents under the directory to sharepoint.default_path=<SHAREPOINT_BASE_PATH>src=<LOCAL_DIR_PATH>dst=default_path+<SHAREPOINT_TARGET_PATH>upload_dir(src,dst)SHAREPOINT_BASE_PATH,SHAREPIONT_TARGET_PATHSee item upload_fileLOCAL_DIR_PATHmeans the path to the directory to be uploaded.( ex )/home/ubuntu/filesdownload_fileA function that downloads a specific file from the sharepoint.default_path=<SHAREPOINT_BASE_PATH>src=default_path+<SHAREPOINT_TARGET_PATH>dst=<LOCAL_FILE_PATH>download_file(src,dst)SHAREPOINT_BASE_PATH,SHAREPIONT_TARGET_PATHSee item upload_fileThe download_file function requires you to specify the file name to be stored inLOCAL_FILE_PATH.
( ex )/home/ubuntu/files/test.txtdownload_dirA function that downloads a particular directory in the sharepoint and all the contents under it.default_path=<SHAREPOINT_BASE_PATH>src=default_path+<SHAREPOINT_TARGET_PATH>dst=<LOCAL_DIR_PATH>download_dir(src,dst)SHAREPOINT_BASE_PATH,SHAREPIONT_TARGET_PATH,LOCAL_DIR_PATHSee item upload_dirlist_dirA function that listing a particular directory in the sharepoint and all the contents under it.default_path=<SHAREPOINT_BASE_PATH>src=default_path+<SHAREPOINT_TARGET_PATH>list_dir(src)SHAREPOINT_BASE_PATH,SHAREPIONT_TARGET_PATHSee item upload_dirThird Party Libraries and DependenciesOffice365-REST-Python-Client
Package: simplesheetsapi
Простой фреймворк для работы с api google spreadsheetsПеред использованием:зайти наhttps://developers.google.com/sheets/api/quickstart/python#enable_the_apiи выполнить инструкции по получению credentials.jsoncredentials.json должен находиться в одной папке с программойУстановкаpip install simplesheetsapiРабота с фреймворкомИнициализация:sheet=SheetsApiTry("id_таблицы",os.getcwd())Получение содержимого ячейки:print(sheet.get_cell("колонка","строка","название_листа")Установка содержимого ячеек:sheet.update_cell("ячейка_начала:ячейка_конца","название_листа",[[значения_строки_1,...],[значения_строки_2,...]])Поиск строк по значению в каких-то её ячейках:print(sheet.find_rows("поисковое_значение","название_листа"))По вопросам можно писать:ВконтактеТелеграмм: TherealkrokoКод можно посмотреть нажавсюда
Package: simplesim
simplesimpackageThis package is a simple and general framework for creating a simulation
environment.simplesimuses the observer design pattern that allows arbitrary
objects to be included into the simulation. At each update,simplesimnotifies
the observers of the new simulation time. The observers can do what they want
with that information.simplesimis designed to easily be extended. The only requirement is that
custom objects must implement the observer interface defined in the package.
Package: simplesimplestreams
Simple SimpleStreamsA simple client for LXD SimpleStreams, port of lxc/lxd/shared/simplesreams.go🚧 Under Development 🚧Only a few APIs are implementedUsagefromsimplesimplestreamsimportSimpleStreamsClientclient=SimpleStreamsClient(url="https://images.linuxcontainers.org")images=client.list_images()DevelopmentInstall dependencies with poetry:poetry installRun type check:poetry run mypy . --strictRun tests:poetry run pytestFormat code:poetry run black .LicenseApache-2.0
Package: simplesingletable
Simple Single TableLatest Version:3.0.0simplesingletableis a Python library that offers an abstraction layer for AWS DynamoDB operations, particularly for
those tables using single-table design. It uses Pydantic to define the models, and tries to be as "batteries-included"
based on how I personally have come to use DynamoDb.I've used and written variations of this same code many times, and finally decided to try and package it all up into a
single library I could pip install and use whenever I needed cheap, easy, fast storage with few access patterns. So far
this is working quite well for the way I use DynamoDb and the assumptions that are true for me, such as:My apps are generally pretty small scale -- a few hundred users at a time maxMy collection sizes are pretty small -- tens or hundreds of thousands, not millions or billionsIn this scenario I've found DynamoDb to be an extremely valuable tool that can perform extremely fast and consistently,
and essentially for free or very little cost. I believe most of these tools and techniques would scale beyond that,
but cannot personally attest to it.Key FeaturesThere are many ways to use DynamoDb. These are the things I've come to want:A single table where I can store different types of Objects (Pydantic Models)Automatic resource ID creation using a lexicographically sortable ID (viaulid-py); this is very useful for setting
up alternative access patterns using the secondary indices and having them sort by creation date of the objects.Simple way to list, paginate, and filter by object type, sortable by last updated time, seamlessly blending DynamoDb
filter expressions and server side filtering on the loaded Pydantic models using simple python functionsAutomatic versioning for created resources -- every update generates a new version, and the complete version history
is maintained and easily accessed; additionally the code prevents simultaneous writes from the same version; updates
can only be performed from the latest version of an object.Powerful query function for enabling secondary access patterns using GSIs as neededInstallation:pipinstallsimplesingletableUsageDocs, examples, and access patterns coming soon!Here's a brief demo of how to utilize:# How to Use:# 1. Define a Resource:# Resources are essentially DynamoDB items. They can be defined by subclassing `DynamodbVersionedResource`:fromsimplesingletableimportDynamodbVersionedResource,DynamoDBMemoryclassMyTestResource(DynamodbVersionedResource):some_field:strbool_field:boollist_of_things:list[str|int|bool|float]# 2. CRUD Operationsfromlogzeroimportloggerdynamodb_memory=DynamoDBMemory(logger=logger,table_name="my-dynamodb-table")resource=dynamodb_memory.create_new(MyTestResource,{})retrieved=dynamodb_memory.read_existing(resource.resource_id,MyTestResource)updated_resource=dynamodb_memory.update_existing(retrieved,{})More coming soon...Testing:The package includes a comprehensive test suite to ensure reliability and robustness. Use the test_simplesingletable.py
as a reference for the functionalities available until more documentation is available.
Package: simple-singleton
Simple Python Singleton patternThis module provides a simple way to define a class as a singleton.InstallYou can install this python module viapip:pipinstallsimple-singletonOtherwise the module can be downloaded from PyPI:https://pypi.org/project/simple-singleton/UsageImport the module:fromsimple_signletonimportSingletonor:fromsimple_signletonimportSingletonArgsCreate a class that uses one of the above meta classes:classNewClass(metaclass=Singleton):passor:classNewClass(metaclass=SingletonArgs):passDifference betweenSingletonandSingletonArgsTheSingletonclass is a very basic implementation of the singleton pattern. All instances of a class are equal. Even if they are initialized with different parameters:instance1=SingletonClass(param="value")instance2=SingletonClass(param="different_value")assertinstance1==instance2# Trueprint(instance2.param)# "value"If you do not want this behavior, use theSingletonArgsmeta class. With this class only instances that are initialized with the same parameters are the equal:instance1=SingletonArgsClass(param="value")instance2=SingletonArgsClass(param="different_value")instance3=SingletonArgsClass(param="value")assertinstance1==instance2# Falseassertinstance1==instance3# Trueprint(instance2.param)# "different_value"Usage in multi-threaded environmentsTheSingletonandSingletonArgsmeta classes are not thread-safe!To use them in a multi-threaded environment, please use theThreadSingletonandThreadSingletonArgsmeta classes. They can be used exactly like the standard meta classes.
Package: simple-site-crawler
Simple website crawler that asynchronously crawls a website and all
subpages that it can find, along with static content that they rely on.
You can either use it as a library, inside your Python project or check
out the provided CLI that can currently show you the crawled data
(links, images, CSS and Javascript files) for each found site and create
asitemap.xmlfile.Created primarily to play withasyncio,aiohttpand the newasync/awaitsyntax, so:it requires Python 3.5 or highernew features are not planned at the moment; feel free to suggest them
though, as I’m happy to implement them if someone will actually use
them ; -)Full disclosure - halfway through the project I foundthisarticle (and code) which does pretty much exactly what I wanted and is
co-written by the BDFL himself. Oh well. I still finished the project
and didn’t copy anything explicitly but it did influence some of my
choices. After all, if it’s good enough for the creator of the language
I’m using, it’s probably good enough for me.Installation>From PyPI:$ pip3 install simple-site-crawlerWith git clone:$ git clone https://github.com/pawelad/simple-site-crawler
$ pip3 install -r simple-site-crawler/requirements.txt
$ cd simple-site-crawler/binUsage$ simple-site-crawler --help
Usage: simple-site-crawler [OPTIONS] URL

  Simple website crawler that generates its sitemap and can either print it
  (and its static content) or export it to standard XML format.

  See https://github.com/pawelad/simple-site-crawler for more info.

Options:
  -t, --max-tasks INTEGER  Maximum allowed number of async tasks.
  -e, --export-to-xml      Export sitemap to XML file.
  -s, --suppress           Suppress printing output to stdout.
  --help                   Show this message and exit.APIThere’s no proper documentation as of now, but the code is commented andshouldbe pretty straightforward to use.That said - feel free to ask me either viaemailorGitHub
issuesif
anything is unclear.TestsPackage was tested with the help ofpy.testandtoxon Python
3.5 and 3.6 (seetox.ini).Code coverage is available atCoveralls.To run tests yourself you need to runtoxinside the repository:$pipinstall-rrequirements/dev.txt$toxContributionsPackage source code is available atGitHub.Feel free to use, ask, fork, star, report bugs, fix them, suggest
enhancements, add functionality and point out any mistakes. Thanks!AuthorsDeveloped and maintained byPaweł
Adamczak.Released underMIT
License.
Package: simple-site-manager
# simple-site-managerThis creates configuration files for lighttpd and django fcgi, based on a simple list of sites.Templates are used for the output files so they can easily be modified and customised for your own sites.You can either use a global config file or individual files for each project.The project is in the early stages, barely tested. More to come. Born from the frustration I felt every time I wanted to delpoy a new python driven site...# InstallInstall from pypi:```shpip install simple-site-manager```# Configure## Example site list```yamlsite1:domain_name: example.com# optional argumentsredirect_from_domains: ['www.example.com']project_root_dir: /opt/django/site1/,django_root_dir: /opt/django/site1/site1/,fcgi_path: /opt/django/site1/site1/siteman-fcgi.py,uploaded_dir: /opt/static/site1_uploaded/,static_dir: /opt/static/site1/,www_uploaded_path: /uploaded/,www_static_path: /m/,redirect_to_https: false,virtual_env_dir: /opt/django/site1/env-site1/,settings_module: site1.settingsmax_procs: 3```### DefaultsThe paths in the example above are the defaults if nothing is specified in the config file.In a future versions you will be able to set your defaults yourself.Here are some defaults:```root of your project:                        /opt/django/sitename/fcgi file path (where manage.py is located): /opt/django/sitename/sitename/static files:                                /opt/static/sitename/static uploaded files:                       /opt/static/sitename_uploaded/settings file:                               /opt/django/sitename/sitename/sitename/settings.pysettings module:                             sitename.settingsvirtualenv path:                             /opt/django/sitename/env-sitename/```# Usage```shsiteman config_file.yaml```You will need to run it as root to write lighttpd configuration, feel free to use `--print` to preview the output files.For additional usage options, just run `siteman -h`# TODO- More fine tuning of site performance settings.- Store site fcgi config in /etc/siteman instead of each project's directory- Store lighttpd conf files in /etc/siteman as well?
Package: simpleSketch
Simple Sketch (Program Synthesis by Sketching)This project is a part of the course 236347 Software Synthesis and Automated Reasoning (SSAR) at the Technion.DescriptionThe goal of software synthesis is to generate programs automatically from specifications.
In Sketching, insight is communicated through a partial program, a sketch that
expresses the high-level structure of an implementation but leaves holes in place of the low-level details.Simple Sketch can Synthesis a program based on a set of input and output examples, or by adding assertions to the program.Simple Sketch uses counterexample guided inductive synthesis procedure (CEGIS) to synthesize a program.Look at the examples section in the GUI to see how to use the program.Note:This project is still under development. Check updates regularly at theSimpleSketch repositoryIMPORTANT:The tests (under/tests) still fail, because the tests are not updated to the new version of the program (the new parser)
The tests will be updated soon. In the meantime, you can use the examples in the GUI to test the program.Examplei := ??;
y := i*i + x * ??;
assert (y == x + x + 9);The above program is a simple example of a program synthesis problem.
The goal is to find a program that satisfies the specification.After running the program, the output is:i := 3;
y := i*i + x * 2;
assert (y == x + x + 9);InstallationBuild from sourcegit clone https://github.com/maher-bisan/SimpleSketch.git
cd simple_sketch
python3.11 -m venv .venv
source .venv/bin/activate
pip install .On windows, run the following command instead:python -m venv .venv
.venv\Scripts\activate
pip install .Install from PyPIpip install simpleSketchDocumentationUnder construction. In the meantime, you can read the docstrings in the code.Grammarwhile_langgrammarstart: statements

statements: statement | statements statement

statement: "skip" ";" | declaration | assignment | "if" "(" expr ")" "{" statements "}" 
| "if" "(" expr ")" "{" statements "}"  "else" "{" statements "}" | "while" "(" expr ")" "{" statements "}" | "assert" "(" expr ")" ";" | "assume" "(" expr ")" ";"

declaration: type id ";" | type id = expr ";" | array_type id ";" | array_type id = id ";"

assignment: id = expr ";" | id [ expr ] = expr ";"

array_type: "Array" type

type: "int" | "float" | "bool"

expr: expr "and" expr | expr "or" expr | "not" expr 
| expr "==" expr | expr "!=" expr | expr "<" expr | expr ">" expr | expr "<=" expr | expr ">=" expr
| expr "+" expr | expr "-" expr | expr "*" expr | expr "/" expr | expr "**" expr
| atom

atom: "(" expr ")" | id | hole | id "[" expr "]" | int | float | bool

hole: "??" | "int?" | "bool?" | "float?"

bool : "True" | "False"UsageOpen the GUIIn the terminal, run the following command:If you installed from PyPIsimpleSketch-guiIf you built from sourcepython3.11 src/simple_sketch/simple_sketch_gui/simple_sketch_gui.pyExamplesAfter opening the GUI, you can select an example from the dropdown menu, at the sidebar.Run a programTo run a program, click the "Run" button.
Click the "Clear" button to clear the entire text areas.
Package: simple-slackbot
slackbotA simple python wrapper for theSlackapiRequirementsSlackClientInstallationpip install simple-slackbotUsageGenerate a slack api tokenFirst you need to get the slack api token for your bot. You can create a bot on theslack websiteand manage permissions.Instantiate a SlackBotfrom slackbot import SlackBot

slackbot = SlackBot()By default, the SlackBot retrieved the slack token from environment variableSLACK_API_TOKEN.
You can overwrite the default behaviour by instantiating with thetokenargument.If running it in a Jupyter notebook, instantiate withrun_async=True.Send a messageYou can send messages to any channel (using the channel name or id), or any user (just setchannel=@<username>)slackbot.send_message(channel='#general', message='Hello!')Send a fileYou can also send files over slack, to any channel or user.slackbot.send_file(channel='#general', file='<filepath>', message='Check out this file!')More using the slack api directlyYou can access methods from the raw slack client to use them directly.slackbot.client.chat_postMessage(...)
Package: simple-slack-logger
Simple logging with SlackIt helps you to receive all logs from your Python code in Slack channels
usingwebhooks.Install from PyPi:pip install simple-slack-loggeror from repository:pip install git+https://github.com/gixproject/simple-slack-loggerUsageExplicit usageimportloggingfromslack_loggerimportSlackHandlerlogger=logging.getLogger(__name__)handler=SlackHandler(webhook="<YOUR_WEBHOOK>")logger.addHandler(handler)logger.error("Something bad happened")Logging config"handlers":{"slack":{"class":"slack_logger.SlackHandler","formatter":"default","level":"WARNING","webhook":"<YOUR_WEBHOOK>",},}HintTo catch all exceptions from your Python code you can use this in the main module:deflogging_except_hook(exc_type,exc_value,exc_traceback):logging.error("Uncaught exception",exc_info=(exc_type,exc_value,exc_traceback))sys.excepthook=logging_except_hook
Package: simple-slice-viewer
READMEOverviewA viewer to scroll through slices of 2D, 3D and 4D medical data sets
(CT, PET, MRI...)Supports files than can be read by SimpleITK:Nifti: .nii .nii.gz .nia .img .img.gz .hdrNrrd:  .nrrd .nhdrMeta Image: .mhd .mhaAnd probably some more types as long as they are supported by the SimpleITK
file reader.In addition there is support for reading folders with dicom data.
Sorting dicom data into 3D volume is tricky and may depend on modality, vendor
and model of the imaging device. Basic support is offered that works well with
CT, PET and MRI. For Siemens PET the PET data is read in SUV.A second image can be loaded and is displayed as fusion on top of the first.
Works well with PET/CT and PET/MRI data.##Usagepip install simple-slice-viewerCommand Linesimple-slice-viewer
simple-slice-viewer ct.nii
simple-slice-viewer ct.nii --fusion pet.niior use ssv as shorthand:
ssv
ssv ct.nii
ssv ct.nii --fusion pet.nii
ssv --image ct.nii --fusion pet.niiInside PythonIn Python images should be read to SimpleITK Image objects first.import simple_slice_viewer as ssv
import SimpleITK as sikt

image = sitk.ReadImage('ct.nii')
fusion = sitk.ReadImage('pet.nii')

ssv.display(image=image, fusion=fusion)To display a numpy array convert it to SimpleITK firstimport SimpleITK as sitk
import simple_slice_viewer as ssv
image = sitk.GetImageFromArray(np_array)
ssv.display(image)
Package: simple-slurm-command
Simple Slurm CommandA simple Python wrapper for Slurm with flexibility in mindThis is a fork ofamq92/simple_slurm.
If you are interested in using this repository, I would strongly encourage you to check out the original version first.The only difference is that this version only produces a slurm command, whereas the original simple_slurm produces andexecute the commandassuming that slurm is available on the host machine it runs on.
Package: simplesmtp
A very simple class to send e-mails using the Python SMTP standard lib.UsagefromsimplesmtpimportSimpleSMTPmail=SimpleSMTP(host='mail.host',username='user@mail.host',passw='password',from_email='You <youremail@mail.host>')mail.send(to_email='email@example.com',subject='Hello',email_message='World')# Changing default from_emailmail.send(from_email='Another From <email@example.com>',to_email='email@example.com',subject='Hello',email_message='World')# Sending to more than one recipientmail.send(to_email='email1@example.com, email2@example.com',subject='Hello',email_message='World')# Attachmentsmail.send(to_email='email1@example.com, email2@example.com',subject='Hello',email_message='World',attachments=[{'file':'/path/to/real/file','filename':'the name that you want'}])Using SSLfromsimplesmtpimportSimpleSMTPmail=SimpleSMTP(host='mail.host',username='user@mail.host',passw='password',from_email='You <youremail@mail.host>',port=465,use_ssl=True)mail.send(to_email='email@example.com',subject='Hello',email_message='World')HTML messagesfromsimplesmtpimportSimpleSMTPmail=SimpleSMTP(host='mail.host',username='user@mail.host',passw='password',from_email='You <youremail@mail.host>')mail.send(to_email='email@example.com',subject='Hello',email_message='<html> HTML source with optional embedded images ... </html>',msg_type='html')
Package: simple-snmp-collector
Setup using dockerUp and build docker container:docker-composeup--build-dWithout docker:Install requirements:pipinstall-rrequirements.txtRun by downloading or cloning the repository:python__main__.pyConfig your desire OID(s) and metrics:nanoconfig/cofig.jsonSetup throughpippipinstallsimple-snmp-collectorpyserialeasydictpysnmp==4.4.9async-timeoutuvloopConfigurationCreate a json config file with the following format:[
  {
    "isEnable": true,
    "name": "snmp-model-1",
    "address": "192.168.1.120",
    "port": 161,
    "timeout": 1,
    "retries": 3,
    "version": 2,
    "sleep_time": 5,
    "community": "public",
    "metrics": [
      {
        "isEnable": true,
        "tag_name": "a-sample",
        "oid": "1.3.6.13.4.1.3.1112"
      }
    ],
    "meta_data": [{'key': 'value'}]
  }
]Runpython-msnmp_collector--config=<path-to-your-config-file.json>[NOTE]:If you are a Windows user and you don’t want to use docker, comment out theuvlooppackage formrequirements.txtThe value of-8555means a problem is occurred during reading data over SNMP or in connection.
Package: simplesoc
simplesocsimplesoc is a simple Python library for attaching Standard Occupation Classification (SOC) codes toInstallationUse the package managerpipto install simplesoc.pipinstallsimplesocUsagefromsimplesocimportfind_soc_codesoc_code_predictions=find_soc_code('Softwear Enginer',year='US.2018',n_socs=3)