Saravanan666/pypi-org huggingface dataset:
Package: justobjects
Simple python data objects management and validation based on standardjsonschemaconcepts. Project
requires python3.6+ and allows users define how data objects should look and relate with other data objects.
Supports python3.6+ typing annotations and customs attributes for more complex relationships.ObjectivesDefine and demarcate data objects with just python annotationsDefine constraints in simplejsonschemacompliant mannerValidate data objects using standardjsonschemavalidatorsExpress completejsonschemaas simple data objects (its just objects)Similar ProjectspydanticInstallinstall from pip$pipinstalljustobjectsinstall from source$pipinstallgit+https://github.com/kulgan/justobjects@<version>#egg=justobjectsUsage Exampleimportjsonimportjustobjectsasjo@jo.data(typed=True)classModel:a:intb:floatc:str# display schemaprint(json.dumps(jo.show_schema(Model),indent=2))try:# fails validationjo.validate(Model(a=3.1415,b=2.72,c="123"))exceptjo.ValidationExceptionaserr:print(err.errors)ContributingThe fastest way to get feedback on contributions/bugs is create aissuesRunning TestsThe project makes use of tox to run tests and other common tasks$tox-epy36
Package: justogres
OverviewJustogres is a connector to comunicate pandas.DataFrame objects with postgres databaseQuick startfor more details reviewdocumentationInstall or upgrade packageinstall:pip install justogresupgrade:pip install justogres --upgradeInit modulefrom justogres import clientPsql

psql = clientPsql(
        host = "<your host>",
        user = "<your user>",
        password = "<your password>",
        db_name = "<your database name>",
    )Insert data into postgresimport pandas as pd
example_df = pd.DataFrame(data=example_data)

