Saravanan666/pypi-org huggingface dataset:
Package: richie
Richie, the best OpenSource CMS to build education portalsOverviewLearning Management Systems(LMS) are great tools for hosting and playing interactive online
courses and MOOCs.However, if you need to build a complete website with flexible content to aggregate your courses,
in several languages and from different sources,you will soon need a CMS.At "France Université Numérique", we wanted to build an OpenSource portal withPythonandDjango. That's why we builtRichieon top ofDjangoCMS, one of
the best CMS on the market, as a toolbox to easily create full fledged websites with a catalog of
online courses.Among the features thatRichieoffers out of the box:multi-lingual by default,advanced access rights and moderation,catalog of courses synchronized with one or moreLMSinstances,search engine based onElasticsearchand pre-configured to offer full-text queries,
multi-facetting, auto-complete,...flexible custom pages for courses, organizations, categories, teachers, blog posts,
programs (and their inter-relations),Extensible with any third-partyDjangoCMSplugin or any third-partyDjangoapplication.Discover RichieIf you're looking for a quick preview ofRichie, you can take a look and have a tour ofRichieon our dedicateddemo site.It is connected back-to-back with a demo of OpenEdX running onOpenEdX Docker.Two users are available for testing:admin:admin@example.com/adminstudent:edx@example.com/edxThe database is regularly flushed.Getting startedTake a look at ourdocumentationto get started with Richie.ContributingContributing guideRead ourcontributing guideto learn about our development process and get started developing onRichie.LicenseThis work is released under the MIT License (seeLICENSE).
Package: richie-openedx-sync
Richie Open edX Synchronization applicationOverviewThe aim of this Django application is to synchronize the Open edX courses to the Richie marketing site.
Whenever a course schedule or details are updated on Studio a hook is run that sends the updated information to Richie.
There is also a Django command that permit to synchronize all existing courses.InstallationInstructionsto install on a running Open edXdevstackInstructionsto install on a production grade Open edX using ansible -configurationOpen edX compatibilityThis app has been tested with Open edX Juniper, but it should run on newer versions.Making a releaseMaking a release is automated. The choice between a minor or a revision type of release is
determined by the presence of an addition, a change or a removal. A revision release is made
if only fixes are present in the changelog, otherwise a minor release is made.For example, to release and commit all changes:bin/release --commitIf you consider that the changelog contains breaking changes, you can force a major release
by passing the parameter--major.To release but without committing the changes:bin/release --majorTo release and committing the changes:bin/release --commitAfter merging release commits to the master branch, you can tag them automatically by running:bin/tag -cContributions / AcknowledgmentsFUN-MOOCfun-apps coursesRichieand onGithubLicenseThis work is released under the AGPL-3.0 License (seeLICENSE).
Package: rich-json-logs
ReadmeColored-logs is a command line tool written in Python that allows to visualize logs in a tabular format.By default it tries to parse json logs and extract the relevant columns passed as options. If a list of columns is not provided it uses the default value@timestamp,log.level,message. You can also use jsonpath to extract nested json columns (even with.in the column name) like@timestamp,log.logger,$.'log.origin'.'file.name',message. In case a column is not present in a json line, the value for that column will be filled with-instead.In case the logs are not json, it will avoid parsing the text and insert it as the last column of the table.You can either use the script to visualize logs from a file on your local filesystem with ndjson format (1 json per line)pythonmain.py-isample.logor otherwise read from Stdin using a pipe commandcatsample.log|pythonmain.py|less-rIn the first example, the python script already comes with a pager, while in the second example you need to use an external pager. Hereless -rsupports colored output.InstallYou need to install some required libraries that are listed on requirements.txtpipinstall-rrequirements.txtHelpIn order to see the list of supported options, you can issue the following command›pythonmain.py--helpUsage:main.py[OPTIONS]Options:-i,--input-pathTEXTInputpath-c,--columnsTEXTColumnstofilter--helpShowthismessageandexit.Kubectl pluginColored-logs can be used as a kubectl plugin by wrapping it in a bash script#!/bin/bash/usr/local/bin/kubectllogs$1-n$2--context$3\|pythonmain.py\|less-rI have attached the following script atbin/kubectl-rich.sh. In order to use it as a kubectl plugin, the following script needs to be added to the PATH environment variable.Finally it can be used as followingkubectlrich<pod-name><namespace><context>K9s pluginYou can also use the kubectl plugin here provided as aK9s pluginby adding the following entry to the~/.k9s/plugin.xmlfile. Once you are inside k9s on the Pod view, you can typectrl+jto use colored-logs to visualize logs in a tabular form.plugin:rich:shortCut:Ctrl-Jconfirm:falsedescription:"Logs (rich)"scopes:-pocommand:kubectlbackground:falseargs:-rich-$NAME-$NAMESPACE-$CONTEXT
Package: richlib
RichlibA simplified API for Raylib for use in education and to enable beginners to create 3d games.Current state: working, but untested alpha, API may change.UseRichlib is just a few classes that sit on top of Raylib Python CFFI.  Once you have imported Richlib you automatically get all of raylib.static
and raylib.pyray
and you could just copy any Raylib Python example code you find.  Then if you want to use Richlib's classes as well as Raylib you can.The normal way of using Richlib is not to write your own main game loop.  Instead, you set some variables to tell Richlib how you'd like
your game to be:from richlib import *

