Saravanan666/pypi-org huggingface dataset:
Package: tinynarm
tinyNARMAbouttinyNARM is an experimental effort in approaching/tailoring the classical Numerical Association Rule Mining (NARM) to limited hardware devices, e.g., ESP32 microcontrollers so that devices do not need to depend on remote servers for making decisions. Motivation mainly lies in smart agriculture, where Internet connectivity is unavailable in rural areas.The current repository hosts a tinyNARM algorithm prototype initially developed in Python for fast prototyping.Detailed insightsThe current version includes (but is not limited to) the following functions:loading datasets in CSV format,discretizing numerical features to discrete classes,association rule mining using the tinynarm approach,easy comparison with the NiaARM approach.InstallationpipInstall tinyNARM with pip:pipinstalltinynarmUsageBasic runfromtinynarmimportTinyNarmfromtinynarm.utilsimportUtilstnarm=TinyNarm("new_dataset.csv")tnarm.create_rules()postprocess=Utils(tnarm.rules)postprocess.add_fitness()postprocess.sort_rules()postprocess.rules_to_csv("rules.csv")postprocess.generate_statistics()postprocess.generate_stats_report(20)Discretizationfromtinynarm.discretizationimportDiscretizationdataset=Discretization("datasets/sportydatagen.csv",5)data=dataset.generate_dataset()dataset.dataset_to_csv(data,"new_dataset.csv")NARM references[1] I. Fister Jr., A. Iglesias, A. Gálvez, J. Del Ser, E. Osaba, I Fister.Differential evolution for association rule mining using categorical and numerical attributesIn: Intelligent data engineering and automated learning - IDEAL 2018, pp. 79-88, 2018.[2] I. Fister Jr., V. Podgorelec, I. Fister.Improved Nature-Inspired Algorithms for Numeric Association Rule Mining. In: Vasant P., Zelinka I., Weber GW. (eds) Intelligent Computing and Optimization. ICO 2020. Advances in Intelligent Systems and Computing, vol 1324. Springer, Cham.[3] I. Fister Jr., I. FisterA brief overview of swarm intelligence-based algorithms for numerical association rule mining. arXiv preprint arXiv:2010.15524 (2020).[4] Stupan, Ž., Fister, I. Jr. (2022).NiaARM: A minimalistic framework for Numerical Association Rule Mining. Journal of Open Source Software, 7(77), 4448.Cite usFister Jr, I., Fister, I., Galvez, A., & Iglesias, A. (2023, August).TinyNARM: Simplifying Numerical Association Rule Mining for Running on Microcontrollers. In International Conference on Soft Computing Models in Industrial and Environmental Applications (pp. 122-131). Cham: Springer Nature Switzerland.LicenseThis package is distributed under the MIT License. This license can be found online athttp://www.opensource.org/licenses/MIT.DisclaimerThis framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!
Package: tinynet
tinynetA tiny neural network libraryNo trainingThis library provides no training algorithm. You can easily set up a neuroevolution framework by including any black-box search algorithm, fromRWG(see example below) toCMA-ES.Installationpip install tinynetUsagefromtinynetimportRNN1Limportnumpyasnpnet_struct=[3,5,2]net=RNN(net_struct)# try also FFNNnet.set_weights(np.random.randn(net.nweights))out=net.activate(np.zeros(net.ninputs))assertlen(out)==net.noutputsassertlen(net.state)==net.ninputs+1+net.noutputs# input, bias, recursionNeuroevolution application on the OpenAI GymCheck outthis GitHub gistto run the Bipedal Walker using pre-trained weights.The example below tackles the CartPole from scratch using RWG.importnumpyasnpimporttinynetimportgym# just `pip install gym`fromtimeimportsleep# slow down rendering# Environment setupenv=gym.make("CartPole-v1")# env = gym.wrappers.Monitor(env, 'video', force = True) # Uncomment to save video# Get input size and output size from the environmentnactions=env.action_space.nninputs=env.reset().size# Hidden layers are arbitrarily added# hidden = [20, 10, 20]hidden=[]# ... but unnecessary with the CartPolenet_struct=[ninputs,*hidden,nactions]# Network setup is straightforward (defaults: `act_fn=np.tanh, init_weights=None`)net=tinynet.FFNN(net_struct)# also try `RNN(net_struct)`# Get random seed for deterministic fitness (for simplicity)rseed=np.random.randint(1e10)# Fitness function: gameplay loopdeffitness(ind,render=False):env.seed(rseed)# makes fitness deterministicobs=env.reset()score=0done=Falsenet.set_weights(ind)whilenotdone:ifrender:env.render()sleep(0.5)action=net.activate(obs).argmax()obs,rew,done,info=env.step(action)score+=rewifrender:env.render()# render last frameprint(f"Score:{score}")returnscore# RWG does not distinguish between populations and generationsmax_ninds=1000# Neuroevolution (RWG) loopfornindinrange(max_ninds):ind=np.random.randn(net.nweights)score=fitness(ind)ifscore>=195:print(f"Game solved in{nind}trials")break# Replay winning individualfitness(ind,render=True)# You may want to drop into a console here to examine the resultsimportIPython;IPython.embed()
Package: tiny-net
tinyNetThis python3 package helps to create shorturl.Installtionpip install tiny-netHow to use it?import tinynet