psql.insert(
    example_df,
    table_name=<your table name>, #if doesn't exist table, will be created
    schema=<your schema name>, #should be created previously
    
    #optional
    chunksize=<your chunksize to load (default: 1000)>,
    column_types={<name_column_df>:<data_type postgres>})# if not declare column types, will be assigned automaticallyRead table of postgreswe have 2 ways to read DB, both return pandas.DataFrame object but its main difference is the type of data that is assigned to the columns of the dataframe1. use exec_query() -> all columns are defines as object (string datatype in pandas)query_example_to_read="""SELECT * 
    FROM schema_name.table_name;"""

df = psql.exec_query(
    query_example_to_read,

    #optional
    chunksize=<your chunksize to load (default: 1000)>
    )2. use read_with_pandas() -> columns are defined with datatype declare for each column into DBquery_example_to_read="""SELECT * 
    FROM schema_name.table_name;"""

df = psql.read_with_pandas(
    query_example_to_read,

    #optional
    **kwargs=<all attributes we can use with pandas.read_sql()>
    )for more info ofpandas.read_sql()Execute sql queriesthis method doesn't return anythingquery_example="""DELETE 
    FROM schema_name.table_name 
    WHERE column_name='value';"""

psql.exec_query(
    query_example,
    #optional
    chunksize=<your chunksize to load (default: 1000)>
    )
Package: justone
justone -- Fast find duplicate files in folderauthor: owtotwoUsageusage: justone.py [-h] [-s] [-i] [-t] [-v] FOLDER [FOLDER ...]

Fast duplicate files finder

positional arguments:
  FOLDER              文件夹路径

optional arguments:
  -h, --help          show this help message and exit
  -s, --strict        [0][default] 基于hash比较
                      [1][-s] 基于文件stat的shallow对比，不一致时进行字节对比，防止hash碰撞
                      [2][-ss] 严格逐个字节对比，防止文件stat与hash碰撞
  -i, --ignore-error  忽略权限、文件不存在等异常，继续执行（此时将忽略相应文件的重复可能）
  -t, --time          记录总用时消耗
  -v, --version       显示此命令行当前版本RequirementsFake Information as below...Windows 10Python3.7+pippypixxhash == 2.0.0 (Recommended, but not necessary)tqdm == 4.49.0 (Not necessary)Install by pip and Run on Win10$ pip install justone
$ justone -h
$ justone 'D:\data' 'C:\WeGame'
$ justone 'D:\fragmented files' -sLicenseLGPLv3©owtotwo
Package: justopinion
A Python library for downloading and researching legal opinions
using theCaselaw Access Project API.ExamplesIn this example, Justopinion is used to download the decision with the citation1 Breese 34.>>> import os
>>> from justopinion import CAPClient
>>> client = CAPClient(api_token=os.getenv("YOUR_SECRET_API_TOKEN"))
>>> thornton = client.read_cite("1 Breese 34", full_case=True)
>>> thornton.casebody.data.parties[0]
'John Thornton and others, Appellants, v. George Smiley and John Bradshaw, Appellees.'You can also use Justopinion to locate text in an opinion:>>> thornton.opinions[0].locate_text("The court knows of no power in the administrator")
TextPositionSet{TextPositionSelector[22, 70)}Or to get the text from a specified location in the opinion:>>> selection = thornton.opinions[0].select_text([(258, 294), (312, 359)])
>>> str(selection)
'…The note was made to West alone, and…the suit should have been commenced in his name…'And you can use Justopinion to follow citations in an opinion and download the cited cases:>>> str(thornton.cites_to[0])
'Citation to 15 Ill., 284'
>>> cited = client.read_cite(thornton.cites_to[0], full_case=True)
>>> str(cited)
'Marsh v. People, 15 Ill. 284 (1853-12-01)'
Package: justpass-me-django
Django Client for justpass.meInstall the justpassme appFor django 2.2, use justpass-me-django<3.0.0For django 3.1+, use justpass-me-django>3.0.0pipinstalljustpass-me-djangoAdd the following to your INSTALLED_APPSINSTALLED_APPS=['....''mozilla_django_oidc','justpassme','....']Add the following tosettings.pyAUTHENTICATION_BACKENDS=('justpassme.OIDC_CLIENT.OIDCUserFinder','django.contrib.auth.backends.ModelBackend',)SITE_URL=YOUR_SITE_URL#Your full site urlOIDC_USERNAME_FIELD="username"# The field to use to create users on justpass.meLOGIN_URL="/accounts/login/"# Your login view as usualOIDC_RP_CLIENT_ID="app.client_id"# client_id from justpass.meOIDC_RP_CLIENT_SECRET="app.client_secret"# client_secret from justpass.meOIDC_OP_URL="https://organization_domain.accounts.justpass.me/openid/"#Put your organization domain on justpass.meOIDC_RP_SCOPES="openid"OIDC_RP_SIGN_ALGO='HS256'OIDC_STORE_ID_TOKEN=TrueOIDC_OP_JWKS_ENDPOINT=OIDC_OP_URL+"jwks"OIDC_OP_AUTHORIZATION_ENDPOINT=OIDC_OP_URL+"authorize/"OIDC_OP_TOKEN_ENDPOINT=OIDC_OP_URL+"token/"OIDC_OP_USER_ENDPOINT=OIDC_OP_URL+"userinfo/"OIDC_CALLBACK_CLASS="justpassme.OIDC_CLIENT.Callback"OIDC_AUTHENTICATE_CLASS="justpassme.OIDC_CLIENT.Authenticate"LOGIN_REDIRECT_URL_FAILURE="/justpass/failure/"LOGIN_REDIRECT_URL="/justpass/success/"# If your application uses SSL.USE_X_FORWARDED_HOST=TrueSECURE_PROXY_SSL_HEADER=('HTTP_X_FORWARDED_PROTO','https')# Provide the following functions that will be called when event is triggered, check example functions belowREGISTRATION_SUCCESS="Your_App.justpass.reg_success"REGISTRATION_FAILURE="Your_App.justpass.reg_failure"AUTHENTICATION_SUCCESS="Your_App.justpass.auth_success"AUTHENTICATION_FAILURE="Your_App.justpass.auth_failure"Addjustpassto your urlsurls_patterns=['...',path(r'justpass/',include('justpassme.urls')),path('oidc/',include('mozilla_django_oidc.urls')),'....',]To start registration, redirct tojustpass:start_regTo start login, redirect tojustpass:start_loginNote:For 2nd factor, The function expects the user's username to be inrequest.session["base_username"]Write 4 functions that handle the success and failure of registration and login, refer to them in thesettings.pyYou can use the four functions below as a reference.defauth_success(request):returnredirect('home')defauth_failure(request):returnrender(request,'login.html',{"failed":True})defreg_success(request):request.user.mfa_enabled=Truerequest.user.save()request.session["reg"]=Truereturnredirect('home')defreg_failure(request):request.session["reg"]=Falsereturnredirect('home')Note:  If you use justpass.me as 2nd factorBreak your login function, Usually your login function will check for username and password, log the user in if the username and password are correct and create the user session, to support justpass.me, this has to changeauthenticate the userif username and password are correct , check if the user has mfa or notif user has mfa then redirect to justpass.meif user doesn't have mfa then call your function to create the user session
Package: justpfm
justPFMA small Python module to read/write PFM (Portable Float Map) imagesInstallpipinstalljustpfmUsageimportnumpyasnpfromjustpfmimportjustpfm# Write a test PFM filedata_to_write=np.ones((5,5),dtype="float32")justpfm.write_pfm(file_name="test.pfm",data=data_to_write)# Read the test PFM fileread_data=justpfm.read_pfm(file_name="test.pfm")That's it!
Package: justpid
The JustPidFile libraray is a very simple, yet functional, pid file implementation.This way the first process accessing the pid file, is able to write there its
PID (Process ID). The next one will check the file, the pid inside, and will
check if the process with the PID exists. If it exists, then an exception is thrown.If the pid file doesn’t exist, or contains garbage data, or an integer with a PID
of a not running process, then the directory can be “locked”.“Locking” a directory is done by creating a “.pid” file in the directory
with the locking process ID inside.GotchasLocking a directory with a simple file works as long as everybody uses the same
mechanism.
There is nothing that forbids any other process to change files in the “locked”
directory. The purpose of this library is to avoid having two processes writing
to the same files at the same time.ExampleLock a directory using the simple functional APIimportjustpidasjpdirectory="abc"try:jp.lock(directory)# some logicjp.unlock(directory)exceptjp.LockException:print("Cannot lock a directory")Use a context manager to automatically unlock the directory at the endimportjustpidasjpwithjp.Lock(directory):# do something here# the directory is exlusively locked# and here is unlockedImplementation DetailsThere are some hardcoded things like:The pid file is in side the locked directory and is named.pidThe main api is made of functions.There is also a context manager, just to make life a little bit simpler.Do You Need this?Maybe? Who knows. I need.
Package: just-playback
just_playbackA small library for playing audio files in python. Provides file format independent methods for loading audio files, playing, pausing, resuming, stopping, seeking, getting the current playback position, and changing the volume.The package usesminiaudiofor awesome cross-platform, dependency-free asynchronous audio playback that stays away from your main thread.Installationpip install just_playbackUsagefromjust_playbackimportPlaybackplayback=Playback()# creates an object for managing playback of a single audio fileplayback.load_file('music-files/sample.mp3')# or just pass the filename directly to the constructorplayback.play()# plays loaded audio file from the beginningplayback.pause()# pauses playback. Has no effect if playback is already pausedplayback.resume()# resumes playback. Has no effect if playback is playingplayback.stop()# stops playback. Has no effect if playback is not activeplayback.seek(60)# positions playback at 1 minute from the start of the audio fileplayback.set_volume(0.5)# sets the playback volume to 50% of the audio file's original valueplayback.loop_at_end(True)# since 0.1.5. Causes playback to automatically restart when it completes.playback.active# True if playback is active i.e playing or pausedplayback.playing# True if playback is active and not pausedplayback.curr_pos# current absolute playback position in seconds from#	the start of the audio file (unlike pygame.mixer.get_pos).playback.paused# True if playback is paused.playback.duration# length of the audio file in seconds.playback.volume# current playback volumeplayback.loops_at_end# True if playback is set to restart when it completes.
Package: just-playlists
Just PlaylistsA simple playlist manager for Just PlaybackJust Playlists is a simple playlist manager for Just Playback. It allows you to create a list of songs, then play them sequentially (or randomly).It supports every file format which just playback supports.InstallationPreqrequisitesPython 3.6 or higherJust Playback 0.1.7 or higherInstallingpip install just_playlistsUsageCreating a playlistplaylist=Playlist()songs=["C:/Users/Me/Music/My Song.mp3","/test.wav","/music-files/another-song.ogg","great-song.mp3"]playlist.load_files(songs)playlist.play()whileplaylist.is_playing:time.sleep(1)# hold the main thread open so the songs can keep playingYou can even add and delete songs from the playlist while it's playing:songs=["C:/Users/Me/Music/My Song.mp3","/test.wav","/music-files/another-song.ogg","great-song.mp3"]playlist.add_file(songs,next)# append the list of songs to play next.playlist.del_files("great-song.mp3")# you can only delete one song at a timeplaylist.del_files(1)# you can also delete by index ( if both are provided, index is used)
Package: justplot
A thin wrapper around matplotlib, which lets you save figure and axes
settings for plot reuse.How to install the modulepipwith--preas option cause this is still an alpha build.python3.4 -m pip install justplot --pre– or –git clone https://github.com/OnionNinja/justplot
cd justplot
python3.4 setup.py installHow to use the module [STRIKEOUT:(as intended)]TL;DRfromjustplotimportjustplotasjpimportnumpylat=np.asarray([-90,-60,-30,0,30,60,90])lon=np.asarray([-180,-150,-120,-90,-60,-30,0,30,60,90,120,150,180])lat,lon=np.meshgrid(lat,lon)temp=np.random.randint(10,35,(13,7))wind=np.random.randint(100,300,(13,7))awesome=jp.JustPlot(title="Where is it hot?",xlabel="Latitude",ylabel="Longitude",# add more options here)awesome.add_contourf(lat,lon,temp,ylabel="Temperature (K)",colorbar=True)awesome.save("Sun.pdf","pdf")windy=awesome.copy()windy(title="A little bit windy don't ya think?")windy.add_contour(lat,lon,wind,ylabel="Wind")windy.save("Wind.pdf","pdf")UsageLet’s say we have some data we want to plot (suprise!). As an example I
will use a small data set fromucar.First off we have to load the data.importxarrayimportnumpyasnpdata=xarray.open_dataset('sresa1b_ncar_ccsm3-example.nc',decode_times=False)#pretty cryptic, I knowlat=data.lat.datalon=data.lon.datatemp=data.tas.data[0,:,:]wind=data.ua.data[0,4,:,:]xlat,xlon=np.meshgrid(lon,lat)Let’s build the figure and axes settings first.fromjustplotimportjustplotasjpblueprint=jp.JustPlot(title="Where is it hot?",ylabel="Latitude",xlabel="Longitude",# add more options here)Now we can add the actual plot.blueprint.add_contourf(xlat,xlon,temp,label="Temperature")blueprint.save('blueprint-1.png','png')The title is strange and too small. Additionally the both Axes could use
some more ticks. So let’s change that.frommatplotlib.tickerimportAutoMinorLocatorblueprint(title={"label":"World Temperature","fontsize":19},xticks=np.arange(0,361,30),yticks=np.arange(-90,91,30),xminor=AutoMinorLocator(3),yminor=AutoMinorLocator(3),)blueprint.save("blueprint-2.png",'png')Basemapsupportwillbeaddedfurtherdowntheroad.Itison[STRIKEOUT:my]**our**todolist.Youcanquotemeonthat.Good enough. Now pretend that you like this plot sooo much that you want
all your future plots to look like it. For example the one for Wind.
Let’s do that.windy=blueprint.copy()windy(title={"label":"Wind","fontsize":19})windy.add_contour(xlat,xlon,wind,label="Wind")windy.save("windy.png","png")Let’s put all this together.both=windy.copy()both(title={"label":"World Temperature + Wind","fontsize":19})both.add_contourf(xlat,xlon,temp,label="Temperature")both.add_contour(xlat,xlon,wind,label="Wind",colors=('k'))blueprint.save("both.png","png")You can find the example code and data in theexamplefolder.How to improve the module (akaourtodo list)[ ] Save settings from y axes[ ] Add Basemap support[ ] Restructure[ ] Write import function from preconfigured or used figures/axes[x] Write README.md
Package: justplot-qt
justplot - simple data plotter with GUIJust plot data from CSV and some other files with almost single
button quickly and easy without complicated GUI and lot of actionsUsageusage: justplot [-h] [files [files ...]]

Simple graph plotter. Run without arguments to add files from GUI.

positional arguments:
  files       Files to plot

optional arguments:
  -h, --help  show this help message and exitYou can runjustplotfrom command line and provide list of files to plot or
choose files via GUI.Hotkeys in GUIFunctionHotkeyOpen fileCTR+ODelete plotDelFeaturesCurrent status:Just plot the graphs from multiple filesDisplay loaded files and data series in the tree viewHide, show and delete data series and filesCommand line interfaceSave the last directory in the Open File dialog (I thought that OS/Qt should do this automatically)[*] Graph export as image (It can be done by pyqtgraph itself by right-clicking graph pane)HotkeysMultiple files selection in open dialogMathematical operations on dataGraph visual settings (?)Multiple graph panes (?)Supported file types:CSV with any whitespace separatorChoose separatorInstallationpipinstalljustplot-qtInstall from sourcesNote: this command will install package in Development Mode, i.e. it will reference local sourcegitclonehttps://github.com/Garrus007/justplot.git
pip3install-ejustplotTroubleshootingMake sure all python dependencies are installed# Ubuntu distro examplesudoaptinstallpython3python3-pippython3-setuptoolsIf PyQt5 failed to install try to install from reposudoaptinstallpython3-pyqt5
Package: justrpa
JUSTRPA LIBRARYInstallationpip install justrpaGet startedHow to use this libraryDefine your Browser classYou can inherit from TaskBrowser to create your own browser object for browser tasks.fromjustrpa.browserimportTaskBrowserclassTestBrowser(TaskBrowser):defbefore_task_run(self,task_context:dict):print("real before task implementation.")returntask_contextdefdo_test_task(self,task_params:dict):print("Do real task")print(task_params)returntask_paramsRun Task Executerfromjustrpa.taskimportTaskExecuterenv={"account":"TestAccount","taskname":"test_task","new_browser":1,"headless":1}task_params={"United States":[{"test":"test"}]}t=TaskExecuter("test_task","tests.executer_test.TestBrowser","do_test_task",env,task_params)task_context=t.run()Run Task Handlerimportargparsefromjustrpa.taskimportTaskHandlerdefrun_task(taskname:str):handler=TaskHandler()handler.run(taskname)defmain():ap=argparse.ArgumentParser()ap.add_argument("task",default="",nargs="?",help="task name to run")args=ap.parse_args()task_name=args.taskrun_task(task_name)Robot Examplejustrpa example repository
Package: just-ship-it
just-ship-it ðŸš€For when you just need to ship your Python code.CompatabilityPython 3.6+ is required.Installationpipinstalljust-ship-itInside Jupyter / Colab NotebooksNotebooks havean issuewith newer versions of Flask, so force an older version if working in these environments.!pipinstallflask==0.12.2QuickstartJustfrom just_ship_it import ship_itandship_it()!# just_ship_it_example.pydefgreet(name):"""Greets you by name!"""return'Hello{name}!'.format(name=name)defhello():return{'hello':'world'}if__name__=='__main__':fromjust_ship_itimportship_itship_it()pythonjust_ship_it_example.py*Runningonhttp://127.0.0.1:5000/(PressCTRL+Ctoquit)*Runningonhttp://<random-address>.ngrok.io*Trafficstatsavailableonhttp://127.0.0.1:4040Your code is now shipped!
Package: just-start
An app to defeat procrastination!IntroductionJust-Start is a to-do list application and productivity booster. It prevents
you from procrastinating (too much).The program is a wrapper forTaskWarriorwith a timer implementing thePomodoro Technique(time management). It also draws a bit of inspiration fromOmodoro.Features:Configurable pomodoro phase durationsSupport for multiple configurations (a.k.a.locations) based on the current time and day of the
weekDesktop notificationsBlock time-wasting sites while you’re workingInstallation and usageSupported platforms:LinuxmacOSRequirements:Python 3.6+TaskWarrior(latest)Pick a client name from the table below and run:$pipinstalljust-start[<client_name>]$just-start-<client_name>So for the urwid client:$pipinstalljust-start-urwid$just-start-urwidPress h to see a list of available user actions.ClientsNameFrameworkNotesurwid (recommended)UrwidInspired byCalcurse. Similar to a graphical
application, but in your terminaltermTerminal
(none)Example client. Useful for seeing how to write a brand new
one but not intended for continuous usageDevelopmentIf you want to help out please installPoetry, clone the repo and run:$cdjust-start/$poetryinstallThis will ensure you have both the development and install dependencies.You can also install the package in editable mode to test manually without having to run a build
after every change, but you’ll need to generate a setup.py since projects using pyproject.toml alone
can’t be used this way (see the note about editable mode inPEP517for more info). I useDephellfor this:$cdjust-start$dephelldepsconvert--from=pyproject.toml--to=setup.py$pipinstall-ejust_startBug reportsIssues are tracked usingGitHub IssuesRunning TestsYou just needPoetryandTox$tox
Package: justunzip
justunzipCLI tool to just unzip a truncated or partially corrupt zipfileInstallationpip install justunzipUsageuser@bar:~$unzip-ltest.zipArchive:  test.zipEnd-of-central-directory signature not found.  Either this file is nota zipfile, or it constitutes one disk of a multi-part archive.  In thelatter case the central directory and zipfile comment will be found onthe last disk(s) of this archive.unzip:  cannot find zipfile directory in one of test.zip ortest.zip.zip, and cannot find test.zip.ZIP, period.user@bar:~$unziptest.zipArchive:  test.zipEnd-of-central-directory signature not found.  Either this file is nota zipfile, or it constitutes one disk of a multi-part archive.  In thelatter case the central directory and zipfile comment will be found onthe last disk(s) of this archive.unzip:  cannot find zipfile directory in one of test.zip ortest.zip.zip, and cannot find test.zip.ZIP, period.user@bar:~$justunzip-ltest.zipArchive: test.zipLength     Name---------- ----0 justunzip/build/0 justunzip/dist/1062 justunzip/LICENSE76 justunzip/README.md823 justunzip/setup.py0 justunzip/src/0 justunzip/build/bdist.linux-x86_64/0 justunzip/build/lib/0 justunzip/build/lib/justunzip/0 justunzip/build/lib/justunzip/__init__.py1936 justunzip/build/lib/justunzip/justunzip.py2614 justunzip/dist/justunzip-0.0.1-py3.8.egguser@bar:~$justunziptest.zipArchive: test.zipcreating: justunzip/LICENSEcreating: justunzip/README.mdcreating: justunzip/setup.pycreating: justunzip/build/lib/justunzip/justunzip.pyWARNING:root:b'justunzip/dist/justunzip-0.0.1-py3.8.egg' is truncatedERROR:root:error decompressing b'justunzip/dist/justunzip-0.0.1-py3.8.egg'creating: justunzip/dist/justunzip-0.0.1-py3.8.egg
Package: justupdate
Just. UpdateJust. Update is a updater system written in python that utilizes each platform's native method of installing an application to perform an update.On windows, JustUpdate uses NSIS (nullsoft scriptable install system) to perform the update.On Mac, JustUpdate uses the pkg flat installer archive format, to perform the update (productbuild).INSTALLATION|DOCUMENTATION|LICENSE|HELPING OUTContributingWant a feature or found a bug? Open an issue or submit a pull request.
Package: just-update-arch
Just Update ArchUpdates packages from theArch User Repository, alongside
the vanilla arch packages, installed as normal throughpacman.UsageThere is no complexity to this script, all you have to do is run the command:➜just_update_archInstallationThesrc/cli.pyfile can be installed as thejust_update_archcommand usingpip.You can install it fromGitHub:➜pipinstallgit+https://github.com/MolassesLover/JustUpdateArch.gitAlternatively, fromPyPi:➜pipinstalljust-update-archLicenseAll files within this repository are licensed under theGNU General Public License v3.0.ContributingContributions are open, just make sure to sign your
commits, otherwise, your changes will not be merged.