Saravanan666/pypi-org huggingface dataset:
Package: simplesqlitewrap
Simple class that wraps around thesqlite3.conn().cursor().execute()methodfromsimplesqlitewrapimportDatabaseclassDbWrapper(Database):defcreate_tables(self):self._execute('CREATE TABLE IF NOT EXISTS Users (user_id INTEGER PRIMARY KEY, first_name NVARCHAR);')definsert_users(self,users,**kwargs):returnself._execute('INSERT OR IGNORE INTO Users (user_id, first_name) VALUES (?, ?)',users,many=True,**kwargs)defselect_users(self,**kwargs):# returns the list of all the records in 'Users'returnself._execute('SELECT * FROM Users',fetchall=True,**kwargs)db=DbWrapper('database.sqlite')print(db)db.create_tables()params=[(1,'Bob'),(2,'Charlie')]rows_inserted=db.insert_users(params,rowcount=True)print('Rows inserted:',rows_inserted)users=db.select_users(as_namedtuple=True)foruserinusers:print('ID:',user.user_id,'first name:',user.first_name)Installationpip install simplesqlitewrapDisclaimerIf you stumbled upon this package, please remember that this is just a small utility I made for myself - breaking changes may be introduced without notice. Also, my first pypi package - will probably use it for tests and sheningans.
Package: simple-sqs-client
Very Sipmle SQS ClientRequirementsPython 3+Installingpip install simple-sqs-clientUsageSQSClientBuilderYou can use SQSClientBuilder which is more flexible approach and allows you to fill the connection parameters in different moment of code execution if necessary.
Just keep the variable holding the builder in the scopewith SQSClientBuilder() \
            .with_region(AWS_SQS_REGION) \
            .with_queue_url(AWS_SQS_QUEUE_REACT_URL) \
            .with_aws_credentials(
        aws_access_key_id=AWS_SQS_ACCESS_KEY_ID,
        aws_secret_access_key=AWS_SQS_SECRET_ACCESS_KEY
    ).build() as sqs_client:
    event = {message: "hello world"}
    sqs_client.send_message(body=json_util.dumps(event))DirectYou can also create Client using its constructorSQSClient(region_name, aws_access_key_id, aws_secret_access_key, queue_url)