url = 'http://sudhanshu.webrectifyers.in'

surl = tinynet.Link(url)

print(surl.show_url())License© 2021 Sudhanshu KumarThis repository licensed under the MIT license.
See LICENSE for more details.
Package: tinynetrc
Read and write .netrc files in Python.tinynetrcuses thenetrcmodule from the standard library under the hood and adds a few
improvements:Adds write functionality.Fixes a std libbugwith
formatting a .netrc file.*Parses .netrc into dictionary values rather than tuples.*This bug is fixed in newer versions of Python.Get it nowpip install tinynetrctinynetrcsupports Python >= 2.7 or >= 3.5.UsagefromtinynetrcimportNetrcnetrc=Netrc()# parse ~/.netrc# Get credentialsnetrc['api.heroku.com']['login']netrc['api.heroku.com']['password']# Modify an existing entrynetrc['api.heroku.com']['password']='newpassword'netrc.save()# writes to ~/.netrc# Add a new entrynetrc['surge.surge.sh']={'login':'sloria1@gmail.com','password':'secret'}netrc.save()# Removing an new entrydelnetrc['surge.surge.sh']netrc.save()You can also useNetrcas a context manager, which will automatically save~/.netrc.fromtinynetrcimportNetrcwithNetrc()asnetrc:netrc['api.heroku.com']['password']='newpassword'assertnetrc.is_dirtyisTrue# saved!LicenseMIT licensed. See the bundledLICENSEfile for more details.
Package: tinynn-py
TinynnTinynn is a lightweight neural network library built entirely in NumPy, designed to help developers understand the nitty-gritty details of neural networks. With its clean and concise code, Tinynn offers a great learning platform for those who want to deepen their understanding of the inner workings of neural networks.Despite its simplicity, Tinynn has all the key features of a neural network library, including support for feedforward and recurrent networks, various activation functions, and common optimization algorithms. Whether you're a student, researcher, or machine learning enthusiast, Tinynn is an excellent tool for experimenting with neural network architectures and training algorithms.Key FeaturesLightweight and easy-to-understand implementationSupport for feedforward and recurrent networksVarious activation functions to choose fromCommon optimization algorithmsBuilt entirely in NumPy for efficient numerical computationsInstallationTo install Tinynn, you can use pip:pipinstalltinynn-pyUsageHere's a basic example demonstrating how to create a feedforward neural network using Tinynn:fromtinynn.modelsimportSequentialfromtinynn.layersimportDenseimportnumpyasnpmodel=Sequential()X=np.array([[1,2,3],[5,4,3],[2,3,4]])y=np.array([0,0,1])model.add(Dense(3,64))model.add(Dense(64,2,activation='softmax'))model.compile_model(learning_rate=0.01,optimizer='adagrad')#Also available params: decay_rate,momentum(only for sgd) and optimizer = sgd,adagradmodel.fit(X,y,epochs=1000)ContributionsContributions to Tinynn are welcome! Whether you want to report a bug, suggest a new feature, or submit a pull request, please feel free to do so. Let's make Tinynn better together.LicenseTinynn is released under the MIT License. See the LICENSE file for more details.
Package: tinynpydb
Thetinynpydbprojecttinynpydb(tiny-en-py-db)is a tiny pickle-based numpy array database.InstallingFrom PyPIpip install tinynpydbSimply clone and from within the repopip install -e .QuickstartStarting a DB is easy:# import and create exampleimporttinynpydbastnpdbarray=[1,2,3]# start DB and dump array!npdb=tnpdb.NumPyDB('testnpdb',mode="store")npdb.dump(array,0)# retrieve array!loaded_array=npdb.load(0)print(loaded_array)Re-using a DB is easy too:# import and create exampleimporttinynpydbastnpdb# start DB in loading modenpdb=tnpdb.NumPyDB('testnpdb',mode="load")# retrieve array!loaded_array=npdb.load(0)print(loaded_array)That's pretty much all we do- This was inspired from SciTools NumpyDB implementation
[Scitools github repo](https://github.com/hplgit/scitools)
and we decided to mantain a tiny version of it.

We retain their choice of a 3-BSD License
Package: tinyobjloader
tinyobjloader, Wavefront .obj loadertinyobjloaderis a python wrapper for C++ wavefront .obj loader.tinyobjloaderis rather fast and feature rich than other pure python version of .obj loader.Quick tutorialimportsysimporttinyobjloader# Create reader.reader=tinyobjloader.ObjReader()filename="cornellbox.obj"# Load .obj(and .mtl) using default configurationret=reader.ParseFromFile(filename)ifret==False:print("Warn:",reader.Warning())pint("Err:",reader.Error())print("Failed to load : ",filename)sys.exit(-1)ifreader.Warning():print("Warn:",reader.Warning())attrib=reader.GetAttrib()print("attrib.vertices = ",len(attrib.vertices))print("attrib.normals = ",len(attrib.normals))print("attrib.texcoords = ",len(attrib.texcoords))materials=reader.GetMaterials()print("Num materials: ",len(materials))forminmaterials:print(m.name)print(m.diffuse)shapes=reader.GetShapes()print("Num shapes: ",len(shapes))forshapeinshapes:print(shape.name)print("num_indices ={}".format(len(shape.mesh.indices)))More detailed usagePlease take a look atpython/sample.pyfile in tinyobjloader git repo.https://github.com/syoyo/tinyobjloader/blob/master/python/sample.pyLicenseMIT license.TODOWriter saver
Package: tinyolap
TinyOlap is a light-weight, in-process, multi-dimensional, model-first OLAP
engine for planning, budgeting, reporting, analysis and many other numerical purposes.Although this sounds very complicated, TinyOlap is actually very easy to use and should
be suitable for all levels of Python and database skills.TinyOlap is also quite handy as a smart alternative to Pandas DataFrames when your data
is multidimensional, requires hierarchical aggregations or complex calculations.
Package: tiny-orm
tiny-ormA tinyORMfor SQLite.Installpipinstalltiny-ormUsageFollowing a basic tutorial to demonstrate how to use the ORM.Define aPostmodel in apost.pyfile.# post.pyfromtiny_ormimportModelclassPost(Model):text=str# other datatypes: int, floatdef__init__(self,text):self.text=textImportDatabaseto create a data access object.>>>fromtiny_ormimportDatabase>>>db=Database('db.sqlite')# indicating a database file.Import thePostmodel and link it to the database.>>>frompostimportPost>>>Post.db=db# see another approach in tests.pyCreate a post and save it in the staging area (without commit) of database.>>>post=Post('Hello World').save()>>>print(post.id)# auto generated id1Change the hello world post and update it in the database.>>>post=Post.manager().get(id=1)>>>post.text='Hello Mundo'>>>post.update()>>>post.textHelloMundoCommit all staged operations (saveandupdate) to the database.>>>db.commit()Delete the object and commit.>>>post.delete()>>>db.commit()Create a manager that can perform CRUD operations in the database.>>>objects=Post.manager(db)Save and get a post.>>>objects.save(Post('Hello','World'))>>>objects.get(2)# get by id from the staging area{'text':'World','id':2,'title':'Hello'}Close the database without commit the changes>>>db.close()Get all posts from database.>>>list(objects.all())# return a "empty" generator[]LinterCheck code lint:pipinstallpylint
pylintorm.pyContributingSeeCONTRIBUTING.LicenseThe MIT License.
Package: tinypath
Tinypath is a tiny file path module that provides only the most crucial
and commonly needed functionality, including turning files and folders
into classes. Designed as a companion module for projects that require
handling arbitrary paths from users without breaking, and easy
navigation of local file systems.By staying tiny in both size and functionality, the API is easy to learn
so you can start using it right away. Essentially, it provides
object-oriented access to files and folders with several convenient
attributes such as checking file or folder size, handling a lot of the
intricacies of os.path behind the scene so you do not have to.PlatformsTested on Python version 2.x.DependenciesPure Python, no dependencies.Installing itTinypath is installed with pip from the commandline:pip install tinypathMore Information:Home PageAPI DocumentationLicense:This code is free to share, use, reuse, and modify according to the MIT
license, see license.txtCredits:Karim Bahgat (2015)Changes0.1.1 (2015-12-11)Lowercased package name0.1.0 (2015-06-26)First pypi release
Package: tinyPeriodicTask
Simple periodic execution of a function at every laps
of time or every day at specifique time.The interval time is running in a deamon thread. This to ensure
the time has no interference to the main execution, and vice versa.By design, when you start a tinyPeriodicTask instance,
the runner will delay the first call to the callback function
according to the interval.When you create an instance of TinyPeriodicTask, you can add
any parameters you need to use when executing the callback. like this:
Package: tinypipe
TinyPipeTinyPipeis a lightweight library that facilitates the application of the Pipeline Pattern. A pipeline has a general form as follows:|---|    |----|    |- -|    |----|    |---|
... -> | Q | -> | OP | -> | Q | -> | OP | -> | Q | -> ...
       |---|    |----|    |---|    |----|    |---|As data flows through the pipeline, it is first fed into the input queue (denoted asQabove). The following operation unit (OP) grabs it and produces a result, which is then fed into its output queue. This process continues until the data encounters a terminatingOPwhich has no output queue.Building blocks are provided for pipeline construction, where each operation unit (represented byPipe), owns a threads and runs individually. AParallelPipeis also included for an operation to run with multiple threads. See the documentation for detail.SetupPython version: 3.6+ (other versions not tested, feel free to try it out!)To installTinyPipe:$pipinstalltinypipeUsageSuppose every data has to go through the functionsf1,f2, andf3in sequence. The pipeline can be constructed by:importtinypipeastp# 1. Create pipelinepipeline=tp.Pipeline()# 2. Append pipes to pipelinef1_pipe=tp.pipe.FunctionPipe(f1)pipeline.append(f1_pipe)f2_pipe=tp.pipe.FunctionPipe(f2)pipeline.append(f2_pipe)f3_pipe=tp.pipe.FunctionPipe(f3)pipeline.append(f3_pipe)# One can call `pipeline.extend([f1_pipe, f2_pipe, f3_pipe])` instead# 3. Build & start the pipeline# Once the pipeline is started, it will keep trying to get data to process## The following `pipeline.build()` call is optional. `pipeline.start()` will# make the call if it is not called.## pipeline.build()pipeline.start()# 5. Feed data into the pipelinedata_iterator=...fordataindata_iterator:pipeline.put(data)# 6. If all the data has been passed into the pipeline,#    wait for it to finish all the work.pipeline.join()
Package: tinypipeline
tinypipelineOverviewtinypipelineis a tiny mlops library that provides a simple framework for organizing your machine learning pipeline code into a series of steps. It does not handle networking, I/O, or compute resources. You do the rest in your pipeline steps.Installation$ pip install tinypipelineUsagetinypipelineexposes two main objects:pipeline: a decorator for defining your pipeline. Returns aPipelineinstance.step: a decorator that is used to define individual pipeline steps. Returns aStepinstance.Each object requires you provide aname,version, anddescriptionto explicitly define what pipeline you're creating.ThePipelineobject that is returned from the decorator has a single method:run().APIIf you'd like to use this package, you can follow theexample.pybelow:fromtinypipelineimportpipeline,step# define all of the steps@step(name='step_one',version='0.0.1',description='first step')defstep_one():print("Step function one")@step(name='step_two',version='0.0.1',description='second step')defstep_two():print("Step function two")@step(name='step_three',version='0.0.1',description='third step')defstep_three():print("Step function three")@step(name='step_four',version='0.0.1',description='fourth step')defstep_four():print("Step function four")# define the pipeline@pipeline(name='test-pipeline',version='0.0.1',description='a test tinypipeline',)defpipe():# run the steps in the defined orderreturn[step_one,step_two,step_three,step_four,]pipe=pipe()pipe.run()You can also define steps using a dictionary, where each key of the dictionary
is a step to run, and the values are steps that run after the step named in the key.# define the pipeline@pipeline(name='test-pipeline',version='0.0.1',description='a test tinypipeline',)defpipe():# run the steps in the defined order of the graphreturn{step_one:[step_two,step_four],step_two:[step_three,step_four]}Output:You can run theexample.pylike so:$pythonexample.py+-------------------------------------------------------------------+| Running pipeline: Pipeline(name='test-pipeline', version='0.0.1') |+-------------------------------------------------------------------+Running step [step_one]...Step function oneStep [step_one] completed in 0.000325 secondsRunning step [step_two]...Step function twoStep [step_two] completed in 0.000286 secondsRunning step [step_three]...Step function threeStep [step_three] completed in 0.000251 secondsRunning step [step_four]...Step function fourStep [step_four] completed in 0.000313 secondsRunning testsTests are run using pytest. To run the tests you can do:$pipinstallpytest$pytest
Package: tinypng
Python module and command line tool fortinypng.comShrink PNG files. Advanced lossy compression for PNG images that
preserves full alpha transparency. Now also works with JPEG files.Note: This project is not affiliated withtinypng.comorVoormedia
B.V.Important: You require an API key which you may obtain fromtinypng.com/developers.Besides specifying keys via command line arguments you can:Set the environment variable TINYPNG_API_KEYCreate a .tinypng.keys file in your home directoryCreate a tinypng.keys file in the current directoryProgramatic apifrom tinypng import shrink_file

# implicitly writes to "your_file.tiny.png"
shrink_info = shrink_file("your_file.png", api_key='your_key_here')

shrink_info = shrink_file(
    "your_input_file.png",
    api_key='your_key_here',
    out_filepath="your_output_file.png"
)

shrink_info == {
    "output": {
        "type": "image/png",
        "filepath": "/path/your_input_file.png",
        "size": 36988,
        "ratio": 0.8279,
        "url": "https://api.tinypng.com/output/abcdefg123456.jpg"
    },
    "url": "https://api.tinypng.com/output/abcdefg123456.jpg",
    "compression_count": "123",
    "input": {
        "type": "image/png",
        "size": 44679
    }
}
Package: tinyprofiler
tinyprofilerTiny Profiler is a sub 200 line profiling utility that records telemetry from your app,
provides metrics and a flame graph to help debug latency and throughput.InstallationpipinstalltinyprofilerUsagefromtinyprofilerimportObserverobserver=Observer()@observer.profile()defyour_function():# do somethingAPIObserverObserver(num_samples: int = 10, enabled: bool = True)num_samples(optional): The number of samples to collect. You can configure how many samples to collect during profiling. The default is 10.enabled(optional): You can enable or disable profiling using this parameter. By default, profiling is enabled (True).Observer.profile(decorator)profile(self, trace: str = '__main__', parent: bool = False) -> None:trace(optional) - the trace to group functions togetherparent(optional): Set this to True if you want to treat the decorated function as a parent node in the flame graph hierarchy.
Package: tinyprompt
tinypromptA tiny lib for nice, handy prompts, primarily for Ops scripts.This README contains all documentation.Usagepip install tinypromptUsetinyprompt.skippableto wrap script steps with aYes / Skip / Quitprompt. This is very useful for simple scripted operations where
-yesis the normal case
-skipcan be used to resume after a failure or abort
-quitis used to abort when issues are encounteredimporttinyprompt# note: tinyprompt.skippable passes arguments through verbatim, but it's# not guaranteed to return a meaningful result# `quit` does a sys.exit(1) and `skip` makes it return `None`@tinyprompt.skippable('skippable script step')defmy_func():"""
    Do some things, this docstring will show up as a command description
    when the script is run.
    The "skippable script step" arg will be uppercased and used as the step
    name.
    """print('this skippable step')@tinyprompt.skippable('other skippable script step',color=False)defmy_func2():"""another func"""print('hi')defotherfunc():# yes, it's on purposetinyprompt.color_print('red string',tinyprompt.RED)tinyprompt.color_print('yellow string',tinyprompt.BLUE)tinyprompt.color_print('green string',tinyprompt.GRAY)tinyprompt.color_print('blue string',tinyprompt.GREEN)tinyprompt.color_print('gray  string',tinyprompt.YELLOW)defmain():my_func()# skippablemy_func2()# skippableotherfunc()# not skippable, but not reached on quitif__name__=='__main__':main()ContributingAll code must passmake testAll code is autoformatted withblackandisortTry to write a test whenever you find a bugMake your PRs clean. Rebase to avoid merge conflicts and squash fixup commits
Package: tiny-proxy
tiny-proxySimple proxy (SOCKS4(a), SOCKS5(h), HTTP tunnel) server built withanyio.
It is used for testingpython-socks,aiohttp-socksandhttpx-sockspackages.RequirementsPython >= 3.7anyio>=3.6.1Installationpip install tiny-proxyUsageimportanyiofromtiny_proxyimportSocks5ProxyHandlerasyncdefmain():handler=Socks5ProxyHandler(username='user',password='password')listener=awaitanyio.create_tcp_listener(local_host='127.0.0.1',local_port=1080)awaitlistener.serve(handler.handle)if__name__=='__main__':anyio.run(main)
Package: tinypub-HakierGrzonzo
# tinyPub.py![This thing in action](Screenshot.png)A simple, [py_cui](https://github.com/jwlodek/py_cui) based, terminal ebook reader for .epub files.` pip installtinypub-HakierGrzonzo`and then you should be able to use it with:` tinypub <path to file> `Features:Your cursor should be exactly where you left it, as your progress is tracked in ~/.tinypub.json fileYou can create short notes, and quickly jump to them.Somewhat scalable interface. I mean, it works on startup…In house parser forHTMLthat can use css to format text.## How to use:Run it with your ebook’s epub file as an artgument.On the bottom of your screen you will see help messages.You can use cursor keys to move the cursor, you can use “k” and “j” keys to jump to next paragraph break.You can use “h” and “l” keys to switch between chapters.Pressing “t” opens up Table of Contents.Pressing “a” allows you to add a note at cursor.