Saravanan666/pypi-org huggingface dataset:
Package: tinycrashreporter
This library is designed to print any exceptions which a Python program encounters when it is run to standard out.Install:In terminal run ->pip3 install tinycrashreporterThis is enough to get the modlue working as it should. However, to run the samples and unit tests. Also…Navigate to the location that you want to keep the package.In terminal run ->pip download tinycrashreporterThen in the same folder…In terminal run->tar -xvzf tinycrashreporter-1.0.3.tar.gzto extract the downloaded files.You’re ready to get started!The library code also workes in Python 2.7 but there is not yet a PIP package for that one.Setup:Import both sys and the tinycrashreporter library into your program.Add the line ->sys.excepthook  = tinycrashreporter.crashReportExceptHook<- bellow your imports.In terminal run->Python3 ~/PythonFiles/MyTinyCrashReporterProgram.pyWarning: IDLE and other IDE’s appear to use the same method override as Tiny Crash Reporter and are not currently supported. Please run from a command line instead.Example:Add the following lines of code into a blank python file.#!/usr/bin/env python
# set up tiny crash reporter:
import sys
import (...any_other_module...)
import tinycrashreporter

sys.excepthook  = tinycrashreporter.crashReportExceptHook

# Add some crashy code
1/0Blank file:A blank file, which includes the code above and conforms to the specification has been included DownloadedPackageLocation/Samples/ImportedLibraryOnly.pyIn teminal run ->python3 ImportedLibraryOnly.pyFile with options:A file DownloadedPackageLocation/SamplesCrashyProgram.py has also been set up which supports the execution of code passed as an argument. This is for testing purposes and this code should not be published as part of a release project due to its inherent insecurities.In terminal run ->python3 CrashyProgram.pyUnit tests:8 Tests are available in DownloadedPackageLocation/Samples/CrashTest.py. To run these, open DownloadedPackageLocation/Tests/CrashTest.py manually edit the file path to point to DownloadedPackageLocation/Tests/CrashyProgram.py. Then…In terminal run ->python3 ~/SampleLocation/CrashTest.py -vOne of the tests requests user to input some crashy code. This facility doesn’t work with “ or ‘ characters and the inclusion of some other special characters may cause similar errors. More work is needed to properly escape the input. If in doubt, the default test will run on pressing enter.
Package: tiny_crash_reporter
This library is designed to print any crashes which a Python program encounters when it is run to standard out.Install:
pip install TinyCrashReporterSetup:
1. Import the library into your program.
2. Add the line -> sys.excepthook  = tinycrashreporter.crashReportExceptHook <- bellow oyu imports.
3. Run your program in the command line e.g. Python3 ~/PythonFiles/MyTinyCrashReporterProgram.pyWarning: IDLE and other IDE’s appear to use the same method override as Tiny Crash Reporter and are not currently supported. Please run in a command line instead.Example:
Add the following lines of code into a blank python file.
#!/usr/bin/env python
# set up tiny crash reporter:
import sysimport (…any_other_module…)import tinycrashreportersys.excepthook  = tinycrashreporter.crashReportExceptHook# Add some crashy code1/0Blank file:A blank file, which includes the code above and conforms to the specification has been included LibraryLocation/Samples/ImportedLibraryOnly.pyIn teminal run -> python3 ImportedLibraryOnly.py
The library also works in python 2.7.File with options:A file called CrashyProgram.py has also been set up which supports the execution of code passed as an argument. This is for testing purposes and this code should not be published as part of a release project due to it’s inherent insecurities.In terminal run -> python3 CrashyProgram.pyUnit tests:8 Tests are available in LibraryLocation/CrashTest.py to run these, manually edit the file path in CrashTest.py to point to CrashyProgram.py. Then…In terminal run -> python3 ~/SampleLocation/CrashTest.py -vOne of the tests requests user to input some crashy code. This facility doesn’t work with “ or ‘ characters and the inclusion of some other special characters may cause similar errors. More work is needed to properly escape the input.
Package: tinycrawler
An highly customizable crawler that uses multiprocessing and proxies to download one or more websites following a given filter, search and save functions.REMEMBER THAT DDOS IS ILLEGAL. DO NOT USE THIS SOFTWARE FOR ILLEGAL PURPOSE.Installing TinyCrawlerpipinstalltinycrawlerPreview (Test case)This is the preview of the console when running thetest_base.py.Usage examplefromtinycrawlerimportTinyCrawler,Log,Statisticsfrombs4importBeautifulSoup,SoupStrainerimportpandasaspdfromrequestsimportResponsefromurllib.parseimporturlparseimportosimportjsondefhtml_sanitization(html:str)->str:"""Return sanitized html."""returnhtml.replace("WRONG CONTENT","RIGHT CONTENT")defget_product_name(response:Response)->str:"""Return product name from given Response object."""returnresponse.url.split("/")[-1].split(".html")[0]defget_product_category(soup:BeautifulSoup)->str:"""Return product category from given BeautifulSoup object."""returnsoup.find_all("span")[-2].get_text()defparse_tables(html:str,path:str,strainer:SoupStrainer):"""Parse table at given strained html object saving them as csv at given path."""fortableinBeautifulSoup(html,"lxml",parse_only=strainer).find_all("table"):df=pd.read_html(html_sanitization(str(table)))[0].drop(0)table_name=df.columns[0]df.set_index(table_name,inplace=True)df.to_csv("{path}/{table_name}.csv".format(path=path,table_name=table_name))defparse_metadata(html:str,path:str,strainer:SoupStrainer):"""Parse metadata from given strained html and saves them as json at given path."""withopen("{path}/metadata.json".format(path=path),"w")asf:json.dump({"category":get_product_category(BeautifulSoup(html,"lxml",parse_only=strainer))},f)defparse(response:Response):path="{root}/{product}".format(root=urlparse(response.url).netloc,product=get_product_name(response))ifnotos.path.exists(path):os.makedirs(path)parse_tables(response.text,path,SoupStrainer("table",attrs={"class":"table table-hover table-condensed table-fixed"}))parse_metadata(response.text,path,SoupStrainer("span"))defurl_validator(url:str,logger:Log,statistics:Statistics)->bool:"""Return a boolean representing if the crawler should parse given url."""returnurl.startswith("https://www.example.com/it/alimenti"")deffile_parser(response:Response,logger:Log,statistics):ifresponse.url.endswith(".html"):parse(response)seed="https://www.example.com/it/alimenti"crawler=TinyCrawler(follow_robots_txt=False)crawler.set_file_parser(file_parser)crawler.set_url_validator(url_validator)crawler.load_proxies("http://mytestserver.domain","proxies.json")crawler.run(seed)Proxies are expected to be in the following format:[{"ip":"89.236.17.108","port":3128,"type":["https","http"]},{"ip":"128.199.141.151","port":3128,"type":["https","http"]}]LicenseThe software is released under the MIT license.
Package: tinycreeper
Tiny CreeperTiny Creeper is a CLI that automates putting linting and pre-commit hooks into your repo.  It currently supports:Python (black, 110 lines)R (lintr, styler) (Need help here...)Vue + JS + HTML + CSS (prettier, eslint)QuickstartTo install and use:pipinstalltinycreepercdyour_repo_root
tinycreeperinitThat's it.  To lint before pre-commit, runtinycreeperlintand for help runtinycreeper--helpCreepers are generally unobtrusive and are often indifferent to humans.Their bills are gently down-curved and rather long, used for probing bark for bugs.
Package: tinycss
tinycssis a complete yet simple CSS parser for Python. It supports the full
syntax and error handling for CSS 2.1 as well as some CSS 3 modules:CSS Color 3CSS Fonts 3CSS Paged Media 3It is designed to be easy to extend for new CSS modules and syntax,
and integrates well withcssselectfor Selectors 3 support.Quick facts:Free software: BSD licensedCompatible with Python 2.7 and 3.xLatest documentationon python.orgSource, issues and pull requestson GithubReleaseson PyPIInstall withpip install tinycss
Package: tinycss2
tinycss2 is a low-level CSS parser and generator written in Python: it can
parse strings, return objects representing tokens and blocks, and generate CSS
strings corresponding to these objects.Based on the CSS Syntax Level 3 specification, tinycss2 knows the grammar of
CSS but doesn’t know specific rules, properties or values supported in various
CSS modules.Free software: BSD licenseFor Python 3.7+, tested on CPython and PyPyDocumentation:https://doc.courtbouillon.org/tinycss2Changelog:https://github.com/Kozea/tinycss2/releasesCode, issues, tests:https://github.com/Kozea/tinycss2Code of conduct:https://www.courtbouillon.org/code-of-conductProfessional support:https://www.courtbouillon.orgDonation:https://opencollective.com/courtbouillontinycss2 has been created and developed by Kozea (https://kozea.fr).
Professional support, maintenance and community management is provided by
CourtBouillon (https://www.courtbouillon.org).Copyrights are retained by their contributors, no copyright assignment is
required to contribute to tinycss2. Unless explicitly stated otherwise, any
contribution intentionally submitted for inclusion is licensed under the BSD
3-clause license, without any additional terms or conditions. For full
authorship information, see the version control history.
Package: tiny-dag
Tiny DAGBare bones implementation of computation (directed, acyclic) graph for Python.RequirementsPython >= 3.6graphvizUsage examplefrom tinydag.graph import Graph
from tinydag.node import Node

add = lambda a, b: a + b
mul = lambda a, b: a * b
div = lambda a, b: a / b

nodes = [
    Node(["add1", "x"], add, "add2"),
    Node(["add1", "add2"], mul, "mul"),
    Node(["x", "y"], add, "add1"),
    Node(["mul", "z"], div, "div"),
]
graph = Graph(nodes)
graph.render()
data = {"x": 5, "y": 3, "z": 3}
results = graph.calculate(data)render method produces following figure:
Package: tinydav
This is a small library for contacting HTTP and WebDAV servers. Goal of this project until version 1.0 is supporting all WebDAV methods including the versioning extensions from RFC 3253).Features:HTTP methods OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, CONNECT.WebDAV methods MKCOL, PROPFIND, PROPPATCH, DELETE, COPY, MOVE, LOCK, UNLOCKSupport for REPORT method (verion-tree and expand-property, RFC 3253)CookiesSSLMultipart/form-data and application/x-www-form-urlencoded POST requestsThis version requires Python 2.5 or later (including Python 3.)
Package: tinydb
Quick LinksExample CodeSupported Python VersionsDocumentationChangelogExtensionsContributingIntroductionTinyDB is a lightweight document oriented database optimized for your happiness :)
It’s written in pure Python and has no external dependencies. The target are
small apps that would be blown away by a SQL-DB or an external database server.TinyDB is:tiny:The current source code has 1800 lines of code (with about 40%
documentation) and 1600 lines tests.document oriented:LikeMongoDB, you can store any document
(represented asdict) in TinyDB.optimized for your happiness:TinyDB is designed to be simple and
fun to use by providing a simple and clean API.written in pure Python:TinyDB neither needs an external server (as
e.g.PyMongo) nor any dependencies
from PyPI.works on Python 3.7+ and PyPy3:TinyDB works on all modern versions of Python
and PyPy.powerfully extensible:You can easily extend TinyDB by writing new
storages or modify the behaviour of storages with Middlewares.100% test coverage:No explanation needed.To dive straight into all the details, head over to theTinyDB docs. You can also discuss everything related
to TinyDB like general development, extensions or showcase your TinyDB-based
projects on thediscussion forum.Supported Python VersionsTinyDB has been tested with Python 3.7 - 3.11 and PyPy3.Example Code>>>fromtinydbimportTinyDB,Query>>>db=TinyDB('/path/to/db.json')>>>db.insert({'int':1,'char':'a'})>>>db.insert({'int':1,'char':'b'})Query Language>>>User=Query()>>># Search for a field value>>>db.search(User.name=='John')[{'name':'John','age':22},{'name':'John','age':37}]>>># Combine two queries with logical and>>>db.search((User.name=='John')&(User.age<=30))[{'name':'John','age':22}]>>># Combine two queries with logical or>>>db.search((User.name=='John')|(User.name=='Bob'))[{'name':'John','age':22},{'name':'John','age':37},{'name':'Bob','age':42}]>>># Apply transformation to field with `map`>>>db.search((User.age.map(lambdax:x+x)==44))>>>[{'name':'John','age':22}]>>># More possible comparisons:  !=  <  >  <=  >=>>># More possible checks: where(...).matches(regex), where(...).test(your_test_func)Tables>>>table=db.table('name')>>>table.insert({'value':True})>>>table.all()[{'value':True}]Using Middlewares>>>fromtinydb.storagesimportJSONStorage>>>fromtinydb.middlewaresimportCachingMiddleware>>>db=TinyDB('/path/to/db.json',storage=CachingMiddleware(JSONStorage))ContributingWhether reporting bugs, discussing improvements and new ideas or writing
extensions: Contributions to TinyDB are welcome! Here’s how to get started:Check for open issues or open a fresh issue to start a discussion around
a feature idea or a bugForkthe repositoryon Github,
create a new branch off themasterbranch and start making your changes
(known asGitHub Flow)Write a test which shows that the bug was fixed or that the feature works
as expectedSend a pull request and bug the maintainer until it gets merged and
published ☺
Package: tinydb-appengine
tinydb-appenginetinydb-appengineprovides TinyDB storage for App Engine. You can use JSON readonly.Installation$pipinstalltinydb-appengineUsagefromtinydbimportTinyDBfromtinydb_appengine.storagesimportEphemeralJSONStoragedb=TinyDB('your_data.json',storage=EphemeralJSONStorage)
Package: tinydb-constraint
tinydb-constraintApply constraints before inserting and updating TinyDB records.InstallationMethod 1:$ pip install tinydb-constraintMethod 2:Clone the project from GitHubGet poetryandpoetry install tinydb-constraint --path PATH/TO/TINYDB/CONSTRAINTUsage>>>fromtinydbimportTinyDB>>>fromtinydb_constraintimportConstraintTable>>>fromdatetimeimportdatetime>>>TinyDB.table_class=ConstraintTable>>>db=TinyDB('db.json')>>>db.set_schema({...'record_id':int,...'modified':datetime...})>>>db.schema{'record_id':Constraint(type_=int,unique=False,not_null=False),'modified':Constraint(type_=datetime.datetime,unique=False,not_null=False)}NoteI haven't modified the serialization yet, sodatetimetype will actually producedatetime.isoformat(), and to setdatetime, you have to pass adateutil.parser.parse()-parsable string.Advanced usageDatabase schema is also settable viaConstraintobject.>>>fromtinydb_constraintimportConstraint>>>db.set_schema({...'user_id':Constraint(type_=int,unique=True,not_null=True)...})If you want to disable certain string sanitization features, like stripping spaces or checking if string can be converted to datetime, this can be done by setting environmental variables.TINYDB_SANITIZE=0
TINYDB_DATETIME=0PlanAdd ForeignKey constraints.Related projectstinydb-viewer- View records generated from TinyDB and alike (e.g. list of dictionaries.)
Package: tinydb-dict
tinydb-dictSimple dict-like class for TinyDBUsagefromtinydbimportTinyDBfromtinydb.storagesimportMemoryStoragefromtinydb_dictimportTinyDBDict# Pass any TinyDB argument to TinyDBDictdb_dict=TinyDBDict('db.json')db_dict=TinyDBDict(storage=MemoryStorage)# Then use it as a dictionarydb_dict['key']=1db_dict['key']# 1db_dict['key']=2db_dict['key']# 2db_dict['unknown_key']# KeyError: 'unknown_key'# You can also pass a TinyDB instancedb=TinyDB('db.json')db_dict=TinyDBDict(tinydb=db)
Package: tinydb-encrypted-jsonstorage
tinydb-encrypted-jsonstorageA TinyDB storage implementation that stores values as encrypted json.RequirementsPythonTinyDBpycryptodomeOS Dependencies:python3, python3-venv, python3-pipGet Sourcesgit clonegit@github.com:stefanthaler/tinydb-encrypted-jsonstorage.gitcd tinydb-encrypted-jsonstoragepython3 -m venv .env. .env/bin/activate.fishpip install -r requirements.txtBuildfollow steps in "Get Sources"pip3 install -r requirements-building.txtpython setup.py bdist_wheelTestfollow steps in "Get Sources"pip3 install -r requirements-building.txtpython setup.py testInstallPippip install tinydb-encrypted-jsonstoragePip + Gitpip install git+git://github.com/stefanthaler/tinydb-encrypted-jsonstorag.git#egg=tinydb-encrypted-jsonstorageGit + Local PipFollow steps in "Build"pip install ./UseCreate databaseYou can use the encrypted storage by adding setting storage parameter of the TinyDB initializer to the EncryptedJSONStorage class.fromtinydbimportTinyDBimporttinydb_encrypted_jsonstorageastaeKEY="hello"PATH=".encrypted_db"db=TinyDB(encryption_key=KEY,path=PATH,storage=tae.EncryptedJSONStorage)Change encryption keyYou can change the encryption key of the storage by accessing the storage property of yourTinyDBdatabase.db=...db.storage.change_encryption_key("NEW_KEY"))Other operationsFor all the other operations, check theTinyDB manual.TODOdocumentation coverage + badgehttps://github.com/google/pybadgesThanksShields.io, for providing the github paypal and the MIT license button:https://shields.io/travis-ci.orgfor providing free continuous integration for open source projects.coveralls.iofor providing free continuous code coverage reporting for open source projects.
Package: tinydb-git
A storage backend for tinydb that stores database changes inside a git
branch.tinydb-gitlets you use any branch in a git repository as a backend fortinydb.hiro@wintermute:tmp$gitinitexampleInitializedemptyGitrepositoryin/tmp/example/.git/Every modification of the database results in a new commit:>>>importtinydb>>>fromtinydb_git.jsonimportJSONGitStorage>>>db=tinydb.TinyDB('example',storage=JSONGitStorage)>>>db.insert({'text':'first record'})1hiro@wintermute:example$gitlogcommitde9a07844783b8e420fce6f9568e126dd7779e74Updatedbytinydb-git0.1.dev1commit3b31825cf312cb5d42f792998faddf20b634c7d9Updatedbytinydb-git0.1.dev1Multipleinsert()calls result in a commit for each call. This can be
avoided by using atinyrecordtransaction:>>>fromtinyrecordimporttransaction>>>withtransaction(db.table('_default'))ast:...t.insert({'b':2})...t.insert({'c':3})...t.insert({'d':4})...>>>The result:hiro@wintermute:example$gitlogcommite02a3af06d7cd7eeb6990277777cc24d384249e8Updatedbytinydb-git0.1.dev1commitde9a07844783b8e420fce6f9568e126dd7779e74Updatedbytinydb-git0.1.dev1commit3b31825cf312cb5d42f792998faddf20b634c7d9Updatedbytinydb-git0.1.dev1Internally, data gets stored as json, withsort_keys=Trueandindent=2,
to make diffs pleasant to read and help with compression:hiro@wintermute:example$gitdiffmaster^masterdiff--gita/tinydb.jsonb/tinydb.jsonindexa27ff44..d9711f0100644---a/tinydb.json+++b/tinydb.json@@-2,6+2,15@@"_default":{"1":{"text":"first record"+},+"2":{+"b":2+},+"3":{+"c":3+},+"4":{+"d":4}}}\NonewlineatendoffileYAMLAlternatively, data can be stored as YAML, which allows things likedatetime-Instances to be represented correctly:>>>importtinydb>>>fromtinydb_git.yamlimportYAMLGitStoroage>>>db=tinydb.TinyDB('example',storage=YAMLGitStoroage)
Package: tinydb-jsonorm
A library based on jsonmodels that adds some ORM features and another few conveniences to TinyDB with Json storage and
tinydb-smartcache enabled.Free software: BSD licenseInstallationpip install tinydb-jsonormDocumentationhttps://tinydb-jsonorm.readthedocs.io/DevelopmentTo run the all tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.1.0 (2016-05-06)First release on PyPI.
Package: tinydb-serialization
tinydb-serializationprovides serialization for objects that TinyDB
otherwise couldn’t handle.UsageGeneral UsageTo use a serializer, create aSerializationMiddlewareinstance with
the storage class you want to use and register the serializers you want
to use. Then you pass the middleware instance as the storage to TinyDB:>>>fromtinydbimportTinyDB,Query>>>fromtinydb.storagesimportJSONStorage>>>fromtinydb_serializationimportSerializationMiddleware>>>fromtinydb_serialization.serializersimportDateTimeSerializer>>>>>>fromdatetimeimportdatetime>>>>>>serialization=SerializationMiddleware(JSONStorage)>>>serialization.register_serializer(DateTimeSerializer(),'TinyDate')>>>>>>db=TinyDB('db.json',storage=serialization)>>>db.insert({'date':datetime(2000,1,1,12,0,0)})>>>db.all()[{'date':datetime.datetime(2000,1,1,12,0)}]>>>query=Query()>>>db.insert({'date':datetime(2010,1,1,12,0,0)})>>>db.search(query.date>datetime(2005,1,1))[{'date':datetime.datetime(2010,1,1,12,0)}]Important:ASerializationMiddlewareinstance always wraps a database’s storage.
This means that theSerializationMiddlewareinstancecannotbe shared
between multipleTinyDBinstances as they would use the same underlying storage
instance and thus share all data between both instances.Provided Serializerstinydb_serialization.serializers.DateTimeSerializer: serializesdatetimeobjects
as ISO 8601 formatted stringsCreating Custom SerializersIn this example we implement a serializer fordatetimeobjects (like the one provided
by this package):fromdatetimeimportdatetimefromtinydb_serializationimportSerializerclassDateTimeSerializer(Serializer):OBJ_CLASS=datetime# The class this serializer handlesdefencode(self,obj):returnobj.isoformat()defdecode(self,s):returndatetime.fromisoformat(s)Changelogv2.1.1(2023-07-24)Fix VSCode Pylance type error (seepull request #14)Add support for storages that encode as binary strings (seepull request #17)Drop Python 3.7 supportv2.1.0(2021-01-23)Include theDateTimeSerializerin this package (seeissue #10)Drop Python 3.6 support (as 3.7 is needed for date parsing)v2.0.0(2020-05-26)Add TinyDB v4.0.0 support (seepull request #9)v1.0.4(2017-03-27)Don’t modify the original element if it contains a list (seepull request #5)v1.0.3(2016-02-11)Handle nested data (nested dicts, lists) properly when serializing/deserializing (seepull request #3)v1.0.2(2016-01-04)Don’t destroy original data when serializing (seepull request #2)v1.0.1(2015-11-17)Fix installation via pip (seeissue #1)v1.0.0(2015-09-27)Initial release on PyPI
Package: tinydb-smartcache
tinydb-smartcacheprovides a smart query cache for TinyDB. It updates the
query cache when inserting/removing/updating elements so the cache doesn’t get
invalidated. It’s useful if you perform lots of queries while the data changes
only a little.Installation$pipinstalltinydb_smartcacheUsage>>>fromtinydbimportTinyDB>>>fromtinydb_smartcacheimportSmartCacheTable>>>db=TinyDB('db.json')>>>db.table_class=SmartCacheTable>>>db.table('foo')>>># foo will now use the smart query cacheIf you want to enable TinyDB for all databases in a session, run:>>>fromtinydbimportTinyDB>>>fromtinydb_smartcacheimportSmartCacheTable>>>TinyDB.table_class=SmartCacheTable>>># All databases/tables will now use the smart query cacheChangelogv2.0.0(2020-08-25)Add support for TinyDB v4. Drops support for TinyDB <= 3 and Python 2.v1.0.3(2019-10-26)MakeSmartCacheTablework again after breakage with TinyDB v3.12.0v1.0.2(2015-11-17)Account for changes in TinyDB 3.0v1.0.1(2015-11-17)Fix installation via pipv1.0.0(2015-09-17)Initial release on PyPI