Saravanan666/pypi-org huggingface dataset:
Package: rinch-sql
Introductiona simple orm in python based on [mysql,dataclass].Installpip install rinch-sqlUsedicttable__init__.pyuser.pytable2.pytask.pyuser.pyimportdatetimefromdataclassesimportdataclass@dataclassclassUser:field_list_unique=["name"]# must, can be []name:strage:intid:int=None# mustcreate_time:datetime=Noneupdate_time:datetime=None__init__.pyfromrinch_sqlimportMysql# please use every key with current name. dont use it autocommit(always True).MYSQL_SERVER_DATABASE={"host":"","port":3306,"user":"","password":"","database":"","pool_size":32,}from.userimportUser# it will create pool immediatelymysql_user=Mysql(MYSQL_SERVER_DATABASE,User)# or creat it when usedefmysql_user_():returnMysql(MYSQL_SERVER_DATABASE,User)task.pyfromrinch_sqlimportSql,SqlStaticfromtableimportmysql_user,User# select alluser_list=mysql_user.select("")# select with whereuser_list=mysql_user.select("id = 1")# select with complex sqlsql="SELECT id,t1.name,age from user as t1 right join tb_mail as t2 on t1.name=t2.name group by t1.name"values=["id","name","age"]# "id,name,age".split(",")user_record_list=mysql_user.execute(sql)user_list=[mysql_user._values_2_obj(i,values)foriinuser_record_list]# or you can use Sql or SqlStatic driectsql_update=SqlStatic.update("user",["name","age"])user=User(id=2)mysql_user.execute(sql_update,["name_new",100])Advicewhen you have any advice, please issue inhttps://github.com/rinch-wu/rinch_sql
Package: rindcalc
RindcalcA Spectral Index Raster Calculator For Satellite Image ProcessingFor more information visit theRindcalc documentationRindcalc is an open source python library built on numpy and gdal aiming to
provide seamless and accurate raster index calculations and composites of
satellite and aerial imagery.It currently consists of index calculation, composite and utility functions
for Landsat-8 and USDA NAIP imagery, with Sentinel-2 and MODIS satellite
functionality in the worksRoadmapFinish Sentinel-2 implementationRework Landsat, NAIP, and Sentinel to operate in classesSegmentation and zonal statisticsInstall with pipDependencies:GDAL -need to build from .whl fileNumPypip install rindcalcInstall with condaconda install -c rindcalc rindcalcIf rindcalc is not importing after conda install on Windows 10 then rindcalc
files need to be moved from Lib/pythonX.X/site-packages/ to Lib/site-packages
within the conda env folder.
Package: rindex
rindexThis package providesrindex()function that returns last index of value in sequence.InstallingpipinstallrindexExamplesfromrindeximportrindexnumbers=[5,1,3,8,10,5,8,1,8,3]print(rindex(numbers,1))# 7print(rindex(numbers,8,4,8))# 6GoalsSupport all features of built-in.index()SpeedPortability (support for different platforms)Supported platformsCurrently, the library includes threerindex()implementations:CythonPure Python (when the Cython one is not available; slower)Pure Python for PyPyFeaturesSupports any sequencesSupportsstartandstop(both may be negative or out of bounds)Doesn't copy the sequenceControlling Cython extensionsYou can set environment variableENABLE_RINDEX_EXTENSIONSto0or1to forcefully disable/enable Cython extensions.
This can be useful if you face compilation problems and want to use pure Python version.Benchmarkingtests/benchmark.pycan generate interactive plots with comparisons of different implementations.
Package: ring
Let’s concentrate on code, not on storages.Ring shows a way to control cache in point of view of code - not about storages.
Ring’s decorator is convenient but also keeps fluency for general scenarios.asyncio support for Python3.5+!Take advantage of perfectly explicit and fully automated cache interface.
Ring decorators convert your functions to cached version of them, with extra
control methods.DocumentationFull documentation with examples and references:http://ring-cache.readthedocs.io/Function/method support.asyncio support.Django support.Bulk access support.Function cacheimportringimportmemcacheimportrequestsmc=memcache.Client(['127.0.0.1:11211'])# working for mc, expire in 60sec@ring.memcache(mc,time=60)defget_url(url):returnrequests.get(url).content# normal way - it is cacheddata=get_url('http://example.com')It is a normal smart cache flow.But ring is different when you want to explicitly control it.# delete the cacheget_url.delete('http://example.com')# get cached data or Nonedata_or_none=get_url.get('http://example.com')# get internal cache keykey=get_url.key('http://example.com')# and access directly to the backenddirect_data=mc.get(key)Method cacheimportringimportredisrc=redis.StrictRedis()classUser(dict):def__ring_key__(self):returnself['id']# working for rc, no expiration# using json coder for non-bytes cache data@ring.redis(rc,coder='json')defdata(self):returnself.copy()# parameters are also ok!@ring.redis(rc,coder='json')defchild(self,child_id):return{'user_id':self['id'],'child_id':child_id}user=User(id=42,name='Ring')# create and get cacheuser_data=user.data()# cacheduser['name']='Ding'# still cachedcached_data=user.data()assertuser_data==cached_data# refreshupdated_data=user.data.update()assertuser_data!=updated_data# id is the cache key so...user2=User(id=42)# still hitting the same cacheassertupdated_data==user2.data()InstallationPyPI is the recommended way.$pipinstallringTo browse versions and tarballs, visit:https://pypi.python.org/pypi/ring/To use memcached or redis, don’t forget to install related libraries.
For example: python-memcached, python3-memcached, pylibmc, redis-py, Django etcIt may require to install and run related services on your system too.
Look formemcachedandredisfor your system.ContributorsSee contributors list on:https://github.com/youknowone/ring/graphs/contributors
Package: ringba-api-client
Ringba API ClientSimple Rrequest package to integrate with the Ringba Public APIGitHub repo:https://github.com/nat5142/ringba-api-client.gitDocumentation:https://ringba-api-client.readthedocs.ioFree software: MITQuickstartInstall:pipinstallringba-api-clientImport:fromringba_api_clientimportRingbaApiClientInitialize:ringba=RingbaApiClient(api_key='XXXXXXXXXXXXXXXX')Use:target=ringba.get_targets(target_id='abdc12345')TODO:Add schema validation for create/update bodiesCreditsThis package was created withCookiecutterand thefedejaure/cookiecutter-modern-pypackageproject template.
Package: ringbell
Python package for playing a sound when a task is complete. The callbacks additionally works also within jupyter notebook,
so that if you are working on a notebook on a remote machine it plays the audio within your browser and not in the server.How do I install this package?You will need a couple packages that you might not already have installed:sudoaptinstallpython3-devsudoaptinstalllibasound2-devFinally as usual, just download it using pip:pipinstallringbellSupport my work ❤️If you have enjoyed my work, and possibly it has saved you some precious minutes,
please dosupport me on GitHub ❤️Integration with exceptions and Jupyter NotebooksIn Jupyter Notebooks it is now possible to integrate Ringbell with a one liner, that will play
a positive sound when the execution completes successfully and a negative sound when the execution
crashes and burns.Analogous support is added for normal scripts, but only for exceptions since I am not aware of
an hook event for the end of a script.Notification after at least one minute of executionSince in most Jupyter Notebooks, expecially for experiments, there will be a few very quick
cells and then some very long ones, we do not want to spam the user with sounds. The only
case where we’d like to advise the user is when enought time has passed since the start of either
the script execution or, in case of Jupyter Notebooks, the start of the cell execution.To do this, simply import the ringbell package as such:importringbell.autoImmediate notificationIf you’d like to have an immediate notification for each cell and exception.importringbell.immediateAll exceptionsIf you’d like to have an immediate notification for all exceptions.importringbell.all_exceptionsCustom time intervalYou can also customize the time interval as such:fromringbellimportauto_ringbellauto_ringbell(minimum_execution_time=60,only_exceptions=False,good_sound="sample_for_nominal_execution",bad_sound="sample_for_exceptions")Usage examplesIt’s quite trivia, really, just go:fromringbellimportRingBelldefmy_long_task():# Do stuf...# And when it is finished...RingBell(sample="microwave",minimum_execution_time=0,verbose=True)How many sounds are there? Well, just list them:fromringbellimportRingBellprint(RingBell.available_samples())What abount a custom sound? Just pass it as an argument.fromringbellimportRingBelldefmy_long_task():# Do stuf...# And when it is finished...RingBell(path="path/to/my_custom_sound.mp3")
Package: ringbellerpythonapi
Ringbeller IoT Python API1. SolutionThe package builds a Python wrapper around the C++ Modem Library.
The native C++ library is built with make to produce a shared library (.so)
The shared library is loaded in Python with ctypes.2. SourcesThe original C++ Modem Library is copied in ringbellerpythonapi/src/modem.
Main package file ringbellerpythonapi.py exports all functions supported by the C++ Modem Library.3. Prerequisite: WiringPiThe WiringPi library is required by the C++ Modem Library for low-level hardware communication.
To install the library:Go tohttps://github.com/WiringPi/WiringPiDownload ZIP archiveUnzip archive: unzip WiringPi-final_official_2.50.zipCompile and install library:
cd WiringPi-final_official_2.50
./build4. Build C++ Modem Shared Librarycd ringbellerpythonapi
cd src
make5. TestingTest scripts are placed in folder /tests
The following script attempts to turn ON and OFF the modem (debugging logs enabled):cd tests
python3 testpower.pywhere:
 = 1 for SIMULATED mode or = 0 for HARDWARE mode (e.g. 1)6. API Functionsinitialize(verbose, debug, serial_port, audio_device): Initialize modem.
