Saravanan666/pypi-org huggingface dataset:
Package: goenrich
goenrichConvenient GO enrichments from python. For use inpythonprojects.Builds the GO-ontology graphPropagates GO-annotations up the graphPerforms enrichment test for all categoriesPerforms multiple testing correctionAllows for export topandasfor processing andgraphvizfor
visualizationInstallationInstall package from pypi and download ontology and needed annotations.pipinstallgoenrichmkdirdb# Ontologywgethttp://purl.obolibrary.org/obo/go/go-basic.obo-Odb/go-basic.obo# UniprotACCwgethttp://geneontology.org/gene-associations/goa_human.gaf.gz-Odb/gene_association.goa_human.gaf.gz# Yeast SGDwgethttp://downloads.yeastgenome.org/curation/literature/gene_association.sgd.gz-Odb/gene_association.sgd.gz# Entrez GeneIDwgetftp://ftp.ncbi.nlm.nih.gov/gene/DATA/gene2go.gz-Odb/gene2go.gzRun GO enrichmentimportgoenrich# build the ontologyO=goenrich.obo.ontology('db/go-basic.obo')# use all entrez geneid associations form gene2go as background# use annot = goenrich.read.goa('db/gene_association.goa_human.gaf.gz') for uniprot# use annot = goenrich.read.sgd('db/gene_association.sgd.gz') for yeastgene2go=goenrich.read.gene2go('db/gene2go.gz')# use values = {k: set(v) for k,v in annot.groupby('go_id')['db_object_symbol']} for uniprot/yeastvalues={k:set(v)fork,vingene2go.groupby('GO_ID')['GeneID']}# propagate the background through the ontologybackground_attribute='gene2go'goenrich.enrich.propagate(O,values,background_attribute)# extract some list of entries as example query# use query = annot['db_object_symbol'].unique()[:20]query=gene2go['GeneID'].unique()[:20]# for additional export to graphviz just specify the gvfile argument# the show argument keeps the graph reasonably smalldf=goenrich.enrich.analyze(O,query,background_attribute,gvfile='test.dot')# generate htmldf.dropna().head().to_html('example.html')# call to graphvizimportsubprocesssubprocess.check_call(['dot','-Tpng','test.dot','-o','test.png'])Generatepngimage using graphviz:dot-Tpngexample.dot>example.pngor directly from python:importsubprocesssubprocess.check_call(['dot','-Tpng','example.dot','-o','example.png'])Check the documentation for all available parametersLicence & ContributorsThis work is licenced under the MIT licenceContributions are welcome!Special thanks@lukauskasfor implementing i/o support for file-like objects.@zfrencheefor fixing a bug in the calculation of the test statistic.@pommy1for implementing support fornetworkx >= 2.0.0.Building the documentationsphinx-apidoc-f-odocsgoenrichgoenrich/tests
Package: goerr
GoerrGo style explicit error handling in Python. Features:Pretty printof error detailsTraceerrors across the call stackLogerrorsTesterrorspipinstallgoerrDocumentationAPIClassErrMethods:err: creates a new error, print it and store it in the trace if the option is activated. Exit the program
if the trace is not activated. Parameters:ex: an exception (optional)msg: the message string (optional)
Either a message string or an exception has to be provided as argument for the error to be
printed. If no argument is provided it will just record the function name to keep a trace of
the call stackwarning: prints a warning messageinfo: prints an info messagedebug: prints a debug messagepanic: force program exit after an error even if the errors trace is activatedto_dict: returns a dictionnary with the error detailsClassLogSame asErrbut log errorsPropertieslog_path: path of the file where to log. Default is"errors.log"log_format: csv or text. Default is"csv".
Note: the tracebacks are not recorded if the format is csv.ClassTraceSame asErrbut trace errorsPropertiestrace: prints the errors trace and reset itvia: same aserrwith an empty error: to record the call stack. See exampleExampleCheck theexamplesdirectory for codeTrace errors across the call stack:importtimefromgoerrimportTraceerr=Trace()deffunc1():print("Func 1 running")time.sleep(0.5)try:'x'>1exceptExceptionase:err.new("Errmsg frun func1",e)print("Func 1 finished")deffunc2():func1()time.sleep(0.5)err.via("Errmsg frun func2")print("Func 2 running")deffunc3():func2()time.sleep(0.5)err.via()print("Func 3 running")func3()err.trace()Output:Testing errors in programsA helper function is available to test errors:testing.assert_err: parameters:error type: a string with the error typefunction to run: the function to test*args: function arguments**kwargs: function keyword argumentsExample:# the programfromgoerrimportErrclassFoo(Err):deffunc1(self,param1,param2):try:param1>param2exceptExceptionase:self.err(e)# the testimportunittestfromgoerr.testingimportassert_errfrommyprogramimportFooclassMyTest(unittest.TestCase):deftest_myprogram(self):foo=Foo()assert_err("TypeError",foo.func1,1,"bar")Why?I like the explicit errors management in Go (unlike many people) and I wanted to have the
same kind of experience in Python: a fined grained control over errors all across the call
stack.The same lib in Go:terr
Package: goerrpy
goerrpyDecorator for simulating Go's error handling in PythonA simple example:fromgoerrpyimportgoerr@goerr()defhello_world():raiseException("WORLD SHALL NOT BE GREETED!")value,err=hello_world()iferrisnotNone:print(err)Passing variables:@goerr()defget_numbers_larger_than_five(list:typing.List):result=[]fornuminlist:iftype(num)isnotint:raiseException("All values should be integers!")ifnum>5:result.append(num)returnresultvalue,err=get_numbers_larger_than_five([4,5,6,7])iferrisnotNone:print(err)# value is [6, 7]How to unpack multiple values:@goerr(unpack=True)defget_numbers_smaller_than_five_but_unpack(list:typing.List):result=[]fornuminlist:iftype(num)isnotint:raiseException("All values should be integers!")ifnum<5:result.append(num)returnresult,result# so that it can be unpackedfirst_list,second_list,err=get_numbers_smaller_than_five_but_unpack([3,4,5,7])iferrisnotNone:print(err)# first_list is [3, 4] and second_list is [3, 4]
Package: goes16ci
GOES 16 Lightning Count Prediction BenchmarkThe GOES 16 Lightning Count Prediction benchmark is a deep learning benchmark for HPC systems
used for atmospheric science problems.ContributorsDavid John GagneBill AndersonGunther WallachRequirementsThe code is designed to run on Python 3.6 and 3.7. It requires the following
Python libraries:numpyscipypandasxarraytensorflow>=2.0.0scikit-learnpyprojdask distributed (for data processing)ipythonjupyter (for interactive visualization of neural networks)Setup from ScratchInstall Python 3.7 on your machine. I recommend the Miniconda Python installer availablehere.Create a benchmark environment:conda create -n goes16 python=3.7Once the environment is installed activate it on your machine:source activate goes16Install the needed Python libraries from condacondainstall-cconda-forge--yes\pip\ipython\jupyter\numpy\scipy\matplotlib\xarray\netcdf4\pandas\pyyaml\dask\distributed\scikit-learn\pyprojMake sure the CUDA kernel and CUDA toolkit are installed on your system and know the path
and versions.Install the tensorflow-gpu binary (if installing tensorflow 1.15) or tensorflow binary (if tensorflow 2). For more detailed installation instructions
visit thetensorflow website.# If you plan to use tensorflow 2pipinstalltensorflowRun Benchmark ScriptClone the goes16ci git repository to your home directory.cd~
gitclonehttps://github.com/NCAR/goes16ci.gitcdgoes16ciInstall the goes16ci librarypipinstall.Download the GOES16 patch files. You will need about 8 GB free to download
and untar the data.pythondownload_data.pyRun the benchmark script. The script will output trained neural networks and a yaml file
with the timing information for each step.pythongoes16_deep_learning_benchmark.pyIf you want to modify the neural network or other properties of the script,
you can make a copy of benchmark_config_default.yml and modify it. To run the script with the
new config file:pythongoes16_deep_learning_benchmark.py-cbenchmark_config_default.ymlSetup on Cheyenne/CasperClone the git repo to your home directorycd~
gitclonehttps://github.com/NCAR/goes16ci.gitcdgoes16ciCreate a link to the patch data on GLADEln-s/glade/p/cisl/aiml/dgagne/goes16_nc/ABI_patches_20190315dataModify thegoes16_benchmark_casper.shscript with your account number.Submit the benchmark script to the casper queue:sbatch goes16_benchmark_casper.sh
Package: goes-api
Welcome to GOES API - An API to download and search for GOES satellite data.The GOES-API is still in development. Feel free to try it out and to report issues or to suggest changes.QuickstartThe code in this repository provides an API to download, query and filter GOES16 and GOES17 satellite data.Data download and query/filtering is available:for local file systems, Google Cloud Storage and AWS S3.for sensors ABI, EXIS, GLM, MAG, SEIS and SUVI.The foldertutorialsprovide the following jupyter notebooks, describing various features ofGOES_API:Downloading GOES data:download.ipynbFind and filter GOES data:find_and_filter.ipynbRead data directly from AWS S3 and GCS buckets:read_bucket_data.ipynbRead ABI L1B and L2B products from cloud buckets and plot it with satpy:read_bucket_data_with_satpy.ipynbExtract zarr reference files using kerchunk:kerchunk_data.ipynbThe folderdocscontains documents with various information related to GOES data products.Documentation is available at XXXXXInstallationpipGOES-API can be installed viapipon Linux, Mac, and Windows.
On Windows you can installWinPythonto get Python and pip running.Then, install the GOES-API package by typing the following command in the command terminal:pip install goes_apiCitationIf you are using GOES-API, please cite:Ghiggi Gionata. ghiggi/goes_api. Zenodo.https://doi.org/10.5281/zenodo.7787851If you want to cite a specific version, have a look at theZenodo site.ContributorsGionata GhiggiLicenseThe content of this repository is released under the terms of theMITlicense.
Package: goesutils
GOES UtilitiesQuick Python script to download and plot GOES satellite preview and hi-resolution data by date/time.Installpython -m pip install -e .UsageThe scripts work with two types of data:preview .jpg, 3 hour cadencefull fidelity NetCDF4, 1 minute cadenceFull fidelity dataSelect data using GOESshopping cart.
Search by date, geographic region.
Consider getting NetCDF format data unless you're familiar with the other options.Registerfor NOAA CLASS if needed.It may take up to 48 hours to get access to your order.
NOAA CLASS emails you when data is ready.
Each 5-10 minute set of multi-band data is several hundred megabytes at full resolution.Preview (3 hour cadence)GetGOES preview imagedatawith parallel download:pythonget-goes-preview.pygoesnumstartstopoutdirexample: download IR from GOES-13 2018-01-01 to 2018-01-02 to~/data/goes13:pythonget-goes-preview.py13IR2018-01-01T002018-01-03T00~/data/goes13These are updated every 3 hours.
For science use, you'll want thefull fidelity GOES dataupdated on minutely timescale.Plot GOES IR data georegistered via Cartopy:pythonplot-goes.py~/data/goes13Plot a specific file:pythonplot-goes.py~/data/goes13/2018-01-01T12:35:00.jpg
Package: goethe
Create RST documents programmatically with PythonIntroductionGoethe gives you the opportunity to create your individual RST project in Pythonprogrammatically- write your project as Python script in OOP style, place variables where ever you wantdynamically- render the project to dict, json or actual files and even PDFSetupVia Pip:pipinstallgoetheVia Github (latest):pipinstallgit+https://github.com/earthobservations/goetheStructureGoethe uses 3 main levels of abstraction:Goethe - initialize an RST project with a GoetheFlatChapter - add a chapter based on one file at the same level as the GoetheDeepChapter - add a chapter based on a folder with its own indexA simple project could look like e.g.Goethe("myproj")FlatChapter("overview")DeepChapter("depper_level)FlatChapter("overview")DeepChapter("second_chapter")with following file structure:./index.rstoverview.rst./deeper_levelindex.rstoverview.rst./deeper_level/second_chapterindex.rstFeaturessetup a RST projectexport to dict, files or htmlflat and deep chapters to build unlimited depth of documentationmodules of RST:toctreeparagraphBacklogExamplesVisualized examples can be found in theexamplesfolder.LicenseDistributed under the MIT License. SeeLICENSEfor more info.BacklogChangelogDevelopment
Package: go-extension
go-extensiongo-extension providesGoExtensionclass that is given as one ofext_modulesargument tosetuptools.setup()to generate and compile a CPython extension module from Go pacakges.RequirementsPython3.10 or laterGo1.16 or later (in order to build)Installation$pipinstallgo-extensionGetting Startedfromsetuptoolsimportsetupfromgo_extensionimportGoExtensionext=GoExtension(name='hello_go',packages=['github.com/huisint/go-extension-python/hello'])importsyssys.argv=['','build_ext','--inplace']# To call `build_ext` command of setup().setup(ext_modules=[ext])fromhello_goimporthelloprint()hello.hello_world()# print "Hello, World"hello.greet('Go')# print "Hello, Go"Go package in Python project rootNow you havepy_pkgandgo_pkgin project root.
The following shows how to buildgo_pkgas a Python package namedpy_pkg/go.project-root
│
├─go_pkg
│   └─main.go # package hello
│
└─py_pkg
    └─__init__.pyFirst, init your project root as Go module by running:$gomodinitexample.com/foo/barSecond, createsetup.pylike this:fromsetuptoolsimportsetupfrompathlibimportPathtry:fromgo_extensionimportGoExtensionexcept(ImportError,ModuleNotFoundError):frompip._internal.cliimportmainaspippip.main(['install','-U','go-extension'])fromgo_extensionimportGoExtensionext=GoExtension(name='py_pkg.go',pakcages=['example.com/foo/bar/go_pkg'],sources=[file.as_posix()forfileinPath('go_pkg').glob('*.go')iffile.is_file()])setup(ext_modules=[ext])Third, build the extension by running:$pythonsetup.pybuild_ext--inplaceNow you can import the Go package as a Python module like:frompy_pkg.goimporthellohello.do_something()project-root 