WIDTH=800
HEIGHT=640
CAMERA=rl.CAMERA_FIRST_PERSON
DATA_DIR="examples/models/resources/models/"

cube = Cube((0, 10, 0), (10, 20, 10), 'blue')Then you define some specially named methods:def draw():
    clear()
    cube.draw()

def update():
    cube.x = cube.x + 1
    if cube.x > 100:
        cube.x = -100Then you tell Richlib to run your methods in its game loop:run()Differences from Pygame ZeroWe don't have a special mode in the Mu editor like Pygame Zero does, and therefore it is necessary to add animportline to the start of
every program, and arun()line to the end.The underlying API, Raylib, is not object oriented like Pygame is.  The stuff added by Richlib is object oriented but you
might notice there is no proper equivalent of thescreenobject because Raylib doesn't have one.3D games are inherently more complex than 2D, e.g. there is no equivalent of the camera object for the 2d programmer
to worry about.To mitigate (3) as much as possible we do automate some stuff that you might expect to do manually in Pygame Zero.
Package: rich-LogConsole
rich-LogConsole一个实现了在一定高度自动滚动的rich日志组件，有两种刷新方式，建议配合Layout、Panel等组件使用。installpipinstallrich-LogConsoleupdatepipinstall--upgraderich-LogConsoleusefromrich_LogConsoleimportLogConsoleScroll,LogConsoleOverwritedemo见demo.pyLicense
Package: rich-logger
rich-loggerTable logger using Rich, aimed at Pytorch Lightning loggingFeaturesdisplay your training logs with prettyrichtablesdescribe your fields withgoal("higher_is_better" or "lower_is_better"),formatandnamea field descriptor can be matched with any regexa field name can be computed as a regex substitutionworks in Jupyter notebooks as well as in a command lineintegrates easily withPytorch LightningDemofromrich_loggerimportRichTablePrinterimporttimeimportrandomfromtqdmimporttrangelogger_fields={"step":{},"(.*)_precision":{"goal":"higher_is_better","format":"{:.4f}","name":r"\1_p",},"(.*)_recall":{"goal":"higher_is_better","format":"{:.4f}","name":r"\1_r",},"duration":{"format":"{:.1f}","name":"dur(s)"},".*":True,# Any other field must be logged at the end}defoptimization():printer=RichTablePrinter(key="step",fields=logger_fields)printer.hijack_tqdm()t=time.time()foriintrange(10):time.sleep(random.random()/3)printer.log({"step":i,"task_precision":i/10.0ifi<5else0.5-(i-5)/10.0,})time.sleep(random.random()/3)printer.log({"step":i,"task_recall":0.0ifi<3else(i-3)/10.0,"duration":time.time()-t,})printer.log({"test":i})t=time.time()forjintrange(5):time.sleep(random.random()/10)printer.finalize()optimization()Use it with PytorchLightningfromrich_loggerimportRichTableLoggertrainer=pl.Trainer(...,logger=[RichTableLogger(key="epoch",fields=logger_fields)])
Package: rich-menu
Rich MenuRich menu is a library that allows the quick and simple creation of cli menus, usingRichas a backend.InstallationInstallation is very simple, just run the following command in the terminal:pipinstallrich-menuBasic Usagefromrich_menuimportMenumenu=Menu("Option 1","Option 2","Option 3","Exit",)matchmenu.ask():case"Option 1":print("first option selected")case"Option 2":print("second option selected")case"Option 3":print("third option selected")case"Exit":exit()fromrich_menuimportMenumenu=Menu("X","O",color="blue",rule_title="Tic Tac Toe",align="center",panel_title="Choose your icon",selection_char="->",)selected=menu.ask(screen=False)
Package: rich-msa
rich-msaA simple module to render colorful Multiple Sequence Alignment withrichin the terminal.🔧 InstallingInstall therich-msapackage directly fromPyPiwhich hosts universal wheels that can be installed withpip:$pipinstallrich-msa💡 ExampleUse Biopython to load a MSA from an aligned FASTA file, and render it to the
terminal:importBio.AlignIOimportrichfromrich_msaimportRichAlignmentmsa=Bio.AlignIO.read("tests/data/swissprot-halorhodopsin.muscle.afa","fasta")viewer=RichAlignment(names=[record.idforrecordinmsa],sequences=[str(record.seq)forrecordinmsa],)panel=rich.panel.Panel(viewer,title="swissprot-halorhodopsin.muscle.afa")rich.print(panel)You should get an output similar to the following picture, scaled to your
terminal width:🪛 Command-LineIf you have therich-msalibrary installed from PyPI, you can use it directly
to view any alignment file, provided you haveBiopythoninstalled:$python-mrich_msa-itests/data/swissprot-halorhodopsin.muscle.afaUse the-fflag to change the file format from aligned FASTA (default) to
any alignment format supported by Biopython.💭 Feedback⚠️ Issue TrackerFound a bug ? Have an enhancement request ? Head over to theGitHub issue
trackerif you need to report
or ask something. If you are filing in on a bug, please include as much
information as you can about the issue, and try to recreate the same bug
in a simple, easily reproducible situation.🏗️ ContributingContributions are more than welcome! SeeCONTRIBUTING.mdfor more details.⚖️ LicenseThis library is provided under theMIT License.This project is in no way not affiliated, sponsored, or otherwise endorsed
by theoriginal Rich authors. It was developed
byMartin Larraldeduring his PhD project
at theEuropean Molecular Biology Laboratoryin
theZeller team.
Package: rich-pixels
Rich PixelsA Rich-compatible library for writing pixel images and other colourful grids to the
terminal.InstallationGetrich-pixelsfrom PyPI.pip install rich-pixelsBasic UsageImagesImage from a fileYou can load an image file from a path usingfrom_image_path:fromrich_pixelsimportPixelsfromrich.consoleimportConsoleconsole=Console()pixels=Pixels.from_image_path("pokemon/bulbasaur.png")console.print(pixels)Pillow image objectYou can create a PIL image object yourself and pass it in tofrom_image.fromrich_pixelsimportPixelsfromrich.consoleimportConsolefromPILimportImageconsole=Console()withImage.open("path/to/image.png")asimage:pixels=Pixels.from_image(image)console.print(pixels)Using this approach means you can modify your PILImagebeforehard.ASCII ArtYou can quickly build shapes using a tool likeasciiflow, and
apply styles the ASCII characters. This provides a quick way of sketching out shapes.fromrich_pixelsimportPixelsfromrich.consoleimportConsoleconsole=Console()# Draw your shapes using any character you wantgrid="""\xx   xxox   oxOx   Oxxx             xxxxxxxxxxxxxxxxxxx"""# Map characters to different characters/stylesmapping={"x":Segment(" ",Style.parse("yellow on yellow")),"o":Segment(" ",Style.parse("on white")),"O":Segment(" ",Style.parse("on blue")),}pixels=Pixels.from_ascii(grid,mapping)console.print(pixels)Using with TextualPixelscan be integrated intoTextualapplications just like any other Rich renderable.
Package: rich-simple-term-menu
fork ofhttps://github.com/IngoMeyer441/simple-term-menubut add a new parameter:print_entry_fnThis parameter allow you to control how to print each entry.example: userichto print textfromrich_simple_term_menuimportTerminalMenufromrich.consoleimportConsoleconsole=Console()options=["[bold gold1]entry 1","entry 2","entry 3"]# Add the new `print_entry_fn` to control how to print each entry!terminal_menu=TerminalMenu(options,print_entry_fn=lambdax:console.print(x,end=''))menu_entry_index=terminal_menu.show()print(f"You have selected{options[menu_entry_index]}!")
Package: richsmi
Rich-SMIA terminal based graphical GPU monitoring tool inspired by NVIDIA System Management Interface (a.k.a. nvidia-smi) and htop.Installingpip3installrichsmiUsageJust run the following command on your terminal:richsmi--loop0.5# where 0.5 is the time interval, in seconds.The MIT License (MIT)Copyright (c) 2022 urasakikeisukePermission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Package: rich-sparklines
Something like this:importosimportrandomimporttimefromrich.consoleimportConsolefromrich_sparklinesimportGraphconsole=Console()defmain():graph=Graph("connections",lambda:random.randint(0,20))whileTrue:graph.update()os.system("cls")console.print(graph)time.sleep(1)if__name__=="__main__":main()will produce something like this:
Package: richspot
Table of ContentsRichSpotNcspot discord rich presence add-onAssets NoticeInstalling / Running RichSpotThrough PyPiManuallyRunningRequirementsHow to obtain client id and authorization token?WARNING ⚠RichSpotNcspotdiscord rich presence add-onSincencspotdoesn’t implement spotify connect, we cannot share our listening activity in discord’s rich presence.
Thus usingRichSpotmakes it possible to do.Assets NoticeAssets will not be visible until they're cached this is a limitation of =discord=.
It will take atleast 10-15 min before they're visible.Installing / Running RichSpotThrough PyPipipinstallrichspotManuallypipinstall-rrequirements.txt
pipinstall.--userRunningrichspot&# Run in the backgroundRequirementsHow to obtain client id and authorization token?Go to discord developerspage.Create an application with a custom name.Getapplication idin generation info tab.Optionally upload a cover image for rich presence invite.Authorization Tokenis used to upload and delete song cover assets.Open developers tools (Inspect Elements) (F12)WARNING ⚠Do not share any keys with anyone unless you want to lose your account.
Package: rich-strawberry
Rich StrawberryThis is a work in progress!rich-strawberryis a small add-on for thestrawberry-graphqllibrary that usesrichto print error information nicely.Basic ExampleYou can use theRichLoggerExtensionto get improved traceback in your application. However, you'll need to disable the
default logger to avoid logging every exception twice.Here's a basic example:importloggingimportstrawberryfromrich_strawberryimportRichLoggerExtensionlogger=logging.getLogger("strawberry.execution")logger.disabled=True@strawberry.typeclassQuery:@strawberry.fielddefversion(self)->int:raiseValueErrorschema=strawberry.Schema(query=Query,extensions=[RichLoggerExtension()])This will give you the following output in the console for the queryquery { version }:ConfigurationSuppressing framesBy default, the logger uses afeaturefromrichto suppress the frames fromgraphqlandstrawberry-graphqllibraries. You can configure the list of modules for which the frames will be suppressed. For example, if you want the full traceback:importloggingimportstrawberryfromrich_strawberryimportRichLoggerExtension,RichGraphQLLoggerlogger=logging.getLogger("strawberry.execution")logger.disabled=True@strawberry.typeclassQuery:@strawberry.fielddefversion(self)->int:raiseValueErrordebug_logger=RichGraphQLLogger(suppress_traceback_from=[])schema=strawberry.Schema(query=Query,extensions=[RichLoggerExtension(logger=debug_logger)])Here's the full console output:Logging contextYou can also configure some values from the context to be logged on error.importloggingimportstrawberryfromrich_strawberryimportRichLoggerExtension,RichGraphQLLoggerlogger=logging.getLogger("strawberry.execution")logger.disabled=True@strawberry.typeclassQuery:@strawberry.fielddefversion(self)->int:raiseValueErrordebug_logger=RichGraphQLLogger(log_context_keys=("request",))schema=strawberry.Schema(query=Query,extensions=[RichLoggerExtension(logger=debug_logger)])This will userich.inspectto print that context value into the console:❗ This feature is not very well tested with different integrations so it might not work as expected.Using with subscriptionAt the moment of writing, subscriptions don't support extensions (checkthismerge request, maybe they already do!) So if you want to use theRichGraphQLLoggerfor your subscriptions, you'll need
to define a customSchemaclass and overwrite itsprocess_errorsmethod:fromtypingimportOptionalimportstrawberryfromstrawberry.typesimportExecutionContextfromgraphqlimportGraphQLErrorfromrich_strawberry.loggerimportRichGraphQLLoggerclassSchemaWithRichLogger(strawberry.Schema):def__init__(self,debug_logger:Optional[RichGraphQLLogger]=None,*args,**kwargs,):super().__init__(*args,**kwargs)self.debug_logger=debug_loggerorRichGraphQLLogger()defprocess_errors(self,errors:list[GraphQLError],execution_context:Optional[ExecutionContext]=None,)->None:self.debug_logger.print_errors(errors,execution_context)You can see a full example with subscriptionshere.Context values aren't logged for subscriptions.
Package: rich-tables
Rich tablesJSON human-prettifier based on the brilliantrichpython library.Since my usual day involves building and interacting with various APIs, JSON data
is constantly flying around the terminal. Reading JSON data (even when it's prettified by,
say,jq) requires a fair bit of mental effort; and it's basically impossible to analyze / make sense of it just by looking at it.This project initially started as a way to solve this issue - it takes JSON data as an
input and prints it in(rich-)tables, making it somewhat more readable for humans. With time,
it's become the main handler for most of structured data that gets displayed in my
terminal and is now one of my core every day tools.ReleasesIt's WIP but installable through pip:pip install rich-tables- feel free test it but
do not expect it to be stable yet.If we have enough interest, I am more than happy to prepare a release with a somewhat
stable API.Some bits to be aware ofMost commits are made by a daily cron jobYou will find commits namedAutomatic backup <date>There is a daily cronjob which checks my local copy of the repository for changes, commits
and pushes them upstream.It got setup because this entire thing got built without intention - whenever I came
across data that was not handled byrich-tables, I opened the code, quickly added the
logic and continued on with the original work without committing. Eventually, I'd have to
deal with a huge diff with a lot of unrelated changes.Tests simply attempt to render data in each test case without making any assertionsAt least at this point I only want to know whether every piece of data is rendered
fine.For eachtests/json/<name>.jsontest case, the rendered output is saved tosvgs/<name>.svgfileAllows to see the visual difference a certain change makesHelps to detect unintended side effects: if we're expecting an update ofalbum.svgonlybut see thatpr.svgis also updated, we know something's not rightIn commit details, GitHub shows visual difference forsvgfile changesThis is very helpful when one is trying to track down the culprit behind some missing borderREADME is populated with pictures dynamically when tests passOnce tests finish successfully, a subsection is added for every picture in thesvgs/folder (in the alphabetical order).case.svgwould be found under the subsectionCase.This logic lives ina session-scopedpytestfixture, after theyieldstatementExamplesAlbumCalendarEmailsHueJira diffNested JSONPrSimple JSONTasksTimed
Package: rich-text-renderer
Contentfulprovides a content infrastructure for digital teams to power content in websites, apps, and devices. Unlike a CMS, Contentful was built to integrate with the modern software stack. It offers a central hub for structured content, powerful management and delivery APIs, and a customizable web app that enable developers and content creators to ship digital products faster.This library provides rendering capabilities for theRichTextfield type. It is recommended to be used alongside theContentful Delivery SDK <https://www.github.com/contentful/contentful.py>.
By default this library will serializeRichTextfields into it’s corresponding HTML representation. All behaviour can be overridden to serialize to different formats.InstallationInstall Contentful Rich Text Renderer from the Python Package Index:pip install rich_text_rendererUsageCreate a renderer:from rich_text_renderer import RichTextRenderer

renderer = RichTextRenderer()Render your document:renderer.render(document)Using different renderersThere are many cases in which HTML serialization is not what you want.
Therefore, all renderers are overridable when creating arich_text_renderer.RichTextRenderer <rich_text_renderer.RichTextRenderer>.Also, if you’re planning to embed entries within your rich text, overriding the'embedded-entry-block'option is a must,
as by default it only does<div>str(entry)</div>.You can override the configuration like follows:renderer = RichTextRenderer({
    'embedded-entry-block': MyEntryBlockRenderer
})WhereMyEntryBlockRendererrequires to have arender(self, node)method and needs to return a string, also it requires to be initialized with adictcontaining mappings for all renderers.An example entry renderer, assuming our entry has 2 fields callednameanddescriptioncould be:from rich_text_renderer.base_node_renderer import BaseNodeRenderer

# BaseNodeRenderer implements the `__init__` method required.
class MyEntryBlockRenderer(BaseNodeRenderer):
    def render(self, node):
        entry = node['data']['target']

        return "<div class='my-entry'><h3>{0}</h3><p><small>{1}</p></small></div>".format(
            entry.name,
            entry.description
        )Dealing with unknown node typesBy default, this library will treat all unknown node types as errors and will raise an exception letting the user know which node mapping is missing.
If you wish to remove this behaviour then replace theNonekey of the mapping with aNullRendererthat returns an empty string, or something similar.An example would be like follows:class SilentNullRenderer(BaseNodeRenderer):
    def render(node):
        return ""

renderer = RichTextRenderer({
    None: SilentNullRenderer
})LicenseCopyright (c) 2018 Contentful GmbH. SeeLICENSEfor further details.ContributingFeel free to improve this tool by submitting a Pull Request.