on(): Turn on the modem
off(): Turn off the modem
restart(): Restart the modem
connect(): Connect to modem
disconnect(): Disconnect from modem
configure(): Configure modem
send_sms(number, message): Send SMS message
receive_sms(): Receive SMS message
place_voice_call(number): Place call
receive_voice_call(): Receive call
get_call_status(): Get call status
end_call(): Hang up active voice call
begin_audio_playback(playback_file): Begin playing audio to voice call
wait_for_audio_playback(): Wait for voice-call audio-playback to end
end_audio_playback(): End playing audio to voice call
begin_audio_recording(record_file): Begin recording audio from voice call
end_audio_recording(): End recording audio from voice call
send_mms(recipient, cc, bcc, title, attachment, protocol, apn, username, password, authentication, mmsc, proxy, port): Send MMS message
get_keypad_input(length, audio_file): Get keypad input (IVR)7. LoggingThe logging options are provided when calling the "initialize" API function.
The package supports following logging options:verbose: log level from 0 to 4
0 - no logging
1 - errors displayed
2 - info and errors displayed
3 - info, errors and warnings displayed
4 - all messages displayed (info, errors, warnings and debug messages)debug: specify 1 to enable debug simulation
Package: ringbuffer
SummaryGeneral implementation of an associative ring buffer.
Random access time is like with any other dictionary - O(1),
memory consumption is also similar.Usage>>>r=Ring({},5)>>>r[0]="A">>>r[1]="B">>>r[2]="C">>>r[3]="D">>>r[4]="E">>>rRing([(0,'A'),(1,'B'),(2,'C'),(3,'D'),(4,'E')])>>>r[5]="F">>>rRing([(1,'B'),(2,'C'),(3,'D'),(4,'E'),(5,'F')])>>>
Package: ringcentral-bot-framework-extension-botinfo
ringcentral-chatbot-python-ext-bot-infoSimple ringcentral chatbot python extension that addbot infocommand support.Table of contentsUsePrerequisitesQuick startTest botLicenseUseUse/write extensionsPrerequisitesPython3.6+ and Pip3Create the bot App: Login todeveloper.ringcentral.comand create anpublicServer/Botapp with permissions:ReadContacts, ReadMessages, ReadPresence, Contacts, ReadAccounts, SMS, InternalMessages, ReadCallLog, ReadCallRecording, WebhookSubscriptions, GlipQuick start# use virtualenvpip3installvirtualenv# might need sudo# init virtual envvirtualenvvenv--python=python3# use envsource./venv/bin/activate# install depspipinstall-rrequirements.txt
npmi# run ngrok proxy# since bot need https server,# so we need a https proxy for ringcentral to visit our local server./bin/proxy# will show:# Forwarding https://xxxxx.ngrok.io -> localhost:8989# create env filecp.sample.env.env# then edit .env, set proper setting,# and goto your ringcentral app setting page, set OAuth Redirect URI to https://https://xxxxx.ngrok.io/bot-oauthRINGCENTRAL_BOT_SERVER=https://xxxxx.ngrok.io## for bots auth required, get them from your ringcentral app pageRINGCENTRAL_BOT_CLIENT_ID=RINGCENTRAL_BOT_CLIENT_SECRET=# create bot configcpconfig.sample.pyconfig.py# run local dev server./bin/startTest botGoto your ringcentral app's bot section, click 'Add to glip'Login tohttps://glip-app.devtest.ringcentral.com, find the bot by searching its name. Talk to the bot.Edit config.py to change bot bahavior and test inhttps://glip-app.devtest.ringcentral.comLicenseMIT
Package: ringcentral-bot-framework-extension-world-time
ringcentral-chatbot-python-ext-world-timeSimple ringcentral chatbot python extension that addworld timecommand support.Table of contentsUsePrerequisitesQuick startTest botLicenseUseUse/write extensionsPrerequisitesPython3.6+ and Pip3Create the bot App: Login todeveloper.ringcentral.comand create anpublicServer/Botapp with permissions:ReadContacts, ReadMessages, ReadPresence, Contacts, ReadAccounts, SMS, InternalMessages, ReadCallLog, ReadCallRecording, WebhookSubscriptions, GlipQuick start# use virtualenvpip3installvirtualenv# might need sudo# init virtual envvirtualenvvenv--python=python3# use envsource./venv/bin/activate# install depspipinstall-rrequirements.txt# run ngrok proxy# since bot need https server,# so we need a https proxy for ringcentral to visit our local server./bin/proxy# will show:# Forwarding https://xxxxx.ngrok.io -> localhost:8989# create env filecp.sample.env.env# then edit .env, set proper setting,# and goto your ringcentral app setting page, set OAuth Redirect URI to https://https://xxxxx.ngrok.io/bot-oauthRINGCENTRAL_BOT_SERVER=https://xxxxx.ngrok.io## for bots auth required, get them from your ringcentral app pageRINGCENTRAL_BOT_CLIENT_ID=RINGCENTRAL_BOT_CLIENT_SECRET=# create bot configcpconfig.sample.pyconfig.py# run local dev server./bin/startTest botGoto your ringcentral app's bot section, click 'Add to glip'Login tohttps://glip-app.devtest.ringcentral.com, find the bot by searching its name. Talk to the bot.Edit config.py to change bot bahavior and test inhttps://glip-app.devtest.ringcentral.comLicenseMIT
Package: ringcentral-chatbot-factory
ringcentral-chatbot-factory-pyCli tool to generate RingCentral chatbot project.Use# make sure you have python3/pip3 installedpip3installringcentral_chatbot_factory

