Saravanan666/pypi-org huggingface dataset:
Package: thePerfectlyJustSociety
The Perfectly Just SocietyThe Perfectly Just Society is an experiment in equality and equity. It aims to simulate an idealist society where everyone is treated equally to see how opportunities are given and wealth is dispersed.InstallationPyPI (for use as a module)pipinstallthePerfectlyJustSocietyGitHubclonehttps://github.com/ryanlague/thePerfectlyJustSociety.gitcdthePerfectlyJustSociety
pipinstall.UsageWeb Apppython3server.py# Dash is running on http://127.0.0.1:8050/python3server.py--port8051# Run on port 8051python3server.py--help# A full list of parametersCLI# Runs some coin flips and displays a Pandas DataFrame of the resultspython3cli.py# Runs 1000 coin flips over a population of 1000 people starting with $100 each.# Each flip has a wager of $1 and we allow people to go into debt instead of stopping if they reach $0.# A plot will be displayed after every 100 flipspython3cli.py--numFlips=1000--numPeople=1000--startMoney=100--dollarsPerFlip=1--allowDebt--plot--plotEvery=100# Show a complete list of a parameters and exitpython3--helpAs a modulefromthePerfectlyJustSocietyimportCoinFlipper,Population# A Population of Peoplepop=Population()# Add 1000 people to the population and give them each $100pop.add(1000,100)# A Coin Flipperflipper=CoinFlipper(pop)# Flip a coin 1000 times to simulate "opportunities" and plot the results after every 10th flipflipper.flip(1000,plotEvery=10)# Plotsflipper.population.plot(kind='topXPercentRanges',title=f'Population after{len(flipper.flips):,}flips (Total: ${flipper.population.totalMoney:,})')flipper.population.plot(kind='distribution',title=f'Wealth Distribution after{len(flipper.flips):,}flips (Total: ${flipper.population.totalMoney:,})')ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update tests as appropriate.LicenseMIT LicenseCopyright (c) 2022 Ryan LaguePermission 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: thepipe
A simplistic, general purpose pipeline framework, which can easily be
integrated into existing (analysis) chains and workflows.Installationthepipecan be installed viapip:pip install thepipeFeaturesEasy to use interface and integration into existing workflowsAutomatic provenance tracking (setProvenance().outfileto dump it upon
program termination)Modules can be either subclasses ofModuleor bare python functionsData is passed via a simple Python dictionary from module to module (wrapped
in a class calledBlobwhich adds some visual candy and error reporting)Integrated hierarchical logging systemColour coded log and print messages (self.log()andself.cprint()inModules)Performance statistics for the whole pipeline and each module individuallyClean exit when interrupting the pipeline with CTRL+CThe PipelineHere is a basic example how to create a pipeline, add some modules to it, pass
some parameters and drain the pipeline.Note that pipeline modules can either be vanilla (univariate) Python functions
or Classes which derive fromthepipe.Module.importthepipeastpclassAModule(tp.Module):defconfigure(self):self.cprint("Configuring AModule")self.max_count=self.get("max_count",default=23)self.index=0defprocess(self,blob):self.cprint("This is cycle #%d"%self.index)blob['index']=self.indexself.index+=1ifself.index>self.max_count:self.log.critical("That's enough...")raiseStopIterationreturnblobdeffinish(self):self.cprint("I'm done!")defa_function_based_module(blob):print("Here is the blob:")print(blob)returnblobpipe=tp.Pipeline()pipe.attach(AModule,max_count=5)# pass any parameters to the modulepipe.attach(a_function_based_module)pipe.drain()# without arguments it will drain until a StopIteration is raisedThis will produce the following output:2020-05-2612:43:12++AModule:ConfiguringAModulePipelineandmoduleinitialisationtook0.001s(CPU0.001s).2020-05-2612:43:12++AModule:Thisiscycle#0Hereistheblob:Blob(1entries):'index'=>02020-05-2612:43:12++AModule:Thisiscycle#1Hereistheblob:Blob(1entries):'index'=>12020-05-2612:43:12++AModule:Thisiscycle#2Hereistheblob:Blob(1entries):'index'=>22020-05-2612:43:12++AModule:Thisiscycle#3Hereistheblob:Blob(1entries):'index'=>32020-05-2612:43:12++AModule:Thisiscycle#4Hereistheblob:Blob(1entries):'index'=>42020-05-2612:43:12++AModule:Thisiscycle#52020-05-2612:43:12CRITICAL++AModule:That's enough...
2020-05-26 12:43:12 ++ AModule: I'mdone!============================================================5cyclesdrainedin0.001284s(CPU0.001475s).Memorypeak:27.01MBwallmean:0.000070smedi:0.000052smin:0.000042smax:0.000122sstd:0.000031sCPUmean:0.000070smedi:0.000052smin:0.000042smax:0.000124sstd:0.000032s
Package: theproofistrivial
TheProofIsTrivialPython port of the javascript based websiteTheProofIsTrivial.InstallationpipinstalltheproofistrivialUsagePython Libraryimporttheproofistrivialquote=theproofistrivial.QuoteGenerator()output=quote.create()print(output)The result is a list:['The proof is trivial! Just biject it to a',
 'combinatorial',
 'field',
 'whose elements are',
 'associative',
 'linear transformations']You can then process the list to make a single string or leave as is:# Single line stringoutput=" ".join(output)# Multi line stringoutput="\n".join(output)Command Linetheproofistrivial-husage: __main__.py [-h] [-o]

