Saravanan666/pypi-org huggingface dataset:
Package: tonconnect
TON Connect for PythonLibrary for connecting TON Connect to Python apps.DescriptionAt this moment you can connect wallets to apps using HTTP Bridge.Getting StartedDependenciesPyNaCltonsdk (will be removed in the future)aiohttprequestsInstallinggit clone https://github.com/ClickoTON-Foundation/tonconnect.git
pip install -e tonconnectUsingExample of connecting wallet.fromtonconnect.connectorimportConnectorconnector=Connector('https://tonclick.online/ton-connect.json')url=connector.connect('tonkeeper','test')print(f'Universal connect url for Tonkeeper:{url}')address=connector.get_address()print(f'Successfuly connected{address}.')Example of connecting wallet with help of tonapi.io.
tonapi.io it's used to obtain a public key, which adds support for more versions of the wallet that have the get_public_key method..fromtonconnect.connectorimportConnectorconnector=Connector('https://tonclick.online/ton-connect.json',use_tonapi=True,tonapi_token=None)url=connector.connect('tonkeeper','test')print(f'Universal connect url for Tonkeeper:{url}')address=connector.get_address()print(f'Successfuly connected{address}.')Example of asynchronous connecting wallet.importasynciofromtonconnect.connectorimportAsyncConnectorasyncdefmain():connector=AsyncConnector('https://tonclick.online/ton-connect.json')url=awaitconnector.connect('tonkeeper','test')print(f'Universal connect url for Tonkeeper:{url}')address=awaitconnector.get_address()print(f'Successfuly connected{address}.')if__name__=='__main__':loop=asyncio.new_event_loop()asyncio.set_event_loop(loop)loop.run_until_complete(main())More examples can be found in examples folder.Authors@VladPavlyVersion History0.2.1Added ConnectErrorEventMinor changes0.2.0Added support of custom timeoutAdded tonhub supportChanged from using get_public_key method to /v2/tonconnect/stateinit (tonapi.io)0.1.3License changePython 3.11 supportSmall changes0.1.2Bug fix0.1.1Added tonapi.io support0.1.0Async wrapper0.0.2 & 0.0.3pyproject.toml fix0.0.1Initial BetaLicenseThis project is licensed under the MIT License - see the LICENSE.md file for detailsDonateIf you like the library, I will be glad to accept donations.TON: EQCgphx8rTI0PukwmgpVqiPgqguTujhQscg2h7jgc4U0t347Acknowledgmentston-connect-docston-connect-js-sdk
Package: tone-deaf
tone-deaftone-deaf is an esoteric programming language which manipulates a stack
based on chords. This repository contains a reference interpreter for
the language as well as the wiki describing each function.tone-deaf can be installed throughpip:pip install tone-deafRunning from a filePrograms can be run from a file in one of two modes: normal or ‘lyric’
mode. Lyric mode allows you to leave comments on every other line, like
so:E E E
The above takes 3 integers.
A7 A7
This will calculate (a ** (b ** c)).which the intepreter reads as:E E E A7 A7Normal mode assumes there are no comments. To load a file in normal
mode, use the-foption, i.e.tone-deaf-fprogram.deaf. To load
a file in lyric mode, use the-lswitch along with the-foption, i.e.tone-deaf-l-fprogram.deaf.Using the REPLIf no file is provided via the switches above, you will be provided with
a REPL. This will work the same was as the paring for normal files
would, except the stack is persistent throughout the entire execution.
Example:td> E E E
1
2
3
[1 2 3]
td> Em7
[1 2 3 3]
td> E7#9
[3 3 2 1]
td> A7 A7 A7
[19683]
td> quit
...The stack will be printed out after each line entered.FunctionalityPlease check outthe
wikito get an
understanding of all capabilities.
Package: tonereader
tonereaderA Python library that detects sarcasm in text.OverviewHave you ever read a message from someone and were unsure about whether they were being serious or not? Is it difficult for you to figure out of someone is being sarcastic through text? Now, tonereader can help you with that!Using training data from Reddit, tonereader can analyze text and determine whether or not the speaker is being sarcastic. So far, this library uses an ngram model which does not yield great results; however, I would like to make this project more sophisticated in the future.InstallationTo install tonereader, simply runpipinstalltonereaderUsageRight now, most of the methods written are used to train the model. These methods allow you to pass in more training data into the model.To use the sarcasm-detecting function, simply runis_sarcastic(text)which will return a boolean.Future plansFor the future, I would like this project to use a more sophisticated model to determine sarcasm. I would also like to add the ability to detect more tones/emotions as well.
Package: tones
TonesA pure-python module for generating simple tones as audio samples, which can
optionally be written directly to a .wav audio file. Supports pitch-bending,
vibrato, polyphony, several waveform types (sine, square, triangle,
sawtooth), and several other waveform-shaping options.InstallationInstall from the PyPi repository:pip install tonesExamplefromtonesimportSINE_WAVE,SAWTOOTH_WAVEfromtones.mixerimportMixer# Create mixer, set sample rate and amplitudemixer=Mixer(44100,0.5)# Create two monophonic tracks that will play simultaneously, and set# initial values for note attack, decay and vibrato frequency (these can# be changed again at any time, see documentation for tones.Mixermixer.create_track(0,SAWTOOTH_WAVE,vibrato_frequency=7.0,vibrato_variance=30.0,attack=0.01,decay=0.1)mixer.create_track(1,SINE_WAVE,attack=0.01,decay=0.1)# Add a 1-second tone on track 0, slide pitch from c# to f#)mixer.add_note(0,note='c#',octave=5,duration=1.0,endnote='f#')# Add a 1-second tone on track 1, slide pitch from f# to g#)mixer.add_note(1,note='f#',octave=5,duration=1.0,endnote='g#')# Mix all tracks into a single list of samples and write to .wav filemixer.write_wav('tones.wav')# Mix all tracks into a single list of samples scaled from 0.0 to 1.0, and# return the sample listsamples=mixer.mix()DocumentationFull API documention is here:https://tones.readthedocs.io
Package: tonescale
tonescalesetupsudoaptinstall\libasound-dev\portaudio\python-pyaudio\python3-pyaudiopipinstalltonescaleusageTonescale provides various sound utilities and capabilities for Python
in Linux. It provides aSoundclass that can store a sound in a
NumPy array, can load the sound from a file, can save the sound to a
file, and can play the sound usingaplayor by streaming the sound
using PyAudio. Sounds can be added, summed and repeated symbolically.
Tonescale includes some sounds.A tonescale module sound can be accessed in the following way:sound_1=tonescale.access_sound(name="199935__drzhnn__04-blip")Sounds can be repeated:sound_1.repeat(number=2)Sounds can be added:sound_3=sound_1+sound_2Sounds can be summed:sound_3=sum([sound_1,sound_2])Sounds can be played:sound_1.play()Sounds can be played in the background too:sound_1.play(background=True)Sounds can also be played in a stream:sound_1.play_stream()Sounds can be saved to files:sound_1.save_WAVE()Sounds can be loaded from files:sound_1.read_WAVE(filename="199935__drzhnn__04-blip.wav")See example code for more details.Tonescale also providessound_search.py, which can search
recursively for sound files of a specified minimum duration.
Package: tonescript
tonescriptPython package for working with ToneScript, a syntax for describing the characteristics of the call progress tones used in telephony. It is the primary method for configuring tones in Sipura, Linksys, and Cisco VoIP systems.FeaturesParses ToneScript into its components: frequencies, cadence sections, and tone segmentsConstructs ToneScript from component objectsRenders ToneScript objects into WAV audio filesInstallationpipinstalltonescriptOverview of ToneScript syntaxFor example, theToneScriptthat defines the standard North American dial tone is as follows:350@-13,440@-13;10(*/0/1+2)350@-13,440@-13is theFreqScriptportion, which describes the frequency components used to make up the sound heard in the tone. The audio frequency (in Hz) and level (in dBm) are specified for each component, and each component is separated by a comma (,).This FreqScript defines 2 frequency components:350 Hz @ -13 dBm440 Hz @ -13 dBm10(*/0/1+2)is theCadScriptportion, which describes the cadence of the tone, or the rhythm of its defined frequency components and silence.The tone is divided into sections, each of which has its own sequence of tone segments.A tone segment plays using one or more of the frequency components defined in the FreqScript for a specified duration (in seconds), followed by an optional period of silence.A cadence section can also have its own duration; the tone segments within it are played and looped as needed until the section duration has elapsed.When specifying duration values, an asterisk (*) indicates that the duration is continuous.The above CadScript defines a single section which plays for 10 seconds. The section has a single tone segment:*= Plays continuously0= No silence1+2= Uses the first and second frequency components in the listUsageParsing a ToneScriptimporttonescriptasts# standard North American dial tonescript="350@-13,440@-13;10(*/0/1+2)"tone=ts.parse(script)print(str(tone))Output:Frequencycomponents:1)350Hz@-13dBm2)440Hz@-13dBm
Cadencesections:1)For10s:1)Alwayson,frequencies1,2Constructing a ToneScriptfromdecimalimportDecimalimporttonescriptastsimporttonescript.modelasts_model# standard North American dial tonetone=ts_model.ToneScript(ts_model.FreqScript([ts_model.FrequencyComponent(350,Decimal("-13")),ts_model.FrequencyComponent(440,Decimal("-13"))]),ts_model.CadScript([ts_model.CadenceSection(Decimal("10"),[ts_model.ToneSegment(Decimal("inf"),Decimal("0"),[1,2])])]))script=ts.unparse(tone)print(script)Output:350@-13,440@-13;10(*/0/1+2)Rendering a ToneScript into a WAV audio fileimporttonescriptasts# standard North American dial tonetone=ts.parse("350@-13,440@-13;10(*/0/1+2)")# 16-bit PCM, 44.1 kHz sample ratets.render(tone,"./dial_tone.wav",44100,2)SupportPlease use the project'sIssues pageto report any issues.ContributingInstalling for developmentpoetryinstallLinting source filespoetryrunpylint--rcfile.pylintrcsrc/tonescriptRunning testspoetryrunpytestLicenseThis library is licensed under the terms of theMIT license.
Package: tonetransposer
Tone Transposer LibraryIntroductionThis is a library that takes a series of tones and transposes them into all 12 musical key signatures.It is designed to help musicians analyze tone patterns on a piano.TransposingTo use this library, first create a Transpose object. This takes in the name of a root note and a list of tones. This is an example
of a C major triad:t = Transpose("C",["C","E","G"])Next, you can either print a quick summary to the output window of all transpositions:t.print_positions()Or you can return an iterable object, and cycle through and print them:for p in t.get_all_positions():
    print(p.root_tone.get_note_name(),p.to_string())This is an example of the output:C | C, E, G
