Saravanan666/pypi-org huggingface dataset:
Package: k8senv
k8senvis a simple way to manage your different Kubernetes contexts.Installation$ pip install k8senvIt’s recommended to remove your default Kubernetes context, so you don’t
accidentially invoke it:$ kubectl config unset current-contextYou may also want to export your shell prompt:$ echo ‘export PS1’ >> ~/.bash_profileUsageTo start using a Kubernetes context:$ k8senv <context>Now any calls tokubectlwithin your shell will use that context.To list available contexts:$ k8senv –listLicenseCopyright (c) 2016-2017 Shotwell Labs, Inc.Permission 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: k8sfoams
k8s-pod-foamtreeIt's web server which uses~/.kube/configfile for presenting resource request set for pods. It uses foamtree package for visualization. Dashboard has two option for visualization:cpumemoryFoamtree view is refreshed automaticaly every 60 seconds by default. Refresh frequency might be change by range slider.Node is represented by square shape box. Foams are pods. If pod contains more than one container pod foam is splited into sub-foams. Empty foam represents unused (free) resources avaiable on node.Memory unitBelow memory units are avaiable for displaing:KBMBGBTBContextContext combobox allows for switching current k8s context.Context is changed only in k8s-pod-foamtree web server not in ~/.kube/config file.Run k8s-pod-foamtreeBefore run k8s-pod-foamtree run below command:make build installThis command builds and install package in your local environment.
To run it type in your shell:k8sfoamsInstall via PyPipip install k8sfoamsCommand lines argumentshost: host IP address on which server listen, default is127.0.0.1port: port number on which server listen, default is8080d: turn ondebugmode when server starts
Package: k8sgen
k8sGenAboutk8sGen was developed out of a need for a framework to enable to creation of kubernetes manifests based off the objects that are required, not a template.  Popular templating tools, likeHelm, is excellent in that it allows for values to be swapped into existing structures but becomes clunky when a large amount of customization is required on the Kubernetes-object level. Furthermore, Amazon'scdk8sexcels at providing a more developer-freidnly way to generate manifests, but isn't so friendly to an application that needs to generate them for a user.  This is where k8sGen comes in.  By providing accessible Python classes for Kubernetes objects and the components, k8sGen enables applications to quickly build manifests based off of user-supplied configuration for use in installation guides and more.Documentation for k8sGen is availablehereThis project is maintained by John Carter with the support ofModelOp
Package: k8s-logger
k8s_logger如何使用loggerlogger会从环境变量中获取"logPath"与"jobName"调用print_log时，传入的文本需要以 "|" 分隔字符串demo.pyfromlogger.Loggerimport*# 初始化配置。只需要调用一次即可。init_config()print_log("2019-07-19-07-30: epoch: 182 |loss 0.448047 | hm_loss 0.262451 | wh_loss 0.538236 | off_loss 0.140742 | corner_loss 0.380307 | time 3.100000 | loss 1.256430 |","loss")控制台输出/Users/bianlifeng/anaconda3/bin/python /Users/bianlifeng/PycharmProjects/k8s_logger/test.py
logging init log_path:[/Users/bianlifeng/PycharmProjects/k8s_logger/job.log] 

Process finished with exit code 0/Users/bianlifeng/PycharmProjects/k8s_logger/job.log2019-07-23 17:06-INFO-2019-07-23 | loss 0.448047  |  hm_loss 0.262451  |  wh_loss 0.538236  |  off_loss 0.140742  |  corner_loss 0.380307  |  loss 1.256430test使用config_log方法手动设置文件路径即可demo.pyfromlogger.Loggerimportprint_logfromlogger.ConfigimportConfigconfig=Config()config.config_log("/Users/bianlifeng/PycharmProjects/k8s_logger/debug.log")print_log("2019-07-19-07-30: epoch: 182 |loss 0.448047 | hm_loss 0.262451 | wh_loss 0.538236 | off_loss 0.140742 | corner_loss 0.380307 | time 3.100000 | loss 1.256430 |","loss")控制台输出/Users/bianlifeng/anaconda3/bin/python /Users/bianlifeng/PycharmProjects/k8s_logger/test.py
logging init log_path:[/Users/bianlifeng/PycharmProjects/k8s_logger/debug.log] 