optional arguments:
  -h, --help     show this help message and exit
  -o, --oneline  show output as a single linetheproofistrivialThe proof is trivial! Just view the problem as a
computable
hypergraph
whose elements are
total
unbounded-fan-in circuitstheproofistrivial-oThe proof is trivial! Just biject it to an associative semigroup whose elements are perfect manifolds
Package: thepuzzlecell
The Puzzle Cell Client Python PackageThis package allows you to connect to TPC servers as a client and send packets.Available atPyPiDocumentationInstallTo use The Puzzle Cell Client, install it using pip:pip install thepuzzlecellQuickstartHere is a quick example:importthepuzzlecellasyncdeftest():connection=awaitthepuzzlecell.client("wss://tpc.milenakos.repl.co","2.0","Hello World Client")awaitconnection.send_packet("Hello")awaitconnection.send_packet("World!")foryinrange(0,10):awaitconnection.place(x=0,y=y,id="push")print(connection.get_packets())awaitconnection.close()asyncio.run(test())Easy, right?API and stuffthepuzzlecellclient(ip, version="2.0", client_id="PythonUser", auto_reconnect=False)creates aClient()and returns itClientis main classasyncconnect()does not take any arguments and runs on self variableslisten()runs a loop to listen for any incoming packets (interal; not recommended to use externally)asyncget(websocket)returns information from given websocketasyncsend_packet(data)send given information into self.websocketasyncclose()closes self.websocketget_packets(**wait_until_packet=False)gets packets collected bylisten()get_packet(**wait_until_packet=False)is an alias for itasyncplace(**x, **y, **id, **rot=0, **heat=0)places cellasyncbg(**x, **y, **bg="placeable")sets background (placeables)asyncsetinit(code)sets initial state on the serverasyncnew_hover(**uuid=self.client_id, **x, **y, **id, **rot=0)creates new hoverasyncset_hover(**uuid=self.client_id, **x, **y)sets the new hover positionasyncdrop_hover(uuid=self.client_id)removes the hoverasyncset_cursor(**uuid=self.client_id, **x, **y)sets cursor state
Package: thepysec
A collection of tools that support a busy project based on Python >= 3.8.JohnJohn is the Battler. He will serve the necessary files needed to run thepysec.LiaLia is here to take a detailed look at your strings.pop_wsp: Remove extra whitespace.pre_slug: Prepare a string to become a wise slug.'r33a!bc' -> 'r 33 abc'.fast_pre_slug: Prepare a string to become a fast slug.'r33a!bc' -> 'r 3 3 a bc'.cap_sentence: Carefully capitalize first letter and remove white space"O'Connor is        INVITED to UK" -> "O'Connor Is Invited To UK"MatinaMatina performs operations on django model instancespop_i18n_wsp: Applypop_wspfor a list of fields in a given model instance.MyriamMyriam a mathematical kind of jelly roll.validate_overlap: Receives a list of DateRange or DateTimeRange and examines if contents overlap.ThanosThanos is a Django test assistantget_formset_alive: Receives a formset class with data dictionary and returns a formset instance.OttoA pythonista who slightly bends the borders of the languagedeep_getattr: Dives in an object by performing successive getattrs for each word in a dotted string.deep_get: Dives in a dictionary by performing successive getats for each word in a dotted string.
Package: the-python-bay
InstallBasic UsageFull docssearchtop_moviestop_tvTorrentthe-python-bayPython library for searching thepiratebay.orgInstallpipinstallthe-python-bayBasic Usagefromthe_python_bayimporttpbresults=tpb.search("ubuntu")This will return the a list of instances of theTorrentclass.So you can then access the data like so:fortorrentinresults:print(f"{torrent.name}-{torrent.magnet}")Full DocssearchThis can be used to search thepiratebay.org, it will return a list of instances of theTorrentclass.fromthe_python_bayimporttpbresults=tpb.search("ubuntu")top_moviesCan be used to return the current top 100 movies on thepiratebay.orgfromthe_python_bayimporttpbresults=tpb.top_movies()top_tvCan be used to return the current top 100 tv on thepiratebay.orgfromthe_python_bayimporttpbresults=tpb.top_tv()TorrentTheTorrentclass is the format the torrents are returned in, it has the following attributes:namethe torrents namemagentthe torrents magnet linkseedersnumber of seeders the torrent hasusernamethe username of the torrents uploaderstatusthe users prominence statusTorrent also has the propertyto_dictthat can he used to return the dict of the the object. It can be used more generally:fromthe_python_bayimporttpbresults=tpb.search_dict("ubuntu")Or it can be used on a specificTorrentobject like so:fromthe_python_bayimporttpbresults=tpb.search("ubuntu")fortorrentinresults:print(torrent.to_dict)Or even more directly:torrent=Torrent(data)torrent.to_dict
Package: thera
TheraAPythonscript for building static HTML websites fromMarkdown text files, using theMakotemplate engine. Excellent support for blogs: allowsYAMLmetadata in the blog markdown files, can create anAtom-compatible RSS feed.Why use it?Simple: Requires one file to generate the site.Reliable: A static website of HTML files has almost nothing to break. Immune to theSlashdot effect.Secure: No database to break into. Fewer moving parts gives hackers fewer entry points into your website.Fast: Static pages are pre-compiled HTML, ready for display.Minimalist design reduces maintenance headaches.How to install itpip3 install theraHow to use itthera.py <markdown file(s)>Options-b --blog             Blog index template path.
-c --config           Configuration file path.
-h --help             Show help.
-r --rss              Blog RSS template path.
-s --static           Static directory paths (javascript, css).
-t --template         Page template file path.
-v --version          Show version number.YAMLYAML can be used in the markdown files:---
Title: Hello world
Date: 09 Apr 2018 07:00 AM -0400
Slug: hello
Summary: A new blog for tech, business, and other oddments.
---
Hello. This is a new blog with a focus on tech and business.Note: To generate an RSS feed the YAML date must include the offset from Coordinated Universal Time (UTC). In the example above, the offset is-0400.Template tagsBlog RSS XML page${articles}: A list of page data dictionaries (explained below).${now}: The current date/time in UTC.Blog index page: a list of articles${data}: A dictionary where the key is a year and the value is a list
of page data dictionaries (explained below) of articles for that year.All other pages${data}: Thepage data dictionarywith the following keys:content: The markdown page converted to HTML without the template applied.display-date: Allows the web pages to use a different date format than the YAML date.slug: The part of an URL identifying the page in human-friendly words. For example inhttps://seagrape.us/blog/space-race.html,space-raceis the slug. If a slug isn't in the YAML metadata, Thera uses the markdown file name.summary: The summary of an article. Can be used in the RSS feed or the blog index page.title: The web page title. If a title isn't in the YAML metadata, Thera uses the<h1>header.utc-date: The UTC version of the YAML date. Used in the RSS feed.Configuration fileA JSON or YAML configuration file is optional:NameUsageBUILD_DIRDirectory to store built HTML files. Default: 'build'.DISPLAY_DATE_FORMATHTML date format. Default: '%d %b %Y'.SOURCE_DATE_FORMATMarkdown date format. Default: '%Y-%m-%d %H:%M %z'.RSS_ARTICLE_COUNTNumber of blog articles in the RSS feed. Default: 50.RSS_DATE_FORMATRSS feed date format (must conform toRFC 822). Default: '%a %d %b %Y %H:%M %Z'.LinksProject pageRelease historyLicenseMIT License.Contact meSend bug reports and patches tocraig@seagrape.us.
Package: the_rack
the_rack========> A cachable collection with extension abilities## Install using pippip install the_rack## Usage example```pythonfrom the_rack import Rackclass Foo: passc = Rack()c['foo'] = lambda get: Foo()c['foo'] # Foo objectclass Bar:def __init__(self, foo): passc['bar'] = lambda get: Bar(get('foo'))c['bar'] # Bar objectassert c['bar'] == c['bar'] # Caching```The complete usage is explained [in the doc](doc.md).This code is licenced under [the MIT license](https://tleb.mit-license.org/).
Package: therapi
python-therapiTherapy to ease the pain of writing boilerplate JSON API consumers.Tired of writing the same code to consume JSON APIs, over and over? Let's solve that!Query a basic, public JSON APITo query any basic, public JSON API, we create our consumer class and inherit fromBaseAPIConsumer, as follows:fromtherapiimportBaseAPIConsumerclassMyAPIConsumer(BaseAPIConsumer):base_url="https://www.an-awesome-service.com/api"Now we can use this class to make API calls to different endpoints, as follows:consumer=MyAPIConsumer()result=consumer.json_request(method="get",path="items",params={"id":123})print(result)We would see, for example, this response:{"data":[{"name":"Laptop","price":239},{"name":"Printer","price":99}]}
Package: there
TherePrint the current filename and line.Example,where.pyimportthereimportthereashereprint(here)print('and')print(there)Thenpython where.pywill print:where.py:4
and
where.py:6replace print functionThereprovide a replacement for theprintfunction, that prepend the
filename and line.Example,where.pyfromthereimportprintprint('hi')print('there')Thenpython where.pywill print:where.py:3 hi
where.py:4 therethat's itThat's it (for now), non more, no less. I have plan – the usually never get
realised – to also have athere.indentthat return the indentation of the
current line.GotchasReturns the line where the__str__, or__repr__ofthereis computed.
Usually byprint. So it might be wrong. If you want to be sure (like when
usinglog) wrap it instr()Runs only on CPython likely. But anyway don't run it in production.
Package: the-real-django-wordpress
Models and views for reading a WordPress database. Compatible with WordPress version 3.5+.django-wordpress is a project ofISLand theSunlight Foundation.FeaturesRead-only models to protect your contentThis package isdesigned to be read-only. Writing is enabled by addingWP_READ_ONLY = Falseto settings.py. None of the WordPress specific logic is included while writing to the database so there is a good chance you will break your WordPress install if you enable writing.WordPress table prefixThe default table prefix iswp. To change the table prefix, addWP_TABLE_PREFIX = 'yourprefix'to settings.py.Multiple database supportAdded the ability to specify which database the WordPress content is coming from. Set it using theWP_DATABASEsetting. Defaults to “default”.Database routers need be set to:DATABASE_ROUTERS = ['wordpress.router.WordpressRouter']Default templatesDefault templates are provided only for development purposes so you can see content in your browser! Please override these with customized templates for your application.Export Management CommandswpexportDump published posts in WXR format.wpexportauthorsExport authors as CSV.Working With WordPress ModelsTen most recent published posts:Posts.objects.published()[:10]Posts taggedwordpress:Posts.objects.term("wordpress")Post attachments:for attachment in post.attachments():
    passPost tags:post.tags()Installationpip install the-real-django-wordpressAdd to INSTALLED_APPS in settings.py:'wordpress'Include the following in urls.py:url(r'^path/to/blog/', include('wordpress.urls')),