rcfmy-app# then carefully answer all questions, then the my-app folder will be createdcdmy-app# follow the instruction of my-app/README.md to dev/run/test/deploy the botTemplateshttps://github.com/zxdong262/ringcentral-chatbot-template-pythonExample bot appsdate-time-chatbot: simple Glip chatbot that can tell time/date.assistant-bot: simple assistant Glip bot to show user/company information, this bot will show you how to access user data.survey-bot: example survey bot, this bot will show you how to create/use custom database wrapper.LicenseMIT
Package: ringcentral-chatbot-server
ringcentral-chatbot-serverCLI tool to run ringcentral bot powered byringcentral_bot_framework.Usepip3installringcentral_chatbot_server
rcsbot.pyDevvirtualenvvenv--python=python3source./venv/bin/activate
pipinstall-rrequirements.txt
pipinstallpylintringcentral_bot_frameworktwine
cp.sample.env.env# then fill RINGCENTRAL_BOT_CLIENT_ID and RINGCENTRAL_BOT_CLIENT_SECRET at least# testpipinstall.
rcsbot.pyLicenseMIT
Package: ringcentral-engage-digital
RingCentral Engage Digital Client for PythonSimple Python API wrapper for RingCentral Engage Digital api.api docs.Usagefromringcentral_engage_digitalimportRestClientrc=RestClient(RINGCENTRAL_ENGAGE_API_TOKEN,RINGCENTRAL_ENGAGE_SERVER_URL)r=rc.get('/1.0/roles')assertEqual(len(r.json['records'])>0,True)Testbin/initsourcevenv/bin/activate
cp.sample.env.env# edit .env fill your server and spi keynpmruntestCreditsBased onTyler'shttps://github.com/tylerlong/ringcentral-python.LicenseMIT
Package: ringcentral-engage-digital-source-sdk
RingCentral Engage digital source SDK pythonFramework(python) to createEngage Digital channel SDKchannel for RingCentral Engage Digital.Wiki about RingCentral Engage Digital channel SDK channel, which is a customized channel that support any source user want to use.Install PrerequisitesPython3.6+ and Pip3.First we installvirtualenvwhich will create an isolated environment in which to install and run all the python libraries needed by this framework. Using virtualenv will ensure that the libraries installed for this project do not conflict or disrupt the other python projects you are working on.RingCentral Engage(Dimelo) account,request a demo.Quick startLet's start a simple RingCentral Engage source server.# init projectbin/initsourcevenv/bin/activateNext, we need to runngrok, a tool for routing web requests to a localhost. This is what will allow your local bot in development to receive webhooks from RingCentral. ngrok is a node app and is installed and start as follows:./bin/proxy# will showForwardinghttps://xxxx.ap.ngrok.io->localhost:9898# Remember the https://xxxx.ap.ngrok.io, we will use it laterFollowStep by step guide to create Dimelo SDK source in Admin consoleto prepare the source.# create env filecp.env.sample.env# then edit .env, set proper setting according to the tip in .env# run local dev server./bin/startTest source serverSave your source, your server will get request, you check the request log from console.Use it as CLI toolpip3installringcentral_engage_digital_source_sdk
rcespath/to/config_file.pyUse is as a moduledocs/direct-use.mdPost message to channelYou can get channel realtime url and api token from channel setting page, post new message to the channel.Checkpost_message_demo/post_message_demo.pyas an example.fromringcentral_engage_digital_source_sdkimportpostMessageToEngagedefmain():url='RINGCENTRAL_ENGAGE_DIGITAL_ENDPOINT'token='RINGCENTRAL_ENGAGE_DIGITAL_API_TOKEN'body={'action':'messages.create','params':{'actions':['show','reply'],'id':'xxxxx','body':'hi there~','thread_id':'yyyyy','author':{'id':'zzzzz','firstname':'John','lastname':'Doe','screenname':'John Doe','created_at':1622426621537}}}r=postMessageToEngage(body,url,token)print('result',r)Write a configdocs/write-a-config.mdBuild and Deploy to AWS LambdatodoInit a source server project with factory CLI tooltodoLicenseMIT
Package: ringcentral-engage-voice
RingCentral Engage Voice Python SDKAPI docs.InstallationPIPpip3installringcentral_engage_voice# orpipinstallringcentral_engage_voiceUsagefromringcentral_engage_voiceimportRingCentralEngageVoice# create from ringcentral app client id /secret# you can create app from https://developer.ringcentral.comev=RingCentralEngageVoice('RINGCENTRAL_CLIENT_ID','RINGCENTRAL_CLIENT_SECRET')# auth with password flowev.authorize(username='USERNAME',password='PASSWORD',extension='EXTENSION'# optional)# // can also auth with auth code flow# // check https://developers.ringcentral.com/guide/authentication for more detailev.authorize(code='xxxx',redirectUri='yyyyyy')# get access token, will expire in 5 minutestoken=ev.token['accessToken']# // api request# // check all api doc from https://engage-voice-api-docs.readthedocs.io/en/latest/r=ev.get('/api/v1/admin/accounts')assertEqual(len(r.json())>0,True)For legacy server use:fromringcentral_engage_voiceimportRingCentralEngageVoice# LEGACY_SERVER could be# 'https://portal.vacd.biz',# or  'https://portal.virtualacd.biz'ev=RingCentralEngageVoice(server=process.env.LEGACY_SERVER)# only support username/password authawaitev.authorize({username=process.env.LEGACY_USERNAME,password=process.env.LEGACY_PASSWORD})# api request# check all api doc from https://engage-voice-api-docs.readthedocs.io/en/latest/letr=ev.get('/api/v1/admin/accounts')r=r.json()expect(len(r)>0).toBe(true)Instance methodsev._request(method,endpoint,params=None,json=None,data=None,files=None,multipart_mixed=False,headers=None)ev.get(endpoint,params=None)ev.post(endpoint,json=None,params=None,data=None,files=None,multipart_mixed=False)ev.put(endpoint,json=None,params=None,data=None,files=None,multipart_mixed=False)ev.patch(endpoint,json=None,params=None,data=None,files=None,multipart_mixed=False)ev.delete(endpoint,params=None)Virtual EnvironmentThe venv module allows you to create a lightweight "virtual environment" within your own site directory, isolated from system site directories. The virtual environment has it's own Python binary and can have its own independent set of installed Python packages in its site directories. This is a good way to to create an isolated test environment to test out this codeTestTo use the virtual environments, make sure you have pip3 and python3.6+ setup, then execute the following:bin/initsourcevenv/bin/activate
pipinstall-rrequirements.txt
cpenv-sample.env.env# edit .env fill all fields# now test./bin/test# test non-lagecy APIpython3test/engage_voice_spec.py# test lagecy API onlypython3test/engage_voice_lagecy_spec.pyTo test without virtual environments and in your system directory, make sure you have pip3 and python3.6+, then execute the following:pip3install-rrequirements-dev.txt
pip3install-rrequirements.txt
cpenv-sample.env.env# edit .env fill all# now test./bin/testCreditsBased onTyler'shttps://github.com/tylerlong/ringcentral-python.LicenseMIT
Package: ringcloud_pyapi
ringcloud_pyapiБиблиотека предназначена для работы с REST API компании RingCloud.Документация по REST API:https://api.ringcloud.ru/docsУстановкаДля работы требуется Python версии 2.7.9+ или 3.x.$pipinstallringcloud_pyapiАвторизацияfromringcloud_pyapiimport*api_key="YOUR_API_KEY"password="YOUR_API_PASSWORD"rc=RingCloud(api_key,password)Функции APIСостояние балансаprint(rc.get_account_balance())#1500.00Получение информации из базы по номеру телефонаprint(rc.get_phone_number_info('+79101000000'))Получение списка каналов для аккаунтаprint(rc.get_channels())Отображение данных о текущем вызове по имени каналаprint(rc.get_channel_info('channel/exampleChannelName'))Оригинация вызоваДля оригинации вызова необходимо передать имя пользователя, от которого совершается звонок,
и номер телефона, на который нужно позвонить.user=111111phone=79101234567print(rc.originate(user,phone))Получение информации о текущих вызовах (для аккаунта)print(rc.get_active_calls())Получение информации о завершенных вызовахprint(rc.get_complete_calls(num=410,days=5))Получение списка сотрудниковprint(rc.get_users())Получение информации о конкретном сотрудникеprint(rc.get_user_info(user))Создание сотрудникаprintrc.create_user(password,num,email)# 111111Изменение пароля сотрудникаrc.update_user_password(user,new_password)Изменение email сотрудникаrc.update_user_email(user,new_email)Изменение внутреннего номера сотрудникаrc.update_user_extension(user,new_num)Включение VoiceMail Boxrc.enable_user_voice_mail_box(user)Выключение VoiceMail Boxrc.disable_user_voice_mail_box(user)Получение списка записей разговоров для конкретного пользователяprint(rc.get_user_records(user))Загрузка записи разговораrc.download_record(user,filename,you_local_path)
Package: ringgpt
[tool.poetry]
name = "ringgpt"
version = "0.2.0"
description = "Package enables users to iterate on a corpus to perform single shot completion tasks leveraging GPT-3.5, Bard and Bing Chat"
authors = ["Avinaash Anand Kavinaash96@gmail.com"]
license = "Apache-2.0"
readme = "README.md"[tool.poetry.dependencies]
python = "^3.9"
pandas = "^2.0.2"
GoogleBard = "^1.0.3"
asyncio = "^3.4.3"
EdgeGPT = "0.5.0"
revChatGPT = "^5.0.3"
requests = "^2.31.0"
rich = "^13.4.2"
langchain = "^0.0.203"
tiktoken = "^0.4.0"[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"