Process finished with exit code 0
Package: k8smap
k8smapk8smap is a tool to generate a diagram a diagram text file from kubernetes resource descriptions.
I implemented this to get a faster understanding of the resources in a given helm chart.
Also it helps me document the infrastructure automatically visually for my colleagues.Quick startpoetry add k8smap

k8smap -i filename.yamlExampleYou can clone the repo and test it locally.helm template example > example.yaml 
poetry run k8smap -i infratest.yamlThis will generate the following output to file fileoutput.d2:Service_pawn:pawn {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/svc.svg
  shape: image
}
Service_bishop:bishop {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/svc.svg
  shape: image
}
Pod_bishop-nginx:bishop-nginx {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/pod.svg
  shape: image
}
Deployment_nginx-deployment:nginx-deployment {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/deploy.svg
  shape: image
}
Pod_nginx-deployment:nginx-deployment {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/pod.svg
  shape: image
}
Ingress_pawn-ingress:pawn-ingress {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/ing.svg
  shape: image
}
Ingress_bishop-ingress:bishop-ingress {
  icon: https://raw.githubusercontent.com/kubernetes/community/master/icons/svg/resources/labeled/ing.svg
  shape: image
}
Service_pawn --> Pod_nginx-deployment
Service_bishop --> Pod_bishop-nginx
Deployment_nginx-deployment --> Pod_nginx-deployment
Ingress_pawn-ingress --> Service_pawn
Ingress_bishop-ingress --> Service_bishopTo generate an image for this graph you can run d2.d2 output.d2 out.svgOr generate a mermaid flowchart.mapk8s -i filename.yaml -f mermaidComponentsSo far the following components are implemented:PodDeploymentIngressServiceConfig MapService AccountNetwork PolicyCron JobJobSecretVolumePersistent VolumePersistent Volume ClaimOutput formatsSo far the following output languages are supported:D2MermaidUse the-f [d2, mermaid]flag to specify the format.LicenseThis is unclear right now and needs to be checked.
As I am using in this code svg from Kubernetes, I first have to evaluate what license I can use.
Package: k8s-proto
flyteprotoFlyteproto is a collection of generatedprotocol bufferbindings for kubernetes generatedprotobuf definitions.Contentsk8sGenerated protobuf code (currently python only), complete with imports synced from k8s.io/apimachinery inkubernetes/apimachineryk8s.ioCore and imported protobuf definitions in a path that matches their declared packages. Use these to generate protobufs that import the core kubernetes protos.UsageRungenerate.shto regenerate protobuf code.To use kubernetes protobuf definitions in your own protobufs, pass thek8s.iodir as an input directory to protoc:protoc -I=k8s.io/ [OPTION] PROTO_FILES
Package: k8s-secretgenerator
Kubernetes Secret GeneratorThis package contains a nice and convienient class to create Kubernetes secret filesIt can create secrets from .env files or from files using theabsolutepath of the file, and reading them.installationpip install k8s-secretgeneratorExamplesBelow two examples. One for creation of secrets from files like eg. service account credentials or other filesyou want in a variable for Kubernetes.The other one is an example to generate a secret file from a .env file.All values will be base64 encoded, just the way Kubernetes likes them.# Example:importosnamespace='your-awesome-namespace'# Define file inputcredentials=[{'secret_name':'google-credentials','namespace':namespace,'type':'Opaque','input_files':[# Please use the absolute path for input{'name':'service_account.json','path':'secrets/service_account.json'},]}]# Define env file inputenv_files=[{'secret_name':'env-vars','namespace':namespace,'type':'Opaque',# Please use the absolute path for input'input_file':'.env'}]# Please use the absolute path for outputmanifest_generator=ManifestGenerator(output_dir='secrets')manifest_generator.create_from_files(credentials)manifest_generator.create_from_env_files(env_files)
Package: k8s-smuggler
[WIP] Smuggler⚠️ This is a Work In Progress ⚠️Smuggler is a CLI that aids with the migration of Kubernetes resources between clusters.QuickstartRequires Python 3.10 or superior:# (Optional) create and activate a virtualenv to avoid cluttering the system environmentpython3-mvenvvenvsourcevenv/bin/activate# Install Smugglerpipinstallk8s-smuggler# Do a migration, make sure the namespace $NS exists in both clusterssmugglermigratenamespace--from"$CTX1"--to"$CTX2"--namespace"$NS"DevelopmentDev requirementsPython 3.10 or superiorPoetryfor dependency management toolSetup the dev environment withpoetry install, this will create a virtualenv with all necessary dependencies installed. Make sure to point your IDE to this virtualenv to take advantage of autocompletion.Seepyenvif you need a Python version management tool.Project structureThe project has a very simple structure:k8s_smuggler/: Application source code.k8s_smuggler/main.py: Application entrypoint.k8s_smuggler/configuration.py: Application configuration file, all defaults go here and there should't be any configuration hardcoded anywhere else.k8s_smuggler/commands: Handlers for CLI arguments, all subcommands are registered inentrypoint.py.k8s_smuggler/actions: Application specific logic.k8s_smuggler/kubernetes: Kubernetes specific logic.k8s_smuggler/cli: CLI specific logic, helpers that improve UX.k8s_smuggler/lib: Generic and redistributable libraries.dummy_service/: Kustomize manifests for a simple service for different Kubernetes versions, you can use these to test drive the tool.test/: Tests (or lack thereof, WIP), currently only has a script that runs the linter.
Package: k8s-spark-helper-liangdao-data
###spark-helper####在k8s集群中调用spark (https://github.com/GoogleCloudPlatform/spark-on-k8s-operator)Author:yuchao.li@liangdao.aiCreated: 2023.3.9Usage:
    s3_config = {'endpoint': 'http://minio.minio-tenant',
                'access': 'xxx',
                'secret': 'xxx'}

    set_config(image='pyspark:driver-3.3.1',
               namespace='spark-operator',
               service_account='sparkoperator',
               s3_config = s3_config )

    start_spark('hello-world-spark',
                's3a://airflow-dags/spark/pyspark_helloworld.py',
                False)####配置优先级：