Package: the-real-django-wordpress-extras
A collection of useful, non-WordPress extensions for
django-wordpress (the real one).pip install the-real-django-wordpress-extrasAddwordpressextto INSTALLED_APPS in settings.py.Be sure to putwordpressextabovewordpressin urls.py:urlpatterns += patterns('',
    ...
    url(r'^blog/', include('wordpressext.urls')),
    url(r'^blog/', include('wordpress.urls')),
    ...
)Email sender is determined in the following order:settings.WPEXT_SENDERemail addresssettings.POSTMARK_SENDERif Postmark settings are configured and WPEXT_SENDER does not existsettings.ADMINSthe first admin email address, if POSTMARK_SENDER does not existFeaturesParse.ly Meta Template TagGenerate aParse.lymeta tag:{% parselymeta post %}Disqus Comment NotificationsIt’s the only feature for now! And it’s only half implemented!If you useDisqusfor comments, you can provide a
post-comment JavaScript hook to notify post authors of the new comment.
Here is some example JavaScript you can do enable comment notifications:var newComment = function(comment) {
    var url = window.location.href + "disqus/";
    var params = {
        id: comment.id,
        text: comment.text,
        csrfmiddlewaretoken: csrftoken  // you'll have to get this from somewhere
    };
    $.post(url, comment, function(data) {
        // don't really need to do anything
    });
};