│
├─go_pkg
│   └─main.go
│
├─py_pkg
│   ├─go
│   │  ...
│   └─__init__.py
│   
├─go.mod
└─setup.pyDistributionsGoisNOTrequired to run the compiled Python bindings.You can build a wheel as a distribution by running:$pipinstall-Uwheel
$pythonsetup.pybdist_wheelOptionsIf your go command is notgo, then inheritgo_extension.build_ext.build_ext_goand changego_commandproperty.fromsetuptoolsimportsetupfromgo_extension.build_extimportbuild_ext_goclassbuild_ext(build_ext_go):go_command='path/to/go'setup(cmdclass={'build_ext':build_ext})LicenseMIT License
Package: gofeatureflag-python-provider
GO Feature Flag Python ProviderGO Feature Flag provider allows you to connect to your GO Feature Flag instance.GO Feature Flagbelieves in simplicity and offers a simple and lightweight solution to use feature flags.Our focus is to avoid any complex infrastructure work to use GO Feature Flag.This is a complete feature flagging solution with the possibility to target only a group of users, use any types of flags, store your configuration in various location and advanced rollout functionality. You can also collect usage data of your flags and be notified of configuration changes.Python SDK usageInstall dependenciesThe first things we will do is install theOpen Feature SDKand theGO Feature Flag provider.pipinstallgofeatureflag-python-providerInitialize your Open Feature clientTo evaluate the flags you need to have an Open Feature configured in you app.
This code block shows you how you can create a client that you can use in your application.fromgofeatureflag_python_provider.providerimportGoFeatureFlagProviderfromgofeatureflag_python_provider.optionsimportGoFeatureFlagOptionsfromopenfeatureimportapifromopenfeature.evaluation_contextimportEvaluationContext//...goff_provider=GoFeatureFlagProvider(options=GoFeatureFlagOptions(endpoint="https://gofeatureflag.org/"))api.set_provider(goff_provider)client=api.get_client(name="test-client")Evaluate your flagThis code block explains how you can create anEvaluationContextand use it to evaluate your flag.In this example we are evaluating abooleanflag, but other types are available.Refer to theOpen Feature documentationto know more about it.// Context of your flag evaluation.// With GO Feature Flag you MUST have a targetingKey that is a unique identifier of the user.evaluation_ctx=EvaluationContext(targeting_key="d45e303a-38c2-11ed-a261-0242ac120002",attributes={"email":"john.doe@gofeatureflag.org","firstname":"john","lastname":"doe","anonymous":False,"professional":True,"rate":3.14,"age":30,"company_info":{"name":"my_company","size":120},"labels":["pro","beta"],},)admin_flag=client.get_boolean_value(flag_key=flag_key,default_value=default_value,evaluation_context=ctx,)ifadmin_flag:#flag"flag-only-for-admin"istruefortheuserelse:#flag"flag-only-for-admin"isfalsefortheuser
Package: gofers
📦 setup.py (for humans)This repo exists to providean example setup.pyfile, that can be used
to bootstrap your next Python project. It includes some advanced
patterns and best practices forsetup.py, as well as some
commented–out nice–to–haves.For example, thissetup.pyprovides a$ python setup.py uploadcommand, which creates auniversal wheel(andsdist) and uploads
your package toPyPiusingTwine, without the need for an annoyingsetup.cfgfile. It also creates/uploads a new git tag, automatically.In short,setup.pyfiles can be daunting to approach, when first
starting out — even Guido has been heard saying, "everyone cargo cults
thems". It's true — so, I want this repo to be the best place to
copy–paste from :)If you're interested in financially supporting Kenneth Reitz open source, considervisiting this link. Your support helps tremendously with sustainability of motivation, as Open Source is no longer part of my day job.Check out the example!To DoTests via$ setup.py test(if it's concise).Pull requests are encouraged!More ResourcesWhat is setup.py?on Stack OverflowOfficial Python Packaging User GuideThe Hitchhiker's Guide to PackagingCookiecutter template for a Python packageLicenseThis is free and unencumbered software released into the public domain.Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any means.✨🍰✨
Package: gofile
gofileA simple Python wrapper for the Gofile API.InfoThe Gofile API and the Python wrapper are currently in their beta versions and will evolve over time. Check regularly to see if changes have been made.Current version works with the2021-11-17API.LinksGofile API referencegofile PyPI pageInstallationTo install runpython3 -m pip install gofileor justpip install gofileUsageSeedocumentationfor detailed usage examples.importgofileserver=gofile.getServer()print(server)gofile.uploadFile("/home/user/documents/images.zip")
Package: gofile-api
GoFile APIDescriptionA python library for communicating with the Gofile API.FeaturesGet an available server.Upload a file.Create a guest account.Get contents of a folder.Create a folder.Get the account information.Set option for a content id. This can be a password, whether the content should be public, the content description,and expiration date, tags, orDelete files and/or folders.Changelog0.0.1First upload0.0.2Added more documentation0.0.3Fixed long description on PyPi0.0.4Fixed long description on PyPi, againAdded documentation for all functions, and improved existing documentationFixed GoFileSession.upload_file0.0.5Another try at making the actual imports work0.0.6Last try at making the actual imports work before I jump off a balcony0.0.7Importing the package now works0.1.0 First full and stable release!Added uploading a file with optionsAdded proper exception and response handlingLicense file included with PyPi repositoryAdded function to delete contentFixed a few broken functions0.2.0Importing the package broke, fixed it
Imported exceptions ininit.py
Package: gofile-client
gofile-clientA wrapper around thegofile.io API.Installationviapippip install --user gofile-clientUsagefromgofileimportGofileclient=Gofile(token='<your-token>')# Upload a fileresponse=client.upload_file('path/to/file')print(response)# Get the link to a filefolder_contents=client.get_content('<file-id>')for_,iteminfolder_contents:print(item['link'])
Package: gofile-dl
gofile-dlFeaturesDownload files and folders (including nested items) from Gofile.Even works with "overloaded" content.Installationviapipx(recommended)pipx install gofile-dlviapippip install --user gofile-dlUsage$ gofile-dl -h
usage: gofile-dl [-h] [--input-file <file>] [--output-dir <directory>] [--flatten] [--password <password>] [--token <token>] [--dry-run] [--verbose] [--version]
                 [link ...]