从高到低
set_config 设置的配置
auto_load_config 自动加载的环境变量配置
Package: k8s-voca
k8s-vocakubernetes vocabularyhttps://pypi.org/project/k8s-voca.　/＼＿／ヽ
／ _ノ　ヽ_ ＼
|　　━　 ━　i
＼ミ (_人_) 彡
　／￣￣⌒＼/⌒)―――― - kubernetes vocabulary
. /　　　　＿／　
. |　　　＼
　＼ 〇_　 ＼
　　＼ノ.＼_ノUser Guidehttps://dmario24.github.io/k8s-voca$ pip install k8s-voca
$ kv node
>> 쿠버네티스는 컨테이너를 파드내에 배치하고 노드 에서 실행함으로 워크로드를 구동한다. 노드는 클러스터에 따라 가상(EC2) 또는 물리적 머신일 수 있다.Template creation helpcookiecutterhttps://github.com/becky2sawyer/cookiecutter-pypackage-mkdocss.git
Package: k8syaml
K8s deployerThis repository implementes helpers for the programmatic deployment of K8s resources on a cluster.The core of the logic is contained in thek8s_yaml_obj.py, which implements classes for relevant YAML elements on K8s resources.The generated YAML files can be then normally used throughkubectlinline commands or within the desired script.Pypi InstallationThe core can also be installed as pypi package:pip install k8syamlUse casesFor examples of end uses please refer tohttps://github.com/paoloalba/dev_tf_modelhttps://github.com/paoloalba/tf_apihttps://github.com/paoloalba/image_segmentation_distributed
Package: k9
K9 - ExperimentalTested with: kubernetes v10.0.1K9 is a helper library to simplify the automation of Kubernetes.  It is an experiment to find the simplest interface that can be useful for automating Kubenetes.  If you need to automate the deployment if your application and the setup of Kubernetes, this is a new and simple way to get that done.Why K9?YAML and JSON configuration files have a gone a long way towards automating the creation of cloud environments. These are great for concisely describing configurations, but as our configurations get progressively more complex and elaborate, we need the ability to build logic into our automation. Tools based on YAML/JSON configuration files have limited ability to construct loops, variables, and if-statements.As coders, it’s much easier to just code in a language that naturally supports these constructs to perform the automation tasks. This library is created for coders that have the responsibility of fully automating their cloud environments, specifically Kubernetes environments.K9 is a Python 3 based facade over the Kubernetes API, and it’s intent is to present a simplified interface to automate Kubernetes activities.In addition, we are putting emphasis on providing complete documentation with lots of example code so that hopefully, you can accomplish your tasks easily relying only on this documentation. If you find areas that don’t make sense or needs better elaboration, let us know.Design ApproachOur primary objective is to make automating deployments on Kubernetes as simple and easy as possible. We are taking both a minimalist and opinionated approach to achieve this:Create the smallest API that can provide the most functionality. That means cutting out functions that are redundant or infrequently used - focusing on the 20% that gets 80% or more of what you need done.Reduce the complexity and number of parameters that need to be passed in to perform a given function.Provide complete documentation with examples.Getting StartedThe complete documentation can be found here:http://k9.docs.simoncomputing.com/.  You can follow the links at the bottom left of each page to step through all the features.
Package: kaadbg
Kaadbg is a utility to start debugger session with text editorkaa. Please visitPython debugger section of kaa documentfor usage.ContentsInstallationHistory0.0.1 - 2013.6.16CopyrightInstallationUse easy_install or pip to install kaadbg from PyPI$ sudo easy_install -U kaadbgHistory0.0.1 - 2013.6.16Initial release.CopyrightCopyright (c) 2013 Atsuo IshimotoPermission 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: kaaengine
kaaKAA - Pythonic game engine for humansInstallationFrom PyPI:pip install kaaengineFrom repository (withpip):pip install 'git+https://github.com/kaaengine/kaa'From cloned repository:git clone --recursive https://github.com/kaaengine/kaa && cd kaa
python setup.py installDebug build:git clone --recursive https://github.com/kaaengine/kaa && cd kaa
python setup.py install --build-type DebugDocumentationhttps://kaa.readthedocs.io/ChangelogSeeCHANGELOG file.
Package: kaa-rest-server
KaaA very simple python server framework for REST applications.StartingRequirementspyYaml for OpenApi outputInstallpipinstallkaa-rest-serverMain filesDefinitionRequires file definition.py at the top of the project:importloggingNAME='Simple kaa Server'# Your project nameVERSION='v1.0'# VersionSERVER='server.Server'# Module and main classLOG=logging.getLogger()DEBUG=TrueENABLE_CORS=FalseApplication fileRequires a simple file to start server (app.py)importimportlibfromkaa.cliimportCli,Server# For WSGI applicationdefapplication(env,start_response):returnServer().serve(env,start_response)# For developmentif__name__=="__main__":cli=Cli()cli.execute()Main classes(file server.py)This class initializes Kaa for each http requestfromkaaimportKaa,KaaServerclassServer(KaaServer):defregister_resources(self):self.kaa.register_resources('app','AppResources')This class define your resourcesfromkaaimportGET,PATH,Resources,Response,StatusclassAppResources(Resources):@GET@PATH('/')defbasic_resource(self,**params):returnResponse(Status.OK).json({'message':'your response'})Starting server$ python kaa.py serveBy default host is 127.0.0.1 and port is 8086Start with diferent host and port:$ python kaa.py serve host:port
Package: kaartmaker
KaartmakerMake world and regional labeled maps based on voting. Most commonly used for representing UN General Assembly votes.kaartmaker-C./kaartmaker/datasets/UN_general_assembly/russia_ceasefire/world_ukraine_votes.csv-t"UNGA vote on ceasefire in Ukraine"-s"gadebate.un.org"kaartmaker-C./kaartmaker/datasets/UN_general_assembly/israel_ceasefire/world_palestine_votes.csv-t"UNGA on Ceasefire in Gaza"-s"gadebate.un.org"-rworldkaartmaker-C./kaartmaker/datasets/UN_general_assembly/israel_ceasefire/world_palestine_votes.csv-t"UNGA on Ceasefire in Gaza"-s"gadebate.un.org"-reuropekaartmaker-C./kaartmaker/datasets/UN_general_assembly/russia_ceasefire/world_ukraine_votes.csv-t"UNGA vote on ceasefire in Ukraine"-s"gadebate.un.org"-reuropeIf you'd like to see more examples, please check them outhere.Secondary featuresGenerate geojson files for specific regions :)Colors are colorblind friendly, selected fromherecan also be reversedInstallationMake sure you have at least Python 3.12 and poetry installed, then you can do:# install kaartmakerpoetryinstall# open a virtual envpoetryshellHow Tokaartmaker--helpDonwload your geojson dataMaps (sovereignty, units, subunits, and disputed areas) can be downloaded from:https://www.naturalearthdata.com/downloads/10m-cultural-vectors/10m-admin-0-details/You can also download geojson files with thedownload_geojson.shscript in this repo.Using a comma separated list (CSV) fileTo usekaartmaker, you'll need to provide a CSV file with columns calledNAME_ENandVOTE. Valid votes areYES|NOorAGAINST|ABSTENTION|IN FAVORExample when documenting :NAME_EN,VOTE
Brazil,IN FAVOR
Czechia,AGAINST
Germany,ABSTENTIONstatusMostly stable, but happy to take a look at Issues and Pull Requests :)
Package: kabaret.flow-button-pages
kabaret.flow_button_pagesA collection of custom_page widgets to use in your flow, as well as
an extended Home page showing thumbnail/icon and color for your Projects.Button HomeThe Button Home extends the default Home page will a few options.Right click on an empty space on the Home page to access theAdminarea. You will find the default Home with additionalHome Settings:Show Status: Will show the Project status below its name.Show Archived: Will hide archived Project unless checked.Button Height: Height of each Project button.Default Thumbnail: Defines the thumbnail to use when
no thumbnail is set on a Project.As well as theProject Settings. You can edit them here, or with a
right click on a Project button ->ConfigureColor: use an hex color here, it will change the button text color.Thumbnail: Define the thumbnail to show on the button. You can
use:A file path (! avoid backslashes !)A data uri. This will embed the image in the database. You can
use Chrome Developers Tools to get it from an image.A classickabaretresource identifier like('icons.gui', 'start')In order to create a new Project or edit a Project status, you still need
to use the classic controls (The actions are in theAdminarea'sProjectsMap).UsageIn your Session class, override the_create_actor()method to create
a Flow actor usingButtonHomeRootas custom home root:from kabaret.app.ui import gui
      from kabaret.app.actors.flow import Flow
      from kabaret.flow_button_pages import ButtonHomeRoot

      class MySession(gui.KabaretStandaloneGUISession):
      
          def _create_actors(self):
              Flow(self, CustomHomeRootType=ButtonHomeRoot)That's it ! \o/
Package: kabaret.script-view
The kabaret.script_view package is a kabaret GUI extension.It defines a “Script” view where you can edit and execute python scripts using ‘self’ as a selected flow Object.It also defines the handy “pyscript” editor that you can use to show/edit python code in yourflow.Param(it is registered automatically by importingkabaret.script_view).And finally, it defineskabaret.pyscript_flow.PyScriptValuewhich is aflow.values.Valuewith the “pyscript”
editor and an browsable history of every edits (with time, author, location, editable comments…)
Package: kabaret.sqarf-flow
kabaret.sqarf_flowKabaret flow extension to quality test your assets usinghttps://pypi.org/project/sqarfUsageCreate your sqarf.QATest types (see sqarf documentation).Subclass thekabaret.sqarf_flow.qarun.QARunAction and override itsget_test_types()method to return all your "root" test type.Place this subclass as a child of the Object you want to test. It will be available
in your test context ascontext['TESTED'].
Package: kabbes-analytics-packages
GitHub PagesPyPIanalytics_packagesHelper functions for generic analysis and iteracting with Excel filesInstallationpip install kabbes_analytics_packagesUsageFor more in-depth documentation, read the information provided on the Pages. Or better yet, read the source code.importanalytics_packages.custom_xlwingsascxwwb=cxw.get_wb('excel_data.xlsx')ws=cxw.get_ws(wb,sheet='Sheet1')df=cxw.get_df_from_ws(ws)#Pandas DataFramecxw.delete_sheet(ws)importanalytics_packages.custom_pandasascpdimportpandasaspddf = pd.DataFrame( {'A': [ 1,2,3 ], 'B': [ 4,5,6 ] } )
df_new = cpd.move_last_column_to_first( df )
print (df_new)>>>
   B  A
0  4  1
1  5  2
2  6  3AuthorJames Kabbes
Package: kabbes-aws-connections
aws_connectionsPackage for easy connections to AWS based on the boto3 libraryDocumentationPyPIInstallationpip install kabbes_aws_connectionsUsageFor more in-depth documentation, read the information provided on the Pages. Or better yet, read the source code.importaws_connectionsasawsaws_conn=aws.Connection(aws_access_key_id='XXXXXX',aws_secret_access_key='XXXXXX )remote_Path=aws.s3.S3Path(bucket='mybucket',path='path/to/file/asdf.txt',conn=aws_conn)remote_Path.download(destination='C:/Local/Path/asdf.txt')remote_Path.copy(destination='path/to/file/asdf_copy.txt')AuthorJames Kabbes