Db | Db, F, Ab
D | D, Gb, A
Eb | Eb, G, Bb
E | E, Ab, B
F | F, A, C
Gb | Gb, Bb, Db
G | G, B, D
Ab | Ab, C, Eb
A | A, Db, E
Bb | Bb, D, F
B | B, Eb, GbNotationYou can change the notation that is presented by passing a NoteNameType object value to the 'to_string()' method.
Here are some values that can be passed: NoteNameType.Flat, NoteNameType.Sharp, NoteNameType.Enharmonic. Every method in the library
defaults to 'Enharmonic' (i.e showing both both the sharp and flat) when no value is passed through.print(p.root_tone.get_note_name(NoteNameType.Flat),p.to_string(NoteNameType.Flat))Interval numbersThis demonstrates how to print the underlying intervals for a chord:t = Transpose("C",["C","Eb","G","Bb"])
t.print_intervals()['R', 'b3_#2', '5', 'b7_#6']You can also interate through these intervals using the 'get_intervals()' method:t = Transpose("C",["C","Eb","G","Bb"])
for p in t.get_intervals(NoteNameType.Flat):
    print(p)R
b3
5
b7Grouping TranspositionsThe library allows you to group the different transpositions by their shape on a piano keyboard.t = Transpose("C",["C","Eb","G","Bb"])
t.print_key_pattern(NoteNameType.Flat)wwww | 3 | D,E,A
wbwb | 2 | C,F
bwbw | 2 | Db,Gb
bbbb | 1 | Eb
wbww | 1 | G
bwbb | 1 | Ab
bbwb | 1 | Bb
wwbw | 1 | BThe first column indicates the pattern of white and black notes of each transposition. The second column indicates the number of
transpositions that have that shape on the piano. The third column indicates which musical keys have that shape.You can also iterate through the summary like so:for s in t.get_key_pattern_summary(NoteNameType):
    print(s.key_pattern, s.count, s.root_notes)By default, the summary is sorted descending by the count of shapes. However, you can change the sort order and also