var disqus_config = function() {
    this.callbacks.onNewComment = [function(comment) { newComment(comment); }];
};The comment endpoint is located at<path_to_blog>/<year>/<month>/<day>/<slug>/disqus/. It accepts the following POST parameters:idthe Disqus ID of the commenttextthe text of the commentcsrfmiddlewaretokena CSRF token, if protection is enabledRefer to theonNewCommentcallback on how to implement your own.Future versions will connect with the Disqus API to do various things.
Package: the-real-django-wordpress-py3
Models and views for reading a WordPress database. Compatible with WordPress version 3.5+.Forked fromhttps://github.com/jcarbaugh/django-wordpress/to add Django 2 support.FeaturesRead-only models to protect your contentThis package isdesigned to be read-only. Writing is enabled by addingWP_READ_ONLY = Falseto settings.py. None of the WordPress specific logic is included while writing to the database so there is a good chance you will break your WordPress install if you enable writing.WordPress table prefixThe default table prefix iswp. To change the table prefix, addWP_TABLE_PREFIX = 'yourprefix'to settings.py.Multiple database supportAdded the ability to specify which database the WordPress content is coming from. Set it using theWP_DATABASEsetting. Defaults to “default”.Database routers need be set to:DATABASE_ROUTERS = ['wordpress.router.WordpressRouter']Default templatesDefault templates are provided only for development purposes so you can see content in your browser! Please override these with customized templates for your application.Export Management CommandswpexportDump published posts in WXR format.wpexportauthorsExport authors as CSV.Working With WordPress ModelsTen most recent published posts:Posts.objects.published()[:10]Posts taggedwordpress:Posts.objects.term("wordpress")Post attachments:for attachment in post.attachments():
    passPost tags:post.tags()Installationpip install the-real-django-wordpress-py3Add to INSTALLED_APPS in settings.py:'wordpress'Include the following in urls.py:url(r'^path/to/blog/', include('wordpress.urls')),
