Saravanan666/pypi-org huggingface dataset:
Package: unfollow
Who Unfollowed MePython ImplementationAboutPython CLI tool that shows you who has unfollowed you on GitHub.Heavily inspired bymsaaddev/who-unfollowed-meInstallationpipinstallunfollowUsageThe first time you run the tool, you will be asked to enter your GitHub username. Subsequent runs will show any unfollowers, with names and links.I used this project to learn a lot aboutrich, thus I created numerous themes which you can use.unfollow- colored text and some panelsunfollow panels- colored text inside panelsunfollow bubbles- all text inside beautiful bubbles - requires a nerd fontunfollow simple- no colors or emojis, just plain text and a tableInspirationAs mentioned,msaaddev/who-unfollowed-mewas the reason I created this project and has been a great reference. While I love the project, three things stood out to me that I wanted to improve in my own implementation:The data files for the tool are not hidden and are stored in your current directory rather than the home directoryOutput looks good but a huge amount is self promotion rather than actual relevant info. (Please don't get me wrong, everyone can self promote as much as they like, I'm just talking about what I wanted to improve)If the tool is run without internet connection, the file that stores the username is erasedGalleryBubbles (w/nerd font)PanelsDevelopmentClone the repo and cd into it:git clone https://github.com/TechWiz-3/who-unfollowed-me.git
cd who-unfollowed-meEnsurepoetryis installed by running:pip install poetryRun:poetry installMake your changesTo test your changes, run:poetry run unfollowin project root directory🎉 Commit labelsIf you're interested in the commit labels used in this repo, check out mygit-commit-emojiproject
Package: unfollowery
UnfolloweryFor generating Instagram followers/unfollowers of the user in a list & file (without using Instagram API)Installpip install unfolloweryUsageExamplesImport the package and createProfileclass instance:fromunfolloweryimportProfile# Obviously change USERNAME and# PASSWORD with the real ones...user=Profile(username='USERNAME',password='PASSWORD)Get the list of current followers:followers=user.followers()Get the list of unfollowers since the last check:unfollowers=user.unfollowers()Getdict({[DATE]: [list(USERNAMES)]}) of all time unfollowers since the first check:all_time_unfollowers=user.unfollowery()Get unfollowersdict({[DATE]: [list(USERNAMES)}) from the specific date check:unfollowers_by_date=user.unfollowery(datekey='yyyymmdd')RECOMMENDED: Place your Instagram USERNAME and PASSWORD in the file (probably JSON) somewhere else and import it into your working file to not get displayed in the text editor.Class:ProfilePlease seeExamplesfor initializing Instagram user'sProfileclass object.Parameters:username(str): User's Instagram usernamepassword(str): The user's password stringsleep_time(float) - optional: Adjust waiting time (seconds) between some of the actions. It will still get randomized (~sleep_time).Default value = 5logs(bool) - optional: If set to True,SeleniumandChromedriverlogs will be displayed in the terminal.Default value = FalseMethods:followers()VSunfollowers()The methodunfollowers()WILL NOTreturn any usernames if[USERNAME]_latest_followers.csvfile does not exists.
If it existsunfollowers()will compare the usernames from[USERNAME]_latest_followers.csvto the current followers, updates (appends)[USERNAME]_unfollowery.csvand updates (overwrites)[USERNAME]_latest_followers.csv.However,followers()WILL ALWAYSreturn the list of the current Instagram followers.Either one of them will create(IF THE FILES DO NOT EXIST)both[USERNAME]_latest_followers.csv- the list of the current followers and[USERNAME]_unfollowery.csv- the empty file to be filled (in the future) with the users that have unfollowed you.NOTE: The more followers the user has, the more timefollowers()andunfollowers()methods take to work.Method:unfollowery()This method is for getting adict{[DATE]: [list(USERNAMES)}object which contains all time (since the first check) unfollowers.
However, one can give it a dateyyyymmddargument as written above in theExamplessection.Keep in MindThese methods may fail due to the updates on Instagram’s website, since it is crawler-based(Selenium)package, so if you encounter any problems, please open an issue or contact me.ContributingPull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Package: unformat
unformatPython string unformatter.Simple string pattern matching using f-string-like syntax.
This module cannot do anything more thanrebut is much easier to use.Installationpipinstall-UunformatUsageUnformatting returns alist-like object.fromunformatimportcompile,unformatunformat("{name}_{idx}.csv","data_001.csv")# Values(name='data', idx='001')unformat("{name}_{idx:int}.csv","data_001.csv")# Values(name='data', idx=1)unformat("{name}_{idx}.csv","data001.csv")# Error!name,idx=unformat("{name}_{idx}.csv","data_001.csv")# `Values` is list-like# object orientedptn=compile("{name}_{idx}.csv")ptn.unformat("data_001.csv")# Values(name='data', idx='001')Model-based unformatting is also supported.fromunformatimportUnformatModelclassVersion(UnformatModel):pattern="{major}.{minor}.{micro}"# not a fieldmajor:intminor:intmicro:intversion=Version.from_string("0.2.1")# Version(major=0, minor=2, micro=1)
Package: un-fstring
un-fstringSometimes, unfortunately, you need to write code that is compatible with Python 3.5
(e.g., to run on Ubuntu 16 or Debian 9, which will be supported
until April 2021 and June 2022, respectively).
Sometimes, even more unfortunately, you didn't know it needed to be when you
wrote it, and you need to make it compatible post-facto.The biggest syntax change going from 3.5 to 3.6 was the addition off-strings.Manypackagescan convert old-style string formatting methods into f-strings.un-fstringdoes the opposite: it converts f-strings into.format()calls
to preserve compatibility with Python 3.5.To convert your code, first installun-fstring(it itself requires Python 3.6 or later):$pipinstallun-fstringThen run it over your source code:$un-fstringpath/to/source/directoryanother_file.pyun-fstringwill replace f-strings with.format()calls in-place.The--dry-runoption will show a contextual diff
of whatun-fstringwould do to your code without actually overwriting it.
Runun-fstring --helpto see what other options are available.un-fstringis available as apre-commithook:-repo:https://github.com/JoshKarpel/un-fstringrev:v0.1.2hooks:-id:un-fstringun-fstringis not a code formatter;
I recommend runningblackover your code afterwards with the--target-version py35option enabled.Though potentially useful, this is mostly a toy project based on some problems
I ran into at work.
If you're looking for a more robust implementation, check outf2format.
Package: ungog
ungoogleify your cssinstallpip3 install ungogusageungogmycss main.css
[+] got https://fonts.googleapis.com/css?family=Gruppo|Scope+One
[+] got https://fonts.gstatic.com/s/gruppo/v7/uU5IFiQZ8WKPhrRfLBLURw.ttf
[+] replacing from:   src: local('Gruppo'), url(https://fonts.gstatic.com/s/gruppo/v7/uU5IFiQZ8WKPhrRfLBLURw.ttf) format('truetype');
[+] replacing to:     src: local('Gruppo'), url('fonts/gruppo.ttf') format('truetype');
[+] got https://fonts.gstatic.com/s/scopeone/v2/_52Fm41u4u2R3EEH0A9bn6CWcynf_cDxXwCLxiixG1c.ttf
[+] replacing from:   src: local('Scope One'), local('ScopeOne-Regular'),
    url(https://fonts.gstatic.com/s/scopeone/v2/_52Fm41u4u2R3EEH0A9bn6CWcynf_cDxXwCLxiixG1c.ttf)
    format('truetype');
[+] replacing to:     src: local('Scope One'), local('ScopeOne-Regular'),
    url('fonts/scope_one.ttf') format('truetype');
[+] doneand then you should be ready to replace your original file with main.css.new.
do not forget to include the new fonts/ folder into your local assets.
Package: ungoliant
ungoliant: unofficial CLI tool to list Perth power outagesMakes use of Western Power data.InstallationpoetryinstallExample output:Started | Est. Restoration | Cust. | Affected areas
-----------------|------------------|-------|-----------------------------------
2021-01-14 08:13 | 2021-01-14 16:30 |   297 | GERALDTON,MOUNT TARCOOLA
2021-01-14 08:04 | 2021-01-14 18:30 |   575 | BEDFORDALE,ROLEYSTONE
2021-01-04 08:25 | 2021-01-14 19:00 |     1 | MALLEE HILL
2021-01-14 13:56 | 2021-01-14 16:30 |    43 | DAYTON
2021-01-14 10:26 | 2021-01-14 18:30 |   123 | DAWESVILLE,BOUVARD
2021-01-14 11:17 | 2021-01-14 17:00 |    28 | MILO,MOORIARY,MOUNT ADAMS,YARDARINO
2021-01-14 14:57 | 2021-01-14 17:30 |     6 | HARVEY
2021-01-14 13:34 | 2021-01-14 23:30 |   362 | BAYSWATER,EMBLETON
2021-01-14 00:08 | 2021-01-14 21:04 |    68 | GIDGEGANNUP,BRIGADOON

Please note: This tool is unoffical.
Package: unha
A library to simplify telnet connections to Cisco IOS devicesInstallationUnha is distributed on PyPI and is available on Linux/macOS and Windows and supports Python 3.6+.$pipinstall-UunhaWhy not just use Netmiko?I use Netmiko whenever possible. Unfortunately I have some old cisco devices that just refuse to
work with Netmiko. I spent a lot of time trying to make it work but eventually gave up.Unha is a fallback library that I use when Netmiko withcisco_ios_telnetfails to connect to my
stuborn devices.Usually my scripts will try to connect to the devices using the fololwing methods:Netmiko with device_typecisco_iosNetmiko with device_typecisco_ios_telnetUnhaUsageI try to emulate the Netmiko methods.>>>device=Unha('10.0.0.1','username','password')>>>output=device.send_command('show version')>>>device.send_config_set(['snmp ifmib ifindex persist','snmp-server enable traps cpu threshold'])>>>device.disconnect()
Package: unhandled-exception-logger
Log Unhandled ExceptionsThis package will log unhandled exceptions as a critical error.Installpip install unhandled-exception-loggerUsageFor use in generic python code:from unhandled_exception_logger import unhandled_exception_setup

unhandled_exception_setup()Flask usageIf using Flask, then you'll need to register thehandle_exceptionfunction
using the@app.errorhandler(Exception)decorator, otherwise Flask 500
errors won't be sent.from unhandled_exception_logger import unhandled_exception_setup, handle_exception
import logging

unhandled_exception_setup()

app = Flask(__name__)
logging.getLogger("werkzeug").disabled = True
app.logger.disabled = True
@app.errorhandler(Exception)
def flask_handle_exception(e):
    handle_exception(sys.exc_info()[0], sys.exc_info()[1], sys.exc_info()[2])

@app.route("/")
def home():
    return "home"If you wish to, you can pass a custom handler to these critical unhandled
exceptions:import sys
import logging
import os
from flask import Flask
from unhandled_exception_logger import (
    unhandled_exception_setup,
    handle_exception,
)

PYTHON_LOG_LEVEL = os.getenv("PYTHON_LOG_LEVEL", "DEBUG")


# Register myChstomHandler log handler
myChstomHandler = MyCustomHandler()
myChstomHandler.setLevel("CRITICAL")

unhandled_exception_setup(handler=myChstomHandler)


logger = logging.getLogger()
logger.setLevel(PYTHON_LOG_LEVEL)
logger.addHandler(myChstomHandler)


# # Direct all uncaught exceptions to handle_exception
sys.excepthook = handle_exception

# Minimal python app example with example unhandled exception
app = Flask(__name__)


@app.errorhandler(Exception)
def flask_handle_exception(e):
    handle_exception(
        sys.exc_info()[0],
        sys.exc_info()[1],
        sys.exc_info()[2],
        handler=MyCustomHandler,  # noqa: E501
    )


@app.errorhandler(500)
def error_page(e):
    return "An error occurred"

@app.route("/")
def home():
    return "home"

@app.route("/error")
def error():
    names = ["Bob", "Alice"]
    print(names[2])
    return "<p>Hello, World!</p>"Inspired byInsult error
Package: unhandled_exit
unhandled_exitunhandled_exitmakes the whole process exit if an unhandled
exception occours in a thread or in main.Usesthreading.excepthookwhich is only available in Python 3.8 and later. Theautomated teststest Python 3.8, 3.9 and 3.10.Usageimport unhandled_exit
unhandled_exit.activate()WhyWhen using Python with threads, an uncaught exception no longer
exits the process, but only exits the affected thread.This can make perfect sense if the application restarts threads
as needed, or the threads are disposable.But if the application does not handle a thread exit, the application
can be left running in defunct state.In this situation I (and some [1] other [2] people) [3]) find it preferable
to have the whole process exit with a bang so the service manager can
restart it and/or the developer can investigate what went wrong.API Documentationactivate()activate()enables the functionality of theunhandled_exitpackage. After callingactivate(), the whole process will
exit if an unhandled exception occurs in a thread or in main.This works by chainingos._exit(1)afterthreading.excepthookandsys.excepthook.It is safe to callactivate()multiple times.
The second and later calls will be no-ops.deactivate()deactivate()resetsthreading.excepthookandsys.excepthookto the values they had beforeactivate().It is safe to calldeactivate()multiple times.
The second and later calls will be no-ops.Ifthreading.excepthookand/orsys.excepthookhave been
changed betweenactivate()anddeactivate(), a warning
is printed and this excepthook is left as-is.DevelopmentGet the code:git clone https://github.com/rfjakob/unhandled_exit
cd unhandled_exitRun the Test Suite (needspip install hatch):make testOutput should look like this:python -m compileall -q .
hatch run test
========================== test session starts ===========================
platform linux -- Python 3.10.7, pytest-7.1.3, pluggy-1.0.0 -- /home/jakob/.local/share/hatch/env/virtual/unhandled-exit/PB23ljro/unhandled-exit/bin/python
cachedir: .pytest_cache
rootdir: /home/jakob.donotbackup/code/unhandled_exit
plugins: cov-4.0.0
collected 4 items                                                        

tests/tests.py::test_crash_main PASSED                             [ 25%]
tests/tests.py::test_crash_thread PASSED                           [ 50%]
tests/tests.py::test_crash_single PASSED                           [ 75%]
tests/tests.py::test_nocrash PASSED                                [100%]

=========================== 4 passed in 0.18s ============================Publish to pypi (needspip install hatch):make publishReferences[1]https://stackoverflow.com/questions/49663124/cause-python-to-exit-if-any-thread-has-an-exception[2]https://stackoverflow.com/questions/57208345/how-to-kill-process-if-thread-encounters-exception[3]https://stackoverflow.com/questions/71051325/is-there-any-way-to-stop-all-workers-in-a-threadpool-if-any-of-the-worker-raise
Package: unhashlib
unhashlibis a Python string class enhancement (a mixin).InstallationThe easiest way to install the package is viapip:$ pip install unhashlibUsagefromunhashlibimportunhashlibs1=unhashlib('the tragicall historye of romeus and juliet')len(s1)>43s1.title()>'The Tragicall Historye Of Romeus And Juliet'fromhashlibimportsha256print(s1.get_algorithm(sha256(s1.encode('utf-8')).hexdigest()))>'sha256'print(s1.check(sha256(s1.encode('utf-8')).hexdigest()))>Truefromhashlibimportmd5s2=unhashlib(md5('python'.encode('utf-8')).hexdigest())print(s2.crack())>'python'
Package: unhcrpyplotstyle
unhcrpyplotstyleTheunhcrpyplotstylepackage provides Matplotlib styles followingUNHCR Data Visualization Guidelineswhich ensures charts are professional and brand–compliant. The porpose of this package is to ease and speed up the chart creation process using Matplotlib custom stylesheets.Getting startedThe easiest way to installunhcrpyplostylepackage is by usingpip:# to install the lastest PyPI releasepipinstallunhcrpyplotstyle# to install the latest Github commitpipinstallgit+https://github.com/leichen88/unhcrpyplotstyleThe pip installation will automatically download and store all Matplotlib custom style files (*.mplstyle) in the appropriate local directory of your computer.Use the stylesunhcrpyplotstyleis the base style of this package. It provides basic styles to the chart elements such as color, font, fontsize, and position. To use the base style you can simply call it from your local style directory after importingmatplotliblibrary.importmatplotlib.pyplotaspltplt.style.use('unhcrpyplotstyle')Once the base style is applied then you can add a specific style related to the type of chart that you want to use by simply combining two styles together:importmatplotlib.pyplotaspltplt.style.use('unhcrpyplotstyle','column')In this case, thecolumnstyle will add some of the parameters to the base styleunhcrpyplostylein order to align all chart element styles with a standard UNHCR style column chart.See the full list of styles based on chart types below:areabarbubblecolumnconnected_scatterplotdonutdotplotheatmaphistogramlinelinecolumnlollipopmappiepopulation_pyramidscatterplotslopestreamgraphtreemapExampleThe chart withunhcrpyplotstyle+columnstyles:Find code example for column charthere.The chart withunhcrpyplotstyle+barstyles:Find code example for bar charthere.The chart withunhcrpyplotstyle+linestyles:Find code example for line charthere.The chart withunhcrpyplotstyle+scatterplotstyles:Find code example for scatterplothere.
Package: unhealpix
unhealpixRegrid a HEALPIX FITS file to target FITS image.DescriptionA simple implementation ofAstropyandReprojectFITS handling. This script reprojects a HEALPIX projected FITS file to an image projection. Beware of any projection issues this may cause!Getting StartedDependenciesRequired libraries:AstropyReprojectInstallingSimply clone to wherever you'd preferExecuting programExample usage:python unhealpix.py healpix.fits target.fits output.fitsOutput will be a FITS file with the shape oftarget.fitsNotesCurrently the output is forced to be an image (NAXIS = 2). Modifcations will need to be made to handle FITS cubes (e.g. NAXIS = 3). In addition, the output header is rather minimal, so refer to the original file's header for full details.
Package: unholster.django-lookup
django-lookup=============Lookup is a simple Django app to easy work with slug charfields and fuzzy finding inyour models.Quick start-----------1. Add "lookup" to your INSTALLED_APPS setting like this::INSTALLED_APPS = (...'lookup',)2. Run `python manage.py syncdb` to create the lookup models.Use example:def option_key(self, option):return option.name if hasattr(option, 'name') else option...fuzzy_string = "Some incorrectly spelled key"# Creates a lookup object for the Territory modelzone_lookup = LookupTable(Territory)# Creates a lookup list using what's already on the table.zone_lookup.create_aliases(self.option_key)# Obtains a territory using a slug from the fuzzy_string and tries to obtain the object associated to it# if no exact matches, proposes alternatives using fuzzy finding or to create a new object.zone, created = zone_lookup.prompt(fuzzy_string, defaults={'name': fuzzy_string, cutoff=0.5, n=5)
Package: unholster.milieu
Milieu======Milieu allows easy parameter configuration using environment variables orjson files.Usage Examples==============The following code creates a milieu instance that reads environment variables,then reads the WORKON_HOME variable.```>>> import milieu>>> M = milieu.init()>>> M.WORKON_HOME'/Users/andres/.virtualenvs'```The following code create a milieu instance from a json file, the reads theseveral variables variable:```>>> import milieu>>> M= milieu.init(path='/tmp/file.json')>>> M.foou'fizz'>>> M.baru'buzz'>>> M.baz[u'one', u'two', u'three']```The json associated to this example is:```{"foo": "fizz","bar": "buzz","baz": ["one", "two", "three"]}```
Package: unholy
unholyCooperates with Docker Compose, injects an nvim-based container
into it, and connects neovide to it.You can call it what you'd like, but I'm going to call this unionunholy.RequirementsUnholy itself (I suggest usingpipx)GitThe Docker CLIsocatNeovideUsageCommit an Unholyfile to your repo (see below)Rununholy new <git url>Work on your project usingunholy shellandunholy neovideUseunholy remaketo rebuild your development environment without
re-cloning your repo or touching your work.Note: By default, the name of the Unholy project is the repo name.UnholyfileA major aspect of unholy is the Unholyfile. It is a script withTOMLhead matter, like so:---
[dev]
image="python"
---
pip install pytestThe complete headmatter schema is loosely documented incore.Unholyfile.The script supports a#!, defaulting to#!/bin/shIf you specify a non-default image, it must be Debian-based.Additional configLocal configuration (including project definitions) are stored in the XDG
Config directory (default~/.config/unholy).There is a global~/.config/unholy/Unholyapplied to all projects. This is
an excellent place for personal settings (like utilities you like or nvim
configuration).Each project gets an~/.config/<name>.Unholyfilewhere unholy keeps git and
Docker settings. You can add some local project overrides here.
Package: uni2ascii-janin
uni2asciiConvert unicode to closest ASCII equivalent.There are many unicode glyphs whose appearance is very similar to ASCII characters. This script converts these codepoints to their ASCII equivalent. For example, the stringі lоѵе üńісοdеcontains only 2 ASCII characters, despite the fact that all butüńlook fine at first glance. To convert to ASCII:> echo і lоѵе üńісοdе | uni2ascii
i love unicodeThe default action is to leave untouched any non-ascii thatuni2ascii.pydoesn't know about. This can be overridden with command line arguments. Calluni2ascii -hfor help.You can also call from python:from uni2ascii import uni2ascii
ascii_string = uni2ascii('і lоѵе üńісοdе')It's quite easy to add new transliterations. See the functionget_translitsin__init__.py. Feel free to contact me or do a pull request if you find useful ones that aren't there.Notesuni2asciiwas written to handle particular data we had on hand. There are plenty of missing transliterations. I'm happy to add new ones!Input encoding must be utf-8.Feel free to modify - it's not likely it'll work exactly correctly for you out of the box.The code should work in python2 or python3.This was not designed to thwart homograph attacks, but rather to help with text normalization of English, where unicode sometimes sneaks in.Installpip install uni2asciiAlternativesThe Python moduleunidecodeVery similar in spirit, but doesn't handle punctuation and makes some choices I disagree with.iconvIf you calliconv -t //TRANSLIT, it'll do some of whatuni2asciidoes, but a bunch of stuff is missing that is important to our application.Image processing approachesThere have been a few projects that actually look at the generated pixels to determine if two glyphs are too similar. I love the idea, but wanted more fine grain control.