positional arguments:
  link                  link to content to download (passing multiple links is supported)

options:
  -h, --help            show this help message and exit
  --input-file <file>, -i <file>
                        file containing Gofile links
  --output-dir <directory>, -o <directory>
                        directory in which to save downloaded files
  --flatten             save all files in the same directory
  --password <password>, -p <password>
                        password of password-protected files
  --token <token>, -t <token>
                        Gofile account token (guest account will be used if omitted)
  --dry-run, --simulate
                        build the download target list but do not download anything
  --verbose, -v         increase output verbosity
  --version             show program's version number and exit
Package: gofilepy-api
Gofilepy - Unofficial Python wrapper for Gofile APIA true wrapper for Gofile's REST API.InstallationInstall Gofilepy with pippipinstallgofilepy-apiDocumentationgofilepy docs/referenceGofile REST API referenceUsage/Examples (Free Users)fromgofilepyimportGofileClientclient=GofileClient()#Free users can this functionfile=client.upload(file=open("./test.txt","rb"))print(file.name)print(file.page_link)#View and download file at this linkUsage/Examples (Premium Users)fromgofilepyimportGofileClientfromgofilepy.optionsimportFileOption,FolderOptionfromgofilepy.exceptionsimportGofileAPIAuthenticationErrorclient=GofileClient(token="")#Get token from gofile.io.print(client.account.email)print(client.account.tier)root_folder_id=client.account.root_idroot=client.get(root_folder_id)child=client.create_folder("NEW_FOLDER",parent_id=root.content_id)child.set_option(FolderOption.DESCRIPTION,"New folder created with gofilepy")#More options available https://gofile.io/apichild.set_option(FolderOption.TAGS,["example","gofilepy"])# Registering changes to local variablechild.content_idinroot.children_ids# = false because it hasn't been updatedroot.reload()#Gets any new changes/updates to the folderchild.content_idinroot.children_ids# = true after root folder has been reloaded# Copying content (files & folders)child.copy_to(child.parent_id)#Duplicates folder in same directoryroot.reload()#Now root.children_ids has another id#uploading & downloading filesf=child.upload("./test.txt")#uploads file to newly created "child" folderf.set_option(FileOption.HAS_DIRECT_LINK,True)#Must be set to true to download using gofilepyprint(f.direct_link)#"None"f.reload()#now f.direct_link is updatedpath=f.download("./")#downloads file to local dirprint(path)#function returns full path of downloaded file#Deleting contentchild.delete()#Deletes folderf.delete()#Deletes fileLinksGofilepy docsGofile REST API referenceGofile PremiumDonate to Gofile