Package: therepy
therepyA simpler-lib/herefor python, to make file path management less of a headache in project-oriented workflows.InstallationpipinstalltherepySee pypi for detailsOverviewR's here library uses the .Rproj file to identify the top-level or root directory in an R project, and all file paths are defined relative to this directory.Instead of looking for a specific file or file extension, thetherepymodule has the user define the root directory somewhere ("there", if you will):fromtherepyimportHerehere=Here("myproj")Once initialized, theHereobject allows you to specify file paths relative to the defined root directory (in this example, "myproj"), since it coverts them to absolute paths under the hood.For example, if I have a dataset in a subfolder, "myproj/database/data.csv", and I want to use it in a script, "myproj/analysis/viz.py", I can specify the path like so:# -- viz.py --fp=here.here("database","data.csv")print(fp)#> PosixPath("/home/user/Documents/myproj/database/data.csv")df=read_csv(fp)The relative paths are expanded into absolute paths, so the returned file path will work even if "viz.py" gets moved around.If you do not want to use your project's folder name to initializeHere, you can provide the name of a file that exists in your project's root or aglob style expressionidentifying such a file:here=Here(".git")here=Here("*.Rproj")Here is built onpathliband returns pathlib.Path instances by default (a PosixPath or WindowsPath depending on your system).This allows you to take advantage of pathlib's great features, like:here=Here("myproj")fp=here.here("database/data.csv")iffp.exists():...And since pathlib can resolve and join paths, you can easily define folders for reading and writing to:here=Here("myproj")outputs=here.here("outputs")print(outputs)#> PosixPath("/home/user/Documents/myproj/outputs")...df.to_csv(here.here(outputs,"data.csv"))Herewill return strings if you ask it too:here=Here("myproj")print(here.here(as_str=True))#> "/home/user/Documents/myproj"