Saravanan666/pypi-org huggingface dataset:
Package: nwnsdk
Compute engine sdk pythonNieuwe Warmte NuUsageInstall in development mode, in root directory:pip install -e .or install from pypi:pip install nwnsdkFor testing locally with RabbitMQ and Postgres on docker desktop clonehttps://github.com/Nieuwe-Warmte-Nu/computation-engine, copy.env-templateto.envand in the root directory:docker-compose upExample usagefromuuidimportuuid4fromnwnsdkimportNwnClient,WorkFlowType,PostgresConfig,RabbitmqConfigpostgres_config=PostgresConfig("localhost",5432,"nieuwewarmtenu","root","1234",)rabbitmq_config=RabbitmqConfig("localhost",5672,"nwn","root","5678",)nwn_client=NwnClient(postgres_config,rabbitmq_config)try:nwn_client.connect()job_id1:uuid4=nwn_client.start_work_flow(WorkFlowType.GROW_OPTIMIZER,"test_job1","esdl_string","test_user1","test_proj")job_id2:uuid4=nwn_client.start_work_flow(WorkFlowType.GROW_OPTIMIZER,"test_job2","esdl_string","test_user2","test_proj")print(job_id1)job1_input_esdl=nwn_client.get_job_input_esdl(job_id1)print(f"===== job1 input ESDL:{job1_input_esdl}")job1_status=nwn_client.get_job_status(job_id1)print(f"===== job1 status:{job1_status}")job1=nwn_client.get_job_details(job_id1)print(f"====={job1.job_name}input esdl:{job1.input_esdl}")jobs_all=nwn_client.get_all_jobs()print(f"====={jobs_all[1].job_name}added at:{jobs_all[1].added_at}")jobs_from_ids=nwn_client.get_jobs_from_ids([job_id1,job_id2])print(f"====={jobs_from_ids[1].job_name}added at:{jobs_from_ids[1].added_at}")jobs_from_user=nwn_client.get_jobs_from_user("test_user1")print(f"===== Jobs from test_user1 added at:{','.join([str(job.added_at)forjobinjobs_from_user])}")jobs_from_project=nwn_client.get_jobs_from_project("test_proj")print(f"===== Jobs from test_proj added at:{','.join([str(job.added_at)forjobinjobs_from_project])}")print(f"===== Deleted job with id '{job_id1}':{nwn_client.delete_job(job_id1)}")finally:nwn_client.stop()ReleaseThis package is released on pypiherewhenever a new tag is pushed.
In order to release this package:Make sure that all relevant merge requests and commits have been merged to the main and/or poc-release branch.Rungit checkout mainorgit checkout poc-releaseto switch to the release branch.Rungit pull origin mainorgit pull origin poc-releaseto pull all latest changes.Rungit tag <new_version>where<new_version>is the new version number.Rungit push origin <new_version>to push the tag to Github.CheckGithubto confirm the release is
processed without errors.Once the release has finished, confirm the new version is available onpypi.
Package: nwon_baseline
NWON Python baseline packageThis package provides some basic python functions that can be used across several projects.The dependencies of the project are kept to a minimum in order to prevent version conflicts with other projects.Package is meant for internal use atNWONas breaking changes may occur on version changes. This may change at some point but not for now 😇.Development SetupWe recommend developing using poetry.This are the steps to setup the project with a local virtual environment:Tell poetry to create dependencies in a.venvfolder withing the project:poetry config virtualenvs.in-project trueCreate a virtual environment using the local python version:poetry env use $(cat .python-version)Install dependencies:poetry installPrepare PackageAs we want to include types with the package it is not as straight forward as just callingpoetry build😥.We need to:Clean dist folderBump up the version of the packageBuild the packageLuckily we provide a script for doing all of thispython scripts/prepare.py patch. Alternatively you can run the script in a poetry contextpoetry run prepare patch. The argument at the end defines whether you want apatch,minorormajorversion bump.The final zipped data ends up in thedistfolder.Publish PackageBefore publishing the package we need to:Add test PyPi repository:poetry config repositories.testpypi https://test.pypi.org/legacy/Publish the package to the test repository:poetry publish -r testpypiTest package:pip install --index-url https://test.pypi.org/simple/ nwon_baselineIf everything works fine publish the package viapoetry publish.
Package: nwon_django_toolbox
NWON-Django-ToolboxThis package provides some Django additions that can be used across several projects.SettingsThe Django Toolbox can be configured using the Django settings. We expect the keyNWON_DJANGOthat holds a dictionary. The dictionary must be of typeNWONDjangoSettingsthat comes with this package (nwon_django_toolbox.nwon_django_settings). The keys mus be snake case or camel case.For example like thisNWON_DJANGO:NWONDjangoSettings={"authorization_prefix":"Bearer","logger_name":"your-log-name","application_name":"application"}DependenciesThe project has a bunch of dependencies that we use in most of our projects. In the end we have quite a lot and need to slim this down in the future.Django related libraries are:Django (Obviously 🧠)django-polymorphicdjango-json-widgetdjango-rest-polymorphicFor API documentation our models and serializer support two library which come as a dependency as well:drf-spectaculardrf-yasgOn top we use a bunch of helper librariesPydanticPillowjsonrefjsonschema-to-openapipyhumpsnwon-baselinePackage is meant for internal use atNWONas breaking changes may occur on version changes. This may change at some point but not for now 😇.Development SetupWe recommend developing using poetry.This are the steps to setup the project with a local virtual environment:Tell poetry to create dependencies in a.venvfolder withing the project:poetry config virtualenvs.in-project trueCreate a virtual environment using the local python version:poetry env use $(cat .python-version)Install dependencies:poetry installPrepare PackageBefore publishing the package we need to:Clean dist folderBump up the version of the packageBuild the packageLuckily we provide a script for doing all of thispython scripts/prepare.py patch. Alternatively you can run the script in a poetry contextpoetry run prepare patch. The argument at the end defines whether you want apatch,minorormajorversion bump.The final zipped data ends up in thedistfolder.Publish PackageTest package publicationAdd test PyPi repository:poetry config repositories.testpypi https://test.pypi.org/legacy/Publish the package to the test repository:poetry publish -r testpypiTest package:pip install --index-url https://test.pypi.org/simple/ nwon_baselineIf everything works fine publish the package viapoetry publish.
Package: nwp
NWPTools for downloading and processing numerical weather predictionsAt the moment, this code is focused on downloading historical UKV NWPs produced by the UK Met Office, and distributed by CEDA.Detailed docs of the Met Office data is availablehere.InstallationcondaFrom within the clonednwpdirectory:condaenvcreate-fenvironment.yml
condaactivatenwp
pipinstall-e.Downloading UKV numerical weather predictions from CEDARequest access to theUK Met Office data on CEDA.Once you have a username and password, download usingscripts/download_UK_Met_Office_NWPs_from_CEDA.sh.
Please see the comments at the top of the script for instructions.Convert grib files to ZarrThen convert thegribfiles to Zarr usingscripts/convert_NWP_grib_to_zarr.py.  Run that script
with--helpto see how to operate it.  See the comments at the top of the script to learn how
the script works.
Package: nwpc-hpc-model
nwpc-hpc-modelA key-value model for HPC resources in NWPC. Including models for:LoadLeveler'sllq -lquerySlurm'ssinfoandsqueue -o %allqueryDisk usage and disk space queryInstallationDownload source code from Github releases or get the latest code from Github repo.Runpip install .to install.Getting startedThe following example usesnwpc-hpc-modelto extract job id and job owner from allq -lquery.A config YAML file is used to create query categories.category_list:-id:"llq.id"display_name:"Id"label:"JobStepId"record_parser_class:"DetailLabelParser"record_parser_arguments:-"JobStepId"value_saver_class:"StringSaver"value_saver_arguments:[]-id:"llq.owner"display_name:"Owner"label:"Owner"record_parser_class:"DetailLabelParser"record_parser_arguments:-"Owner"value_saver_class:"StringSaver"value_saver_arguments:[]First createQueryCategoryListaccording to the config json file.fromnwpc_hpc_model.workload.loadlevelerimportQueryCategoryList,\QueryCategory,record_parser,value_saverimportyamlwithopen('config_file_path','r')asf:config=yaml.load(f)category_list=QueryCategoryList()foran_iteminconfig['category_list']:category=QueryCategory(category_id=an_item['id'],display_name=an_item['display_name'],label=an_item['display_name'],record_parser_class=getattr(record_parser,an_item['record_parser_class']),record_parser_arguments=tuple(an_item['record_parser_arguments']),value_saver_class=getattr(value_saver,an_item['value_saver_class']),value_saver_arguments=tuple(an_item['value_saver_arguments']))category_list.append(category)Getllq -lcommand output.importsubprocesscommand="/usr/bin/llq -l"pipe=subprocess.Popen([command],stdout=subprocess.PIPE,shell=True)output=pipe.communicate()[0]output_string=output.decode()output_lines=output_string.split("\n")BuildQueryModelfromQueryCategoryListfromnwpc_hpc_model.workload.loadlevelerimportLoadLevelerQueryModelmodel=LoadLevelerQueryModel.build_from_category_list(output_lines,category_list)modelcontains data of all categories in the config file.TestUsepytestto run all tests.LicenseCopyright © 2016-2019, Perilla Roc.nwpc-hpc-modelis licensed underThe MIT License.
Package: nwpc-workflow-model
nwpc-workflow-modelThe workflow model using in NWPC, supports SMS and ecFlow.IntroductionIn NWPC, we run tasks using a workflow software, such as SMS and ecFLow by ECMWF.nwpc-workflow-modelis designed to bring a workflow model into our programs.ComponentsSMSPlease seenwpc_workflow_model/sms/README.mdfor more information.ecFlowSame as SMS.Getting StartedDownload the latest source code from Github and installnwpc-workflow-modelusing:pythonsetup.pyinstallTestsInstall packages for test usingpip install .[test].Usepytestto run tests.LicenseCopyright © 2016-2019 Perilla Roc.nwpc-workflow-modelis licensed underThe MIT License.
Package: nwp-dl-utils
NWP Downloading UtilitiesContains utilities for downloading (relevant parts) of NWP products.Currently focussing onMetNo.ProductRemote Access (OPeNDAP)Local Access (NetCDF4)MEPSYesNoMyWaveWAMYesYesThe package is pre-Alpha software. It does what we need it to do and not much more.DevelopmentSetting up a development spacecondacreate--namenwpdl-devpython=3.9
condaactivatenwpdl-dev
condainstallnumpyxarraypandas
condainstallpytest
condainstall-cconda-forgepyresample
condainstall-cconda-forgenetCDF4
condadeactivatenwpdl-dev
condaactivatenwpdl-devTo run the tests, simply runpytestin the base directory.Development ModeYou can use development mode to make the current version of the code available to other packages. To proceed, enter the virtual environment of whatever program you're working on, navigate to the./nwp_dl_utilsroot directory, remove the existing installation ofnwp-dl-utils(if it exists), and install it in development mode, viz.pipuninstallnwp-dl-utils
pipinstall--editable.When done, remove, and reinstall the version fromPyPI, viz.pipuninstallnwl-dl-utils
pipinstall--ugradenwp-dl-utilsThis needspip>=21.3, seehereandhere. You can upgrade Pip viapip install --upgrade pip.Build and DistributeSetup environmentcondacreate--namenwpdl-buildpython=3.9
condaactivatenwpdl-build
pipinstall--upgradepip
pipinstall--upgradebuild
pipinstall--upgradetwineBuild and uploadpython-mbuild
python-mtwineupload--repositorytestpypidist/*Drop--repository testpypito upload to real PyPI.Test buildcondacreate--namenwpdl-testpython=3.9
condaactivatenwpdl-test
pipinstall--index-urlhttps://test.pypi.org/simple/--no-depsnwp-dl-utilsDrop--index-url https://test.pypi.org/simple/ --no-depsto download from real PyPI.Referenceshttps://packaging.python.org/en/latest/tutorials/packaging-projects/.https://setuptools.pypa.io/en/latest/userguide/development_mode.htmlBlame and ContactVolker Hoffmann (volker.hoffmann@sintef.no)
Package: nwpm
安装环境你可以使用nwpm包管理工具自由地创建你想要的环境。目前nwpm支持：命令引擎支持的CUDA版本mx18_cu110mxnet 1.8.011.0mx18_cu102mxnet 1.8.010.2mx17_cu102mxnet 1.7.010.2你可以使用类似以下的命令初始化一个工作环境：nwpm -create mx17_cu102该命令的格式为：nwpm -create {Environment Name}移除环境你可以使用以下命令移除你的工作环境：nwpm -delete mx17_cu102注意，由于workspace_pack目录下很有可能保留有模型、数据集等重要内容，因此该命令不会删除workspace_pack目录下的文件。如果您需要，请手动删除。​
该命令的格式为：nwpm -delete {Environment Name}安装工作包你可以使用类似下面的命令获取他人发布的工作包：nwpm -install nvccp该命令的格式为：nwpm -install {Package Name}移除工作包你可以使用类似下面的命令移除已下载的工作包：nwpm -remove nvccp该命令的格式为：nwpm -remove {Package Name}开始工作nwpm -work
Package: nwpy
nwpy 🚀TUI based network watcher using Python!Installationpip3 install -U nwpyBasic UsageSimply runnwpy, It will look for your default interface and start scanning.$nwpy--help
usage:nwpy[-h][-iI][-l]Networkscanner

optionalarguments:-h,--helpshowthishelpmessageandexit-iIinterface-lListavailableinterfaces
Package: nwqt4
FeaturesYour own collection of wallpapers (as links to images on image hostings)Tagging of wallpapersRequests for random wallpapers, last added wallpapers in your collection
and new wallpapers added by other usersChange wallpaper at certain intervalsCustom scripts for wallpaper changeSupported DEKDE 4GNOME 2GNOME 3XFCE 4To install runpython setup.py installas rootDepends on PyQt4 (with dbus support), dbus and PILExecutable is /usr/bin/nwqt4
Package: nws-alerts
NWS_AlertA easy way to subscribe to National Weather Service (NWS) alerts.Installpip install nws_alertUsagefrom nws import NWS

nws = NWS()


# Subscribe to alerts in North Carolina with severity "Moderate" or "Severe"
@nws.alert(state='NC', severity='Moderate')
@nws.alert(state='NC', severity='Severe')
def MyStateAlert(entry):
    print('MyStateAlert(', entry.severity, entry.title)


# Subscribe to events in my "zone" with urgency "Immediate"
@nws.alert(zone='NCC101', urgency='Immediate')  # See https://alerts.weather.gov/ for complete zone list
def MyZoneAlert(entry):
    print('MyZoneAlert(', entry.urgency, entry.title)


# nws.NowAlerts() will return any event happening now. It will not return future or past events.
# Only events from states/zones you have subscribed to with @nws.alert will be included.
# This will return all events regardless of severity, certainty, or urgency

nowAlerts = nws.NowAlerts()
for entry in nowAlerts:
    print('now entry=', entry)NotesThe @nws.alert decorator will only be triggered once per NWS alert.
The alerts are logged to a JSON file in the current directory so that the code will remember which alerts have already been triggered.Synchronous SubscriptionsYou can update the subscriptions on the fly by creating a Subscription object and calling the .Update()sub = Subscription(state='NC', severity='Moderate')
entries = sub.Update()
print('entries=', entries)

>>> entries= [<nwscapparser3.nws_cap_parser.CAPEntry object at 0x00000225DD91C7C0>, <nwscapparser3.nws_cap_parser.CAPEntry object at 0x00000225DD91C6A0>]Event AttributesSeehttps://docs.oasis-open.org/emergency/cap/v1.2/CAP-v1.2-os.pdffor more detailed CAP infoSEVERITY:Severe: Significant threat to life or propertyModerate: Possible threat to life or propertyMinor: Minimal to no known threat to life or propertyUnknown: Severity unknownCERTAINTY:Observed: Determined to have occurred or to be ongoingLikely: Likely (p > ~50%)Possible: Possible but not likely (p <= ~50%)Unlikely: Not expected to occur (p ~ 0)Unknown: Certainty unknownURGENCY:Immediate: Responsive action SHOULD be taken immediatelyExpected: Responsive action SHOULD be taken soon (within next hour)Future: Responsive action SHOULD be taken in the near futurePast: Responsive action is no longer requiredUnknown: Urgency not known
Package: nwsapy
NWS-APy: A Pythonic Implementation of the National Weather Service APINWS-APy (APy for short) takes a pythonic approach to retrieving (GET) and organizing data using the National Weather Service API (found here:https://www.weather.gov/documentation/services-web-api#/)There are 3 goals that the package aims to achieve:Keep clean, simplistic, minimalistic, and consistent code on the user end.Minimize potential 404/500 errors and knowledge overhead.Format output to popular meteorological data types.A simple exampleAPy is designed to be simple and easy to use. For example, if we wanted to get all
of the tornado warnings in Oklahoma and just display the headline:fromnwsapyimportapi_connectortor_warnings=api_connector.get_active_alerts(event="Tornado Warning",area="OK")# Check to make sure there aren't any request errors.# If so, let the user know by raising an error.iftor_warnings.has_any_request_errors:raiseConnectionError(f'Details:{tor_warnings['detail']})# iterate through all of the tornado warnings in Oklahoma and print the headline.forwarningintor_warnings:print(warning.headline)DocumentationDocumentation for NWSAPy be foundhereContact/SupportI want to hear from you. If you have any questions regarding the package usage, pleasesend me an email. If you encounter an issue, please open an issue on GitHub.
Package: nwscan
nwscanScan networks for alive hosts, uses CIDR notation.Simple example:$ nwscan 192.168.1.1/24
Scanning 254 hosts...

192.168.1.1 is alive
192.168.1.10 is alive
192.168.1.12 is alive
192.168.1.23 is alive
192.168.1.104 is alive

Finished: 254 hosts scanned
Alive hosts: 5NotesWorks on Python 2 and Python 3Tested on Linux and Windows (Cygwin)InstallInstall using pip:pip install nwscanUsageUsage: nwscan network [options]

scan network for alive hosts, uses CIDR notation

Options:
--version       show program's version number and exit
-h, --help      show this help message and exit
-r, --reverse   print not responding hosts rather than alive
-w WORKERS      number of workers threads to use (default: 8)
-t TIMEOUT      timeout of each ping request in seconds (default: 1)
-n COUNT        number of ping requests to send (default: 1)
-i INPUT_FILE   scan networks from input file (one network per line)
-o OUTPUT_FILE  save sorted ips output to fileExamplesScan all 254 usable IPs of network ‘192.168.0.*’:$ nwscan 192.168.0.0/24Scan networks from ‘networks.txt’ file using 16 workers:$ nwscan -i networks.txt -w 16Scan not responding hosts and save ips to file ‘ips.txt’:$ nwscan 192.168.0.0/24 -r -o ips.txt
Package: nwscapparser3
Note: these values are updated every 2 minutes.
The NWS server uses cache-control headers and timeouts to optimize response times.MY_STATE = 'NC'
cap = NWSCAPParser('http://alerts.weather.gov/cap/{}.php?x=1'.format(MY_STATE))

for ID, entry in cap.entries.items():
    print('################################')
    print('ID=', ID)
    print('entry.id=', entry.id)
    print('entry=', entry)

    print('entry.severity=', entry.severity)
    print('entry.urgency=', entry.urgency)
    print('entry.certainty=', entry.certainty)

    print('entry.status=', entry.status)
    print('entry.msgType=', entry.msgType)
    print('entry.category=', entry.category)
    print('entry.areaDesc=', entry.areaDesc)Output################################
ID= https://alerts.weather.gov/cap/wwacapget.php?x=NC125F5E87CC18.BeachHazardsStatement.125F5E94C080NC.MHXCFWMHX.517dbba3998ca8105cf4c357df8d60e2
entry.id= https://alerts.weather.gov/cap/wwacapget.php?x=NC125F5E87CC18.BeachHazardsStatement.125F5E94C080NC.MHXCFWMHX.517dbba3998ca8105cf4c357df8d60e2
entry= <CAPEntry: {'id': 'https://alerts.weather.gov/cap/wwacapget.php?x=NC125F5E87CC18.BeachHazardsStatement.125F5E94C080NC.MHXCFWMHX.517dbba3998ca8105cf4c357df8d60e2', 'updated': '2020-08-17T11:10:00-04:00', 'published': '2020-08-17T11:10:00-04:00', 'author': {'name': 'w-nws.webmaster@noaa.gov'}, 'title': 'Beach Hazards Statement issued August 17 at 11:10AM EDT until August 17 at 8:00PM EDT by NWS', 'link': '', 'summary': '...BEACH HAZARDS STATEMENT REMAINS IN EFFECT UNTIL 8 PM EDT THIS EVENING... * WHAT...Dangerous rip currents. * WHERE...The beaches north of Cape Hatteras. * WHEN...Until 8 PM EDT this evening. * IMPACTS...Rip currents can sweep even the best swimmers away'}>
entry.severity= Moderate
entry.urgency= Expected
entry.certainty= Likely
entry.status= Actual
entry.msgType= Alert
entry.category= Met
entry.areaDesc= Hatteras Island; Northern Outer Banks
################################
ID= https://alerts.weather.gov/cap/wwacapget.php?x=NC125F5E86E924.BeachHazardsStatement.125F5E94C080NC.AKQCFWAKQ.d59a4d6449e2c689d8dd9b1209db835a
entry.id= https://alerts.weather.gov/cap/wwacapget.php?x=NC125F5E86E924.BeachHazardsStatement.125F5E94C080NC.AKQCFWAKQ.d59a4d6449e2c689d8dd9b1209db835a
entry= <CAPEntry: {'id': 'https://alerts.weather.gov/cap/wwacapget.php?x=NC125F5E86E924.BeachHazardsStatement.125F5E94C080NC.AKQCFWAKQ.d59a4d6449e2c689d8dd9b1209db835a', 'updated': '2020-08-17T05:29:00-04:00', 'published': '2020-08-17T05:29:00-04:00', 'author': {'name': 'w-nws.webmaster@noaa.gov'}, 'title': 'Beach Hazards Statement issued August 17 at 5:29AM EDT until August 17 at 8:00PM EDT by NWS', 'link': '', 'summary': '...BEACH HAZARDS STATEMENT REMAINS IN EFFECT THROUGH THIS EVENING... * WHAT...A high risk of rip currents. * WHERE...In Virginia, Virginia Beach. In North Carolina, Eastern Currituck County. * WHEN...From 8 AM EDT this morning through this evening.'}>
entry.severity= Moderate
entry.urgency= Expected
entry.certainty= Likely
entry.status= Actual
entry.msgType= Alert
entry.category= Met
entry.areaDesc= Eastern Currituck
Package: nwslpy
nwslpynwslpyis a Python wrapper around the data generated by thenwslRpackage. The goal of this package is to make the data fromnwslRavailable to an even broader audience.If you see anything you’d like added, changed, or updated, please open up a new issue of your own. If you are interested in contributing, please contact us directly. If you use this data in any work, please cite us.Installing the packageInstall nwspy using the following command:pip install nwslpyAPIload_player_match_stats(match_id): Loads player level stats for a given
matchload_player_season_stats(team_id, season): Loads player level stats for a
team/seasonload_team_match_stats(match_id): Loads team level stats for a given matchload_team_season_stats(team_id, season): Loads team level stats for a team/seasonload_matches(): All matches from 2016-present with information and
match IDsload_players(): All players rostered from 2016-present with
information and player IDsload_teams(): All teams active from 2016-present with information
and team IDsload_metrics()All metrics available from scrapers with definitions.
Not all metrics are available for all players/matches/teams/etc.UsageIf you wanted to see the list of matches from 2022, you could try:importnwslpy# Load all matches and filter to ones in the year 2022matches=nwslpy.load_matches()matches[matches["year"]==2022]If you wanted to see which players took the most shots in the 2022 NWSL Championship, you could try:importnwslpystats=nwslpy.load_player_match_stats("portland-thorns-fc-vs-kansas-city-current-2022-10-29")players=nwslpy.load_players()# Select the columns of intereststats=stats[["shots_total"]]# Join with information about the playersstats=stats.join(players)[["shots_total","player_match_name"]]# Find the players with the most shotsstats=stats.sort_values("shots_total",ascending=False)For more complicated examples, including how to visualize the data, check out theexamplesdirectory.