column that is sorted. This demonstrates the arguments you need to pass through to change the order:for s in t.get_key_pattern_summary(NoteNameType.Flat,SortKeys.KeyPattern,Direction.Ascending):
    print(s.key_pattern, s.count, s.root_notes)bbbb 1 Eb
bbwb 1 Bb
bwbb 1 Ab
bwbw 2 Db,Gb
wbwb 2 C,F
wbww 1 G
wwbw 1 B
wwww 3 D,E,ADirection can only be 'Ascending' and 'Descending', however the columns for sorting can be any of the following:SortKeys.KeyPattern, SortKeys.Count, SortKeys.WhiteCount, SortKeys.BlackCount
Package: tonga
TongaAsyncio client for event driven appDocumentation:https://tonga.readthedocs.ioSummarize:tonga is a client for build distributed event driven app with Apache Kafka. It is based on the aiokafka.
Can be used with 0.9+ Kafka brokersOverview:Tonga defines components to help building an event-driven app:Model events / commands / resultsSerializer events / commands / resultsConsume events / commands / resultsProduce events / commands / resultsWith or without HTTP handlerAsyncioThe module provides some implementations:Avro schema serializerKafka consumer / producerSanic HTTP request handlerPattern:Getting started:
Package: tonggong
小雅·彤弓彤弓弨兮，受言藏之。我有嘉宾，中心贶之。钟鼓既设，一朝飨之。
彤弓弨兮，受言载之。我有嘉宾，中心喜之。钟鼓既设，一朝右之。
彤弓弨兮，受言櫜之。我有嘉宾，中心好之。钟鼓既设，一朝酬之。介绍通用工具集合环境安装make install格式化make fmt单元测试make test
Package: tongliao
通辽转换器！什么是 "通辽"”通辽“是 UP 主小约翰可汗来介绍国家使用的单位。因小约翰可汗过于出名变成了一个梗[点击观看视频]”通辽“简写 T, 为 59535 平方千米, 或者是 285.31 万人。Usage这里实现了一个通辽转换模块:fromtongliaoimportcountry2tongliaoimportpprintpprint.pprint(country2tongliao("中国")){'area':9600012,'area_str':'9600012 平方千米(km²)','name':'中国','result':{'area':161.25,'area_str':'161.25 通辽(T)','people':507.27,'people_str':'507.27 通辽(T)'},'people':1447301400,'people_str':'1447301400 人'}__all__=["TONGLIAO_AREA",# 通辽面积，单位平方千米"TONGLIAO_CHINESE",# 通辽单位中文 "通辽""TONGLIAO_ENGLISH",# 通辽单位英文 "T""TONGLIAO_PEOPLE",# 通辽人口"area2tongliao",# 输入平方千米数，转换为通辽"country2tongliao",# 输入国家名，转换为通辽"people2tongliao",# 输入人口数量，转换为通辽]同时还做了一个简陋的通辽转换 GUIpython3tongliao.py注意事项运行模块时会在当前目录下写入各个国家的信息的json文件"通辽" 绝对不只是人口单位、面积单位！如果有好像发的话发个 issues 吧!给个赞吧！脚注世界各国国土数据来源:https://www.kylc.com/stats/global/yearly_overview/g_area_surface.html世界各国人口数据来源:https://mip.phb123.com/city/renkou/rk.html国土数据共记录 214 个地区人口数据共记录 233 个地区最后有 197 个地区在两项数据中均有记录，其他一并过滤197 个地区中没有科索沃！科索沃永远是塞尔维亚的一部分国土数据中美国国土为 983 万平方千米，算上了领海面积。目前普遍为 937 万平方千米，已修正。收集的各国国土与人口数据难免会有遗漏，如有发现可以提出
Package: tongsuopy
tongsuo-python-sdkTongsuo-Python-SDK基于Tongsuo密码库, 为Python应用提供密码学原语和安全传输协议的支持，目前以支持中国商用密码算法和安全协议为主。SM2签名和验签，详见sm2_sign_verify.pyfromtongsuopy.cryptoimporthashes,serializationfromtongsuopy.crypto.asymciphersimportecmsg=b"hello"key=ec.generate_private_key(ec.SM2())pem=key.public_key().public_bytes(encoding=serialization.Encoding.PEM,format=serialization.PublicFormat.SubjectPublicKeyInfo,)pubkey=serialization.load_pem_public_key(pem)signature=key.sign(msg,ec.ECDSA(hashes.SM3()))pubkey.verify(signature,msg,ec.ECDSA(hashes.SM3()))SM3杂凑，详见sm3.pyfromtongsuopy.cryptoimporthashesh=hashes.Hash(hashes.SM3())h.update(b"abc")res=h.finalize()SM4-CBC加密，详见sm4_cbc.pyfromtongsuopy.crypto.ciphersimportCipher,algorithms,modesc=Cipher(algorithms.SM4(key),modes.CBC(iv))enc=c.encryptor()ciphertext=enc.update(plaintext)ciphertext+=enc.finalize()SM4-GCM加密，详见sm4_gcm.pyfromtongsuopy.crypto.ciphersimportCipher,algorithms,modesc=Cipher(algorithms.SM4(key),modes.GCM(iv))enc=c.encryptor()enc.authenticate_additional_data(aad)ciphertext=enc.update(plaintext)ciphertext+=enc.finalize()安装pipinstalltongsuopy要求Python >= 3.6。功能特性支持SM2签名和验签支持SM3杂凑算法支持SM4加解密，包括ECB、CBC、OFB、CFB、CTR模式支持SM4-GCM和SM4-CCM[TODO] TLCP协议支持交流群欢迎加入铜锁社区交流群，使用钉钉扫描二维码或者钉钉内搜索群号44810299。
Package: tongsuopy-crayon
tongsuo-python-sdkTongsuo-Python-SDK基于Tongsuo密码库, 为Python应用提供密码学原语和安全传输协议的支持，目前以支持中国商用密码算法和安全协议为主。SM2签名和验签，详见sm2_sign_verify.pyfromtongsuopy.cryptoimporthashes,serializationfromtongsuopy.crypto.asymciphersimportecmsg=b"hello"key=ec.generate_private_key(ec.SM2())pem=key.public_key().public_bytes(encoding=serialization.Encoding.PEM,format=serialization.PublicFormat.SubjectPublicKeyInfo,)pubkey=serialization.load_pem_public_key(pem)signature=key.sign(msg,ec.ECDSA(hashes.SM3()))pubkey.verify(signature,msg,ec.ECDSA(hashes.SM3()))SM2加密和解密，详见sm2_encrypt_decrypt_from_pem.pyfromtongsuopy.cryptoimportserializationfromtongsuopy.crypto.asymciphersimportecmsg=b"hello"key=ec.generate_private_key(ec.SM2())pem=key.public_key().public_bytes(encoding=serialization.Encoding.PEM,format=serialization.PublicFormat.SubjectPublicKeyInfo,)pubkey=serialization.load_pem_public_key(pem)ciphertext=pubkey.encrypt(msg)decrypt_text=key.decrypt(ciphertext)assertdecrypt_text==msgSM3杂凑，详见sm3.pyfromtongsuopy.cryptoimporthashesh=hashes.Hash(hashes.SM3())h.update(b"abc")res=h.finalize()SM4-CBC加密，详见sm4_cbc.pyfromtongsuopy.crypto.ciphersimportCipher,algorithms,modesc=Cipher(algorithms.SM4(key),modes.CBC(iv))enc=c.encryptor()ciphertext=enc.update(plaintext)ciphertext+=enc.finalize()SM4-GCM加密，详见sm4_gcm.pyfromtongsuopy.crypto.ciphersimportCipher,algorithms,modesc=Cipher(algorithms.SM4(key),modes.GCM(iv))enc=c.encryptor()enc.authenticate_additional_data(aad)ciphertext=enc.update(plaintext)ciphertext+=enc.finalize()安装pipinstalltongsuopy要求Python >= 3.6。功能特性支持SM2加密和解密支持SM2签名和验签支持SM3杂凑算法支持SM4加解密，包括ECB、CBC、OFB、CFB、CTR模式支持SM4-GCM和SM4-CCM[TODO] TLCP协议支持交流群欢迎加入铜锁社区交流群，使用钉钉扫描二维码或者钉钉内搜索群号44810299。
Package: tongueswitcher
TongueSwitcher v2TongueSwitcher was designed to be a code-switching identification system for German-English. It is mostly rule-based, using specially created wordlists for most of the heavy-lifting. It is therefore fast and efficient.Identification is performed at the word and sub-word level, and then the identity of still unknown words is computed by the nearest identified tokens.Usagefromtongueswitcher.executorimportExecutorts=Executor()sentences=["ich glaub ich muss echt rewatchen like i feel so empty was soll ich denn jetzt machen"]results=ts.tongueswitcher_detect(sentences)>>>[[{'lan':'D','pos':'PRON','token':'ich'},{'lan':'D','pos':'VERB','token':'glaub'},{'lan':'D','pos':'PRON','token':'ich'},{'lan':'D','pos':'AUX','token':'muss'},{'lan':'D','pos':'ADV','token':'echt'},{'breakdown':'re+watch+en','lan':'M','lans':'E+E+D','pos':'VERB','prefixes':{'lans':['E'],'text':['re']},'roots':{'lans':['E'],'text':['watch']},'suffixes':{'lans':['D'],'text':['en']},'token':'rewatchen'},{'lan':'E','pos':'SCONJ','token':'like'},{'lan':'E','pos':'PRON','token':'i'},{'lan':'E','pos':'VERB','token':'feel'},{'lan':'E','pos':'ADV','token':'so'},{'lan':'E','pos':'ADJ','token':'empty'},{'lan':'D.ILH','pos':'ADV','token':'was'},{'lan':'D','pos':'AUX','token':'soll'},{'lan':'D','pos':'PRON','token':'ich'},{'lan':'D','pos':'ADV','token':'denn'},{'lan':'D','pos':'ADV','token':'jetzt'},{'lan':'D','pos':'VERB','token':'machen'}]]LabelsTongueSwitcher v2 identifies words with the following acronyms:E = English
D = German
M = Mixed
NE = Named Entity
O = OtherWith possible subcategorizations:.ILH = Interlingual homograph
.B = Borrowed word
.HT = Hashtag
.E  = Emoji
.P  = PunctuationDependenciesOther than the wordlists, we used Flair for POS tagging and a finetuned RoBERTa model for binary named entity recognition.We used python version 3.7.CitationFor more detail, please refer to our paper:@inproceedings{sterner2023tongueswitcher,
  author    = {Igor Sterner and Simone Teufel},
  title     = {TongueSwitcher: Fine-Grained Identification of German-English Code-Switching},
  booktitle = {Sixth Workshop on Computational Approaches to Linguistic Code-Switching},
  publisher = {Empirical Methods in Natural Language Processing},
  year      = {2023},
}
Package: tongue-twister-play
Choose the first tongue twister.# This part isn't ready yet.Choose the next tongue twister.options = q(first_tongue_twister)And continue. To generate a whole play, do this.for tongue_twister in play():
    args = (tongue_twister['translation'],
            tongue_twister['language'],
            tongue_twister['original'])
    print('%s (%s: %s)' % args)
Package: tonic
Tonicis a tool to facilitate the download, manipulation and loading of event-based/spike-based data. It's like PyTorch Vision but for neuromorphic data!DocumentationYou can find the full documentation on Tonicon this site.A first exampleto get a feeling for how Tonic works.Run tutorials in your browserquick and easy.List of datasets.List of transformations.Aboutthis project.Release noteson version changes.Installpipinstalltonicor (thanks to@Tobias-Fischer)conda install -c conda-forge tonicFor the latest pre-release on the develop branch that passed the tests:pip install tonic --preThis package has been tested on:LinuxWindowsQuickstartIf you're looking for a minimal example to run, this is it!importtonicimporttonic.transformsastransformssensor_size=tonic.datasets.NMNIST.sensor_sizetransform=transforms.Compose([transforms.Denoise(filter_time=10000),transforms.ToFrame(sensor_size=sensor_size,time_window=3000),])testset=tonic.datasets.NMNIST(save_to="./data",train=False,transform=transform)fromtorch.utils.dataimportDataLoadertestloader=DataLoader(testset,batch_size=10,collate_fn=tonic.collation.PadTensors(batch_first=True),)frames,targets=next(iter(testloader))Discussion and questionsHave a question about how something works? Ideas for improvement? Feature request? Please get in touch on the #tonicDiscord channelor alternatively here on GitHub via theDiscussionspage!ContributingPlease check out thecontributionspage for details.SponsoringThe development of this library is supported byCitationIf you find this package helpful, please consider citing it:@software{lenz_gregor_2021_5079802,author={Lenz, Gregor andChaney, Kenneth andShrestha, Sumit Bam andOubari, Omar andPicaud, Serge andZarrella, Guido},title={Tonic: event-based datasets and transformations.},month=jul,year=2021,note={{Documentation available underhttps://tonic.readthedocs.io}},publisher={Zenodo},version={0.4.0},doi={10.5281/zenodo.5079802},url={https://doi.org/10.5281/zenodo.5079802}}
Package: tonic-api
OverviewThis library contains useful wrappers around the Tonic.ai API.UsageInstantiate the API wrapper using the following code:from tonic_api.api import TonicApi

# Do not include trailing backslash in TONIC_URL
api = TonicApi(TONIC_URL, API_KEY)Once instantiated, the following endpoints are available for consumption. Note that available endpoints and response types are limited. Available fields may be severely limited compared to the current Tonic API.TonicApi:
    get_workspace(workspace_id) => Workspace

Workspace:
    id => string
    name => string
    models => Model[]

    train(model_id) => new job ID
    get_trained_model_by_training_job_id(job_id) => TrainedModel (or None if training is not done)
    get_training_status_by_training_job_id(job_id) => TrainingJobStatus
    get_most_recent_trained_model_by_model_id => TrainedModel

    describe() => debugger helper for printing fields

Model:
    id => string
    name => string
    query => string
    parameters => {}
    encodings => {}

    describe() => debugger helper for printing fields

TrainedModel:
    id => string
    job_id => string
    model => Model

    sample(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided)
    sample_source(num_rows) => pandas DataFrame (defaults to 1 row if num_rows not provided). Note: NOT randomized. Upper limit is limited to row count in source.

    get_numeric_columns() => string[]
    get_categorical_columns() => string[]

    describe() => debugger helper for printing fields

TrainingJobStatus:
    state => string
    error => string[] or None
    tasks => {}

    current_epoch_progress() => dict or None

    describe() => debugger helper for printing fields