Package: simplesrs
simplesrsSimple SRS (spaced-recognition system) mechanism and database. Scalable and zero configuration.Usage>>>importsimplesrsassrs>>>srs.init('srs.db')>>>srs.Card.add('类',tags=['hanzi','t_hanzi1'],vocabs=['人类 人類 [ren2 lei4] humanity/human race/mankind'])>>>srs.Card.add('数学',tags=['vocab','pleco'])>>>srs.Card.add('重要的事情要立即去做',tags=['sentence','t_hanzi1'],translation='重要的事情要立即去做。 [Zhòngyào de shìqing yào lìjí qù zuò. (Also no qu (less strong))] I need to go do important things immediately.')>>>quiz=srs.Card.iter_quiz()>>>card=next(quiz)>>>card重要的事情要立即去做>>>card.info{'translation':'重要的事情要立即去做。 [Zhòngyào de shìqing yào lìjí qù zuò. (Also no qu (less ''strong))] I need to go do important things immediately.'}>>>card.right()# Mark as right, and next review by now() + srs_level's timedelta()>>>card.undo()# Undo marking as right.>>>card.wrong()# Mark as wrong, and bury for default: 10 minutes.>>>card.undo()>>>card.bury()# Bury for default: 4 hoursInstallationpip install simplesrsRelated projectsankix-- New file format for Anki with improved review intervals. Pure peewee SQLite database, no zipfile, but media enabled. Available to work with on Jupyter Notebook. Full dropin replacement for Anki.
Package: simplestapi
SimpleAPISimpleAPI is a minimalistic, unopinionated web framework for Python, inspired by FastAPI & Flask.SimpleAPI is a WSGI compliant framework.This is a hobby project made for educational purposes because I want to try learning writing a web server framework.So, this is obviously not meant for production environments.Development of SimpleAPI is tracked atthisGitHub project.Installationpip install simplestapiUsageAn example of using SimpleAPI:Copy the following code to a file calledapp.pyfromsimpleapiimportSimpleAPIapp=SimpleAPI()@app.get("/hello")defhello():return"Hello, world!"Run it withgunicorn app:appMore examples can be found intestsDocumentationhttps://adhamsalama.github.io/simpleapi
Package: simple-starlette
Simple-Starlettepython微服务框架:高性能 : asyncio + Uvicorn 高性能异步非阻塞io，事件循环，多路监听可读性 : 请求与视图解耦，视图与Service解耦，文档与业务解耦开发耗时: 多种基础工具和中间件，类似flask的开发体验安装使用1, 使用pip直接安装pipinstallsimple-starlette2, 源码安装gitclonehttps://github.com/mapyJJJ/simple-starlette.gitcdsimple-starlette
python3setup.pyinstallhello world:fromsimple_starlette.argsimportQueryParamsfromsimple_starletteimportSimpleStarlette,Requestfromsimple_starlette.responsesimportResponse,ResTypeEnumapp=SimpleStarlette(__name__)@app.route("/test")classIndex:classSomeQuery(QueryParams):arg1:intarg2:intasyncdefget(self,request:Request,q:SomeQuery):# 定义一个get请求returnResponse({"arg1":q.arg1,"arg2":q.arg2},ResTypeEnum.JSON)# 构造返回json字符串if__name__=="__main__":app.run()# 测试请求# curl http://localhost:9091/test?arg1=hello&arg2=world# response:# {"arg1":"hello", "arg2":"world"}查看更多开发使用实例：example usageLICENSEGPL-3.0 License
Package: simplestat
simplestatVery minimal statistics module. Useful when you dont have the disk space for numpyOnly contains the following functions (and only for 1d arrays):
mean(q)
std(q,m=None)#can set m=mean(q) to save computation time
min(q)
argmin(q)
max(q)
argmax(q)
statinf(q)
return information about the object as dictionary
sstr(q)
statinf+json.dumps(indent=2)
sprint(q)
print(sstr())
Package: simple-stats
simple_statsA Python package ce containing methods for EDA, bootstrapping, and hypothesis testingFree software: MIT licenseDocumentation:https://simple-stats.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2020-04-07)First release on PyPI.
Package: simple-status-client
SimpleStatusClientA helper Client library in Python for the SimpleStatus projectGetting StartedEnsure you have pulledSimpleStatusServerand are running it (preferably straight from docker)pip installsimple_status_clientor clone librarySimpleStatusClientcd SimpleStatusClientpython -m pip install . _(this should be the python environment in which your stasus needing code runs)Within the code that you wish to send statuses do the followingfrom simple_status_client import Client, Colorsclient = APIClient("http://*server_ip*/api")server_ip should be the ip address of your docker containerclient.setConfig()--fill in paramsclient.setStatus()--fill in paramsVoila, you should be able to view your status on the dashboard.Example Usageclient.set_config("My Component","This is the thingamabob for our whatsamaahousit server", 0, Colors.yellow)<Response [200]>client.set_status("My Component",Colors.green,"All systems go")<Response [200]>Things to keep in mindComponents are identified by ID, which is calculated by hashing the name (or by calling the base functions and providing it directly e.g.APIClient.set_status_base).DUPLICATE NAMES OVERWRITE.This is by design, if you want to update your configuration and or status you can do it without jumping through any hoops.  Simply send a new configuration or status.  That being said if you have code in multiple places using the same id... they will be stepping on each otherThis library is provided as a convenience, the REST API is full accessible and you can write your own interface if you would like.I promise to keep this library up to date and working to the best of my ability.  Maybe I'll even write tests for it.
Package: simple-steganography
Steganography utilitySimple steganography command line utilityExplore the docs »Report Bug·Request FeatureTable of ContentsAbout The ProjectBuilt WithGetting StartedPrerequisitesInstallationUsageRoadmapContributingLicenseContactAbout The ProjectSimple utility used for image based steganography. Encryption method is least significant byte.(back to top)Built WithPythonOpenCvNumPy(back to top)Getting StartedTo setup this project follow these simple steps.PrerequisitesTo run this project you need copy of Python3npmsudoapt-getupdate
sudoapt-getinstallpython3.8InstallationClone the repogitclonehttps://github.com/karafra/steg-utility.gitInstall python packagespipinstall-rrequirements.txt(back to top)UsageCLI supports two modes (encode/decode).Encode:steganography-mdecode-ioutput.pngDecode:steganography-mencode-iinput.png-ooutput.png-p"Super secret message"For more examples, please refer to theDocumentation(back to top)RoadmapSee theopen issuesfor a full list of proposed features (and known issues).(back to top)ContributingContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make aregreatly appreciated.If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement".
Don't forget to give the project a star! Thanks again!Fork the ProjectCreate your Feature Branch (git checkout -b feature/AmazingFeature)Commit your Changes (git commit -m 'Add some AmazingFeature')Push to the Branch (git push origin feature/AmazingFeature)Open a Pull Request(back to top)LicenseDistributed under the Apache 2.0 License. SeeLICENSEfor more information.(back to top)ContactYour Name -@karafro-dariusKralovic@protonmail.comProject Link:https://github.com/karafra/steg-utility(back to top)
Package: simplestmaps
Simplest MapsSuper simple on-liner maps in python.Installationpip3 install simplestmapsUsageThis lib aims to be super simple to use. For instance, to draw a markers and an area, you could do something like this:fromsimplestmapsimportdraw_map,area,markerdraw_map(marker(-31.2526,-61.4917,popup="my hometown"),area([(-31.2741,-61.5105),(-31.2872,-61.5137),(-31.2895,-61.5003),(-31.2764,-61.4973)],color="green",popup="our airfield"),)It can even do more advanced stuff, like plotting the contents of a geojson file (points, areas, lines):fromsimplestmapsimportdraw_map,geojsondraw_map(geojson("./readme_example.geojson"),)SimplestMaps can plot markers, dots, labels (text), custom html, lines, areas and geojsons, and all of that can be combined in every map.And every element plotted into the map is also customizable (colors, fonts, sizes, popups, etc).More demos and docsHere are a good set of examples that showcase (and document) all of the supported features:Take a look at everything that's possible with so little code!
Package: simplestopwatch
simplestopwatch is a very simple Python module for measuring time.Great for finding out how long code takes to execute.>>> import simplestopwatch as sw>>> t = sw.Timer()>>> t.elapsed3.8274309635162354>>> print t15.9507198334 sec>>> t.stop()30.153270959854126>>> print t30.1532709599 secDecorator exists for printing out execution times:>>> from simplestopwatch import clockit>>> @clockitdef mult(a, b):return a * b>>> print mult(2, 6)mult in 1.38282775879e-05 sec6
Package: simple-storage
Simple StorageData storage made simple.Supported storagesFile systemAWS S3Google Cloud StorageRequirementsPython >= 3.6How to useInstall the package:pipinstallsimple-storageNow, depending on the storage you want to use, follow the instructions below.File system storageEnvironment variableValueSTORAGES_BACKENDstorages.backends.file_system.FileSystemStorageSTORAGES_PATHPoint to the existing path in your file system, e.g./app/media.AWS S3 storageEnvironment variableValueSTORAGES_BACKENDstorages.backends.amazon_s3.AmazonS3StorageSTORAGES_AWS_ACCESS_KEY_IDYour AWS access key ID.STORAGES_AWS_SECRET_ACCESS_KEYYour AWS secret access key.STORAGES_AWS_BUCKET_NAMEThe bucket name that you want to use.In case you encounter any problems with finding your AWS credentials please readthis pageas a reference.Google Cloud StorageEnvironment variableValueSTORAGES_BACKENDstorages.backends.google_cloud.GoogleCloudStorageSTORAGES_GOOGLE_CLOUD_CREDENTIALSYour Google Cloud Storage credentials in JSON encoded using Base64.STORAGES_GOOGLE_CLOUD_BUCKET_NAMEThe bucket name that you want to use.DocumentationThe documentation is hosted on the project'sGitHub Wiki.
Package: simple-storage-service
simple-storage-serviceThis package is intended to assist in the handling of files on storages from different providers.Currently, this project supports 3 providers: AWS, Azure and GCP.Getting startedInstallpipinstallstorage-serviceInitialize a storage providerfromsimple_storage_serviceimportSimpleStoragesimple_storage=SimpleStorage.initialize('GCP',{'bucket_name':'some-bucket'})simple_storage.get_object('some-key')simple_storage.upload_object('some-key','path/to/file.txt')ColaboratingRun testspython -m unittest discover testsDeployChange version on setup.pyRemove previous versionrm-rfdistBuild projectpython-mbuildUpload projectpython-mtwineuploaddist/*
Package: simplestr
simplestrA python package with annotations to automatically generate__str__(self),__repr__(self)and__eq__(self, other)methods in classesDescriptionThis package provides only two annotations:@gen_strto generate__str__(self)method@gen_reprto generate__repr__(self)method@gen_eqto generate__eq__(self, other)method@gen_str_reprto generate both__str__(self)and__repr__(self)methods@gen_str_repr_eqto generate both__str__(self),__repr__(self)and__eq__(self, other)methodsInstallationNormal installationpipinstallsimplestrDevelopment installationgitclonehttps://github.com/jpleorx/simplestr.gitcdsimplestr
pipinstall--editable.Example A (with separate annotations)fromsimplestrimportgen_str,gen_repr,gen_eq@gen_str@gen_repr@gen_eqclassRect:def__init__(self,x:int,y:int,w:int,h:int):self.x=xself.y=yself.w=wself.h=hrect1=Rect(1,2,3,4)rect2=Rect(10,20,30,40)print(rect1)print(rect2)print([rect1,rect2])print(rect1==rect2)print(rect1==Rect(1,2,3,4))Rect{x=1, y=2, w=3, h=4}
Rect{x=10, y=20, w=30, h=40}
[Rect{x=1, y=2, w=3, h=4}, Rect{x=10, y=20, w=30, h=40}]
False
TrueExample B (with joined annotation)fromsimplestrimportgen_str_repr_eq@gen_str_repr_eqclassRect:def__init__(self,x:int,y:int,w:int,h:int):self.x=xself.y=yself.w=wself.h=hrect1=Rect(1,2,3,4)rect2=Rect(10,20,30,40)print(rect1)print(rect2)print([rect1,rect2])print(rect1==rect2)print(rect1==Rect(1,2,3,4))Rect{x=1, y=2, w=3, h=4}
Rect{x=10, y=20, w=30, h=40}
[Rect{x=1, y=2, w=3, h=4}, Rect{x=10, y=20, w=30, h=40}]
False
TrueLinksIn case you’d like to check my other work or contact me:Personal websiteGitHubPyPIDockerHubArticles on MediumLinkedIn (feel free to connect)
Package: simplestreamer
# simplestreamerThis is a tiny (< 150 loc) peer-to-peer data-streaming library designed for high-frequency status data.
It uses pickle underneath to serialize the data, so you can dump any python object through it.You can install it withpip install simplestreamerHere is a quick example of how to use it. Hopefully it is self-explanatory enough.node 1 code:# just dumps time data into the streamer at 100 hz
import simplestreamer
import time

streamer = simplestreamer.SimpleStreamer(5200)

while True:
    streamer.send_data({"current time.time()": time.time()})
    time.sleep(0.01)node 2 (and 3, and 4, and so on) code:# subscribes to the stream from node 1 and periodically reads the data
import simplestreamer
import time

streamer = simplestreamer.SimpleStreamer(5201)
streamer.subscribe("127.0.0.1", 5200, "streamer 1")
# You can optionally configure the rate at which the remote streamer sends you data
#streamer.subscribe("127.0.0.1", 5200, "streamer 1", updates_per_sec=1.5)

while True:
    print(streamer.get_data("streamer 1"))
    time.sleep(0.5)
Package: simple-stripe-client
simple-stripe-clientA simple lightweight api client for awesome stripe.Exampleimportsimple_stripe_clientimportosSTRIPE_SECRET_KEY=os.environ.get('STRIPE_SECRET_KEY')# create clientstripe_api=simple_stripe_client.Api(STRIPE_SECRET_KEY,debug_http=True)CHARGE_DATA={'amount':15921,'currency':'gbp','capture':False,'source':'tok_amex','metadata':{'first_name':'Sachin','last_name':'Tendulkar',}}# Creating Chargecharge=stripe_api.charges.post(**CHARGE_DATA)CHARGE_ID='ch_xxx'# Fetching Chargecharge=stripe_api.charges.id(CHARGE_ID).get()# Update Chargecharge=stripe_api.charges.id(CHARGE_ID).post(description='Test Update')# Capture Chargecharge=stripe_api.charges.id(CHARGE_ID).capture.post(amount=12000)Building Stripe's Curl URLsURLs would match one-to-one to stripe's curl api urls.
For more links please refer tostripe docstripe_api.charges                                  # == /v1/charges
stripe_api.charges.id(CHARGE_ID)                    # == /v1/charges/{CHARGE_ID}    

stripe_api.customers                                # == /v1/customers
stripe_api.customers.id(CUSTOMER_ID)                # == /v1/customers/{CUSTOMER_ID}

stripe_api.invoices                                 # == /v1/invoices
stripe_api.invoices.id(INVOICE_ID)                  # == /v1/invoices/{INVOICE_ID}TODOAdd support for Stripe Connect, FilesAdd more extensive testsChangelog -0.0.2 (01-02-2019)fixed issue for python 20.0.1 (01-02-2019)initial release
Package: simplestructlogs
simplestructlogsA simple wrapper around the python standard logging library that supports structured logs.JSON logs are supported out of the box, but you can write your own log record classes to support other formats!Example UsagefromsimplestructlogsimportStructuredLoggerimportloggingdefraise_err():raiseException("BOOM")if__name__=="__main__":logger=StructuredLogger.get_default_logger("calvin",logging.DEBUG,{"parent-context":"This is cool!"})logger.debug("debug test")child_logger=logger.make_child_context_logger("calvin-child",{"child-context":"woo hoo!"})err=KeyError("uh oh")child_logger.info("an error",exc_info=err,stack_info=True,extra={"value1":123,"value2":{"value3":"456"}})try:raise_err()exceptExceptionase:logger.exception("testing exception logging")logger.warn("test with warning",exc_info=e)logger.warn("test with warning",is_exception_call=True)
Package: simplests
Simple Sentence SimilarityWe provide a collection of simple unsupervised semantic textual similarity methods to calculate semantic similarity between two sentences.ReferencesIf you find this code useful in your research, please consider citing:@inproceedings{ranasinghe-etal-2019-enhancing,
    title = "Enhancing Unsupervised Sentence Similarity Methods with Deep Contextualised Word Representations",
    author = "Ranasinghe, Tharindu  and
      Orasan, Constantin  and
      Mitkov, Ruslan",
    booktitle = "Proceedings of the International Conference on Recent Advances in Natural Language Processing (RANLP 2019)",
    month = sep,
    year = "2019",
    address = "Varna, Bulgaria",
    publisher = "INCOMA Ltd.",
    url = "https://www.aclweb.org/anthology/R19-1115",
    doi = "10.26615/978-954-452-056-4_115",
    pages = "994--1003",
    abstract = "Calculating Semantic Textual Similarity (STS) plays a significant role in many applications such as question answering, document summarisation, information retrieval and information extraction. All modern state of the art STS methods rely on word embeddings one way or another. The recently introduced contextualised word embeddings have proved more effective than standard word embeddings in many natural language processing tasks. This paper evaluates the impact of several contextualised word embeddings on unsupervised STS methods and compares it with the existing supervised/unsupervised STS methods for different datasets in different languages and different domains",
}
}
Package: simplestyle
This package was originally part of a Python tool to extract text data
from PDFs into TEI XML. Some of the style information that was extracted
from the PDF had to be recorded in the resulting TEI file. Among these
were fontname, fontsize, italics, boldface, superscript, subscript.
These were included as simple CSS statements into thetagsDeclof
the TEI document.Later it seemed approporiate to remove this very simple style library
from the PDF extraction package and offer it as a little standalone
package, which can be useful in different contexts.NB: This package might be useful for some people, hence it is published
as an open source package, but it is still very much tailored to some
very special needs for text processing. It is not very likely that this
package will be developed into a general CSS library. If you need this,
you will find plenty of helpful libraries on PyPI.Download, Installationsimplestyle is available on PyPI
<https://pypi.python.org/pypi/simplestyle>.Install withpip install simplestyle.The source code is on GitHub: <https://github.com/rotula/simplestyle>.Simplified CSSThe simplified CSS grammar understood by this package is as follows:css := declaration (";" declaration)* ';'?
declaration := property ":" expr
property := [a-zA-Z-]+
expr := (string | [^;"']+)
string := string1 | string2
string1 := "'" [^'\n\r\f] "'"
string2 := '"' [^"\n\r\f] '"'Usage>>>fromsimplestyleimportStyle>>>css="font-size: 10pt">>>style=Style()>>>style.from_css(css)>>>style.size10.0>>>style.get_css()'font-size: 10.0pt'>>>style.italicsFalse>>>style.from_css("font-style:italic",merge=True)>>>style.italicsTrue>>>style.size10.0>>>style.get_css()'font-size: 10.0pt; font-style: italic'>>>style.reset()>>>style.get_css()''
Package: simplesubnet
simplesubnet
by Brody Tingle

This is a simple, lightweight tool that can be used to help with subnetting.

I created this while studying for my CCNA to help with problems and gain a deeper understanding
of subnetting.

To install, run:
    pip3 install simplesubnet

To import, include this in your header:
    from simplesubnet import subnet

FUNCTIONS:

Binary IP to Decimal IP Converter:
    subnet.binary_to_ip(address):
        returns a string representing the decimal IP address

Decimal IP to Binary IP Converter:
    subnet.ip_to_binary(address):
        returns a string representing the decimal IP address

Calculate proper subnet mask based on amount of hosts needed:
    subnet.subnet_mask(num_hosts):
        returns the subnet mask as an INTEGER (i.e /30 => 30)

Calculate Network and Broadcast Address given an address and a number of needed hosts:
    subnet.addresses(starting_address, hosts):
        returns a dictionary containing values:
            ['network'] = network address
            ['broadcast'] = broadcast address

Calculate Network and Broadcast Addresses for a network with
multiple LAN's provided # of hosts per LAN. Uses VLSM to calculate.
    subnet.network_addresses(starting_address, hosts):
        hosts is a dictionary containing the # of hosts per VLAN:
            ex. {1: 64, 2: 45, 3: 14: 4: 9}
        returns a dictionary of dictionaries from the {addresses} method
        keys are VLAN #'s
            ex:
                {1: {'network': 192.168.5.0/25, 'broadcast': 192.168.5.127/25},
                2: {'network': 192.168.5.128/26, 'broadcast': 192.168.5.191/26}}
Summary Function:
    subnet.summary(address_book):
        address_book is a dictionary returned from the {network_addresses} function
        prints the dictionary in clean formatting
Package: simple-sugar
simple_sugarSimple Sugar is a beginner-oriented library that includes syntactic sugar covering the more basic building blocks of Python - including dictionaries, mathematical operations and file handling.InstallationUse the package managerpipto install simple_sugar.pipinstallsimple_sugarUsageimportsimple_sugar# Get a random number between 3 and 9num=get_random(3,9)# Declare a dictionary and get all valuesmy_dict=dictionary()my_dict.one="First"my_dict.two="Second"my_dict.get_values()# ["First", "Second"]# Find the average of a list of numbersmy_list=[3,5,10,9,12]average(my_list)# 7.8# Get a file without punctuationpath="file.txt"my_file=get_file(path,punctuation=False)LicenseMIT
Package: simple-sunlight
Sometimes, all you need is the data. This is the simplest possible wrapper I could make. It returns decoded JSON, with some fat trimmed. It should stay out of your way.Usage:>>> from sunlight import Sunlight
>>> sunlight = Sunlight(API_KEY)
>>> pelosi = sunlight.legislators.get(lastname='pelosi')
>>> print pelosi['firstname']
NancyThis should work with any method on Sunlight’ Congress API defined here:http://services.sunlightlabs.com/docs/Sunlight_Congress_API/See test.py for more details and examples.