Saravanan666/pypi-org huggingface dataset:
Package: cosmologger
Cosmo LoggerA Simple yet Nicely formatted Logger for all your Logging Needs. Made for the Cosmo ProjectKey FeaturesSimple to Use.Supports ColorsConfigurable StylesInstallationYou can install via python'spipmodule:Install with Offical Python Package Index:python3-mpipinstallcosmologgeror with this Git Respiratorypython3-mpipinstallgit+https://github.com/SamHDev/cosmologger.gitNote for Noobies: Ifpython3work then usepythonUsageImporting the LibraryYou can import the library with the following statement:importcosmologgerCreating a Logging ObjectTo Start logging, create a logger object.
This can be placed in the module or in a class so it can be accessed around the project.logger=cosmologger.Logger()The Logger Object can be created with options suchdebugandapp_nameas shown below:logger=cosmologger.Logger(debug=True,# Enables Debug Printapp_name="CORE APP",# Set App Name to Printstyle=None,# Set Style Formating (Format Dict)color=None# Enable Color Print)Logging ExampleTo output messages to the logger/console you can call the many functions found in the Logger Class.Here is a simple Example of each Method.logger.info("This a 'Info' Message")logger.ok("This a 'Ok' Message")logger.warn("This a 'Warn' Message")logger.error("This a 'Error' Message")logger.fatal("This a 'Fatal' Message")logger.debug("This a 'Debug' Message")logger("This a 'Debug' Message but Simpler")logger.log("TEST","This is a Custom Logging Output Type")The above code would produce the resulting output:main>  10:03:18 [INFO] This a 'Info' Message
main>  10:03:18 [-OK-] This a 'Ok' Message
main>  10:03:18 [WARN] This a 'Warn' Message
main>  10:03:18 [ERRR] This a 'Error' Message
main>  10:03:18 [FATAL] This a 'Fatal' Message
main>  10:03:18 [Debug] This a 'Debug' Message
main>  10:03:18 [Debug] This a 'Debug' Message but Simpler
main>  10:03:18 [TEST] This is a Custom Logging Output TypeLogging MethodsTypeOutputMethodsInfo[INFO]Logger.info(msg)Ok[-OK-]Logger.ok(msg)Warning[WARN]Logger.warn(msg)Logger.warning(msg)Error[ERROR]Logger.error(msg)Fatal[FATL]Logger.fatal(msg)Logger.critical(msg)Debug[DBUG]Logger.debug(msg)Logger(msg)Custom LoggingCustom Logging Types is a simple as so:logging.log("Custom Type","Message")Sub Loggers (For Multiple Classes/Modules)A SubLogger can be used for classes/modules across large projects.
ThecosmoLogger.SubLoggeris a subclass ofcosmoLogger.Loggerand contains all the methods
However, the class requires theapp_nameparameter and has the optinalparentparamater that
copies the settings from the 'parent' Logger Object.It can be used like so:sublogger=logger.SubLogger("SUB APP",parent=logger)License and AttributesCreated by Sam Huddart under aliasSamHDevfor theBlume Open Source Project.SamHDev/cosmologgeris licensed under the GNU General Public License v3.0 and is Open-Source as seen inLICENSE. Commercial use, Modification and Distribution are permmited. Although credit is not necessary, it is much obliged. If you do wish to credit the author, please link therespiratoryand the author atgithuborwebsite. Thank you for using our work.
Package: cosmology.api
There are a lot of (Python) cosmology libraries out there, from big projects –
includingAstropy,CLASS, andCAMB– down to small personal scripts.
These libraries perform many of the same tasks, but they all have different
interfaces, and different ways of doing things. This makes it hard to switch
between libraries, and nearly impossible to write code that works with multiple
libraries.The Cosmology API for Python solves this problem, providing detailed interfaces
for cosmology codes, from individual methods and functions up to fully-featured
cosmology objects, even whole libraries. Best of all, using the Cosmology API
does not require any run-time dependencies, even this library!With the Cosmology API you canwrite code that works with anything that
implements the API, i.e many different cosmology libraries. We provide the
easy-to-use, well-defined descriptions, you can build functions that work with
any supporting library. For example# No implementation, just a description of the interface!fromcosmology.apiimportStandardCosmologydefflat_angular_diameter_distance(cosmo:StandardCosmology[Array,Array],z:Array)->Array:# Do some cosmology with any object that implements the APIifcosmo.Omega_k!=0:raiseValueError("This function only works for flat cosmologies")returncosmo.comoving_distance(z)/(1+z)
Package: cosmolopy
CosmoloPy is a package of cosmology routines built on NumPy/SciPy.Capabilities includecosmolopy.densityVarious cosmological densities.cosmolopy.distanceVarious cosmological distance measures.cosmolopy.luminosityfunctionGalaxy luminosity functions (Schecter functions).cosmolopy.magnitudesConversion in and out of the AB magnitude system.cosmolopy.parametersPre-defined sets of cosmological parameters (e.g. from WMAP).cosmolopy.perturbationPerturbation theory and the power spectrum.cosmolopy.reionizationThe reionization of the IGM.
Package: cosmo-pair-counting
Package for optimized pair countingLicenseThis project is Copyright (c) Victor Calderon and licensed under
the terms of the BSD 3-Clause license. This package is based upon
theAstropy package templatewhich is licensed under the BSD 3-clause licence. See the licenses folder for
more information.ContributingWe love contributions! cosmo_pair_counting is open source,
built on open source, and we’d love to have you hang out in our community.Imposter syndrome disclaimer: We want your help. No, really.There may be a little voice inside your head that is telling you that you’re not
ready to be an open source contributor; that your skills aren’t nearly good
enough to contribute. What could you possibly offer a project like this one?We assure you - the little voice in your head is wrong. If you can write code at
all, you can contribute code to open source. Contributing to open source
projects is a fantastic way to advance one’s coding skills. Writing perfect code
isn’t the measure of a good developer (that would disqualify all of us!); it’s
trying to create something, making mistakes, and learning from those
mistakes. That’s how we all improve, and we are happy to help others learn.Being an open source contributor doesn’t just mean writing code, either. You can
help out by writing documentation, tests, or even giving feedback about the
project (and yes - that includes giving feedback about the contribution
process). Some of these contributions may be the most valuable to the project as
a whole, because you’re coming to the project with fresh eyes, so you can see
the errors and assumptions that seasoned contributors have glossed over.Note: This disclaimer was originally written byAdrienne Lowefor aPyCon talk, and was adapted by
cosmo_pair_counting based on its use in the README file for theMetPy project.
Package: cosmopawn
CosmoPawn-Py : An API wrapper forCosmoPawnin PythonInstallationpipinstallcosmopawn# orpip3installcosmopawn# orpipinstallgit+https://github.com/pennacap/cosmopawn-pyUsageimportcosmopawnwrapper=cosmopawn.CosmoPawn()# Or pass in an IP address / domainwrapper.download('dog',prefix='dog_pics/dog',no=10)# downloads 10 dog pictures, prefixing their file name with dog and saving it to dog_pics/wrapper.upload(['file1.jpg','file2.png'],['keyword1','keyword2'])# upload file1.jpg and file2.png with keywords keyword1 and keywords2
Package: cosmoplotian
Plotting of images related to cosmologycosmoplotianprovides additional projections and colormaps for the
plotting of astronomical images.LicenseThis project is Copyright (c) Ben Thorne and licensed under
the terms of the BSD 3-Clause license. This package is based upon
theAstropy package templatewhich is licensed under the BSD 3-clause license. See the licenses folder for
more information.
Package: cosmoplots
cosmoplotsRoutines to get a sane default configuration for production quality plots. Used by complex systems modelling group at UiT.InstallationThe package is published to PyPI and can be installed withpipinstallcosmoplotsIf you want the development version you must first clone the repo to your local machine,
then install the project and its dependencies withpoetry:gitclonehttps://github.com/uit-cosmo/cosmoplots.gitcdcosmoplots
poetryinstallUsageSet yourrcparamsbefore plotting in your code, for example:importcosmoplotsimportmatplotlibasmpl# If you only want the default stylempl.style.use("cosmoplots.default")# If you want the two column style, combine it with the default. Setting it after is# important, since values from the default is overridden.mpl.style.use(["cosmoplots.default","cosmoplots.two_columns"])change_log_axis_baseimportmatplotlib.pyplotaspltimportnumpyasnpimportcosmoplotsimportmatplotlibasmplmpl.style.use("cosmoplots.default")a=np.exp(np.linspace(-3,5,100))fig=plt.figure()ax=plt.gca()ax.set_xlabel("X Axis")ax.set_ylabel("Y Axis")base=2# Default is 10, but 2 works equally wellcosmoplots.change_log_axis_base(ax,"x",base=base)# Do plotting ...# If you use "plot", the change_log_axis_base can be called at the top (along with add_axes# etc.), but using loglog, semilogx, semilogy will re-set, and the change_log_axis_base# function must be called again.ax.plot(a)plt.show()matplotlibvs.cosmoplotsdefaultsimportcosmoplotsimportmatplotlibasmplimportmatplotlib.pyplotaspltimportnumpyasnpdefplot()->None:a=np.exp(np.linspace(-3,5,100))fig=plt.figure()ax=fig.add_subplot()ax.set_xlabel("X Axis")ax.set_ylabel("Y Axis")ax.semilogy(a)# Matplotlib ------------------------------------------------------------------------- #withmpl.style.context("default"):plot()# plt.savefig("assets/matplotlib.png")plt.show()# Cosmoplots ------------------------------------------------------------------------- #withmpl.style.context("cosmoplots.default"):plot()# plt.savefig("assets/cosmoplots.png")plt.show()matplotlibcosmoplotsgenerate_hex_colorsThis function generates the hex numbers for the colours extracted from amatplotlibcolour map based on the number of points of interest.
The colors change gradually from bright to dark or vice versa.importmatplotlib.pyplotaspltimportcosmoplotsaxes_size=cosmoplots.set_rcparams_dynamo(plt.rcParams,num_cols=1,ls="thin")color_list=cosmoplots.generate_hex_colors(5,'viridis',show_swatch=True,ascending=True)plt.savefig("./assets/hex_colors.png")# Print color_list to retrieve the hex numbersprint(color_list)#['#fde725', '#5ec962', '#21918c', '#3b528b', '#440154']fig=plt.figure()ax=fig.add_axes(axes_size)fori,colorinenumerate(color_list):ax.plot([1,2],[i,i+1],c=color)plt.savefig("./assets/hex_colors_example.png")plt.show()hex_colors.pnghex_colors_example.png
Package: cosmosc2
Python support for Ball Aerospace COSMOS v5This project allows accessing the COSMOS v5 API from the python programming language.
Additional functionality and support will be added over time.Installation:pip install cosmosc2See the docs, examples for usageCreate a Virtual Python Environmentcdto your project directory and runvirtualenvto create the new virtual environment.The following commands will create a new virtual environment undercosmosc2/venv.cd cosmosc2
py -m pip install venv
py -m venv venvActivate the EnvironmentNow that we have a virtual environment, we need to activate it..\venv\Scripts\activateAfter you activate the environment, your command prompt will be modified to reflect the change.Development requirements-dev.txtAlthought requests is required, when doing development work it is helpful to test with pytest, use black, and coverage. These can be found inrequirements-dev.txt> py -m pip install -r requirements-dev.txtAdd Libraries and Create a requirements.txt FileAfter you activate the virtual environment, you can add packages to it usingpip. You can also create a description of your dependencies usingpip.The following command creates a file calledrequirements.txtthat enumerates the installed packages.py -m pip freeze > requirements.txtThis file can then be used by collaborators to update virtual environments using the following command.py -m pip install -r requirements.txtDeactivate the EnvironmentTo return to normal system settings, use the deactivate command.deactivateAfter you issue this command, you’ll notice that the command prompt returns to normal.
Package: cosmoscope
CosmoscopeBack-end server to handle astronomical operations and pass information to connected clientsFree software: MIT licenseDocumentation:https://cosmoscope.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.1.0 (2018-05-10)First release on PyPI.
Package: cosmosdb
Cosmos DBPython SDK for Azure Cosmos DB NoSQLAbout Cosmos DBStructure (DBs, containers, items)A CosmosDBresourcecan have multipleDBsADBcan have multiplecontainersAcontainercan have multipleitemsIdentifyingEvery item has a compulsoryidfieldEvery container defines a partition key, compulsory for all of it's itemsThe container's partition key field can be set to any string, including/idIf the container's partition key is, e.g.,username, a new item would be:{"id":"<uuid>","username":"<username>",// other optional fields}QueryingPoints reads can be done by givingdb, container, id, partition_keyContainers can be queried with SQLSpecifying apartition_keywill limit the query to a partitionAuthorizationBoth required fields can be obtained from the Azure Portal, within the Cosmos DB resource, Keys tab:COSMOS_ENDPOINT(URI in the portal):https://<resource-name>.documents.azure.com:443/COSMOS_KEY(PRIMARY KEY in the portal):<random base64 string>Environment (.env)For convenience, you can setos.environ["COSMOS_ENDPOINT"]andos.environ["COSMOS_KEY"]. If you do, you can skip specifying them on every call.E.g., create a.envfile:COSMOS_ENDPOINT="<COSMOS_ENDPOINT>"COSMOS_KEY="<COSMOS_KEY>"Then load it before importingfromdotenvimportload_dotenvload_dotenv()importcosmosdbasdbdb.client()# just works!APIAsynchronous (everything is a coroutine)Single calls or multiple using a same client:# single callawaitdb.list.dbs(url=COSMOS_ENDPOINT,key=COSMOS_KEY)# these aren't necessary with a .env file# multiple callsasyncwithdb.client(url=COSMOS_ENDPOINT,key=COSMOS_KEY)asclient:# idem.awaitdb.create.db("<db name>",client=client)dbs=awaitdb.list.dbs(client=client)Functionscosmosdbcreateasyncdefdb(...)asyncdefcontainer(...)asyncdefitem(...)deleteasyncdefdb(...)asyncdefcontainer(...)asyncdefitem(...)listasyncdefdbs(...)asyncdefcontainers(...)asyncdefitems(...)queryasyncdefread(...)asyncdefsql(...)
Package: cosmosdb-bulk-updater
CosmosDB bulk updaterA package to update a tons of documents in Microsoft CosmosDBHow it works?It executes a query and iterate all the items executing an update function defined by the user. This query
will be executed until it return any resultUsageThe sample bellow show how to add a new field into the all database documentsfromcosmosdb_bulk_updaterimportBulkUpdater,Databasedefupdate_document(document:dict):document['new_field']='blah'returndocumentdefrun():database=Database(endpoint="[ENDPOINT]",key="[YOUR_KEY]",database="[DATABASE]",collection="[COLLECTION]")updater=BulkUpdater(database=database,query="SELECT TOP 500 VALUE c FROM c where NOT IS_DEFINED(c.new_field)")updater.execute_update(execute_fn=update_document)if__name__=='__main__':run()
Package: cosmos-etl
Cosmos ETLCosmos ETL lets you convert cosmos blockchain data into convenient formats like CSV and JSON. This project was inspired byethereum etl.QuickstartInstall cosmos-etl pypi package>pipinstallcosmos-etlExport blocks>cosmosetlexport_blocks-s2000000-e2001000-phttps://tendermint.bd.evmos.org:26657-oblocks.csvExport transactions and events>cosmosetlexport_transactions_and_events-s2000000-e2001000-phttps://tendermint.bd.evmos.org:26657-totransactions.csv-eoevents.csvGet block range for date>cosmosetlget_block_range_for_date-phttps://tendermint.bd.evmos.org:26657-d2022-05-12Get block range for timestamps>cosmosetlget_block_range_for_timestamps-phttps://tendermint.bd.evmos.org:26657-s1661708854-e1661808854
Package: cosmospectra
CosmoSpectraCosmoSpectra package is meant for Fourier analysis of cosmological simulations.
For full documentation, lookhere.PREREQUISITESNumpyScipyNumbaAstropyINSTALLATIONOne can install a stable version of this package using pip by running the following command::pip install cosmospectraThis package is being actively under-development, which involves addition of new modules and bug fixes. In order to use the latest version, one can clone this package.To install the package in the standard location, run the following in the root directory::python setup.py installIn order to install it in a separate directory::python setup.py install --home=directoryOne can also install the latest version using pip by running the following command::pip install git+https://github.com/sambit-giri/cosmospectra.git
Package: cosmos-proto
Python implementation for cosmos.protoCurrently, this repo contains generated python files for Terra 2 and Osmosis Blockchains supported Modules.SetupCreate virtual environment$ python3 -m venv env
$ source env/bin/activateInstall poetry$ pip install poetryInstall packages,$ pip install poetry
$ poetry installIf you encounter "version solving failed." error, trypoetry add <package_name>, followed bypoetry lockand thenpoetry installGenerating python files for new proto filesWe usebetterproto[compiler]for generating python code from proto files, and it is party a manual process. Here are a few pointers to help you through the process -cdinto each module and make sure all *.proto files are in one place.For each .proto file, check the import paths and update them if needed.Once the paths are corrected, use the following command to generate python files.$ protoc -I . --python_betterproto_out=<OUTPUT DIR NAME> <PROTO FILE NAMES>For eq - protoc -I . --python_betterproto_out=py genesis.proto query.proto gov.proto feetoken.protoTo installbetterproto[compiler], use -pip install "betterproto[compiler]"TO DO : Update the scripts
Package: cosmospy
cosmospyVersion 6.0.0Tools for Cosmos wallet management and offline transaction signingTable of Contentsgenerated withmdformat-tocInstallingUsageGenerating a walletConverter functionsMnemonic seed to private keyPrivate key to public keyPublic key to addressPrivate key to addressSigning transactionsInstallingInstalling from PyPI repository (https://pypi.org/project/cosmospy):pipinstallcosmospyUsageGenerating a walletfromcosmospyimportgenerate_walletwallet=generate_wallet()The value assigned towalletwill be a dictionary just like:{"seed":"arch skill acquire abuse frown reject front second album pizza hill slogan guess random wonder benefit industry custom green ill moral daring glow elevator","derivation_path":"m/44'/118'/0'/0/0","private_key":b"\xbb\xec^\xf6\xdcg\xe6\xb5\x89\xed\x8cG\x05\x03\xdf0:\xc9\x8b\x85\x8a\x14\x12\xd7\xa6a\x01\xcd\xf8\x88\x93","public_key":b"\x03h\x1d\xae\xa7\x9eO\x8e\xc5\xff\xa3sAw\xe6\xdd\xc9\xb8b\x06\x0eo\xc5a%z\xe3\xff\x1e\xd2\x8e5\xe7","address":"cosmos1uuhna3psjqfxnw4msrfzsr0g08yuyfxeht0qfh",}Converter functionsMnemonic seed to private keyfromcosmospyimportBIP32DerivationError,seed_to_privkeyseed=("teach there dream chase fatigue abandon lava super senior artefact close upgrade")try:privkey=seed_to_privkey(seed,path="m/44'/118'/0'/0/0")exceptBIP32DerivationError:print("No valid private key in this derivation path!")Private key to public keyfromcosmospyimportprivkey_to_pubkeyprivkey=bytes.fromhex("6dcd05d7ac71e09d3cf7da666709ebd59362486ff9e99db0e8bc663570515afa")pubkey=privkey_to_pubkey(privkey)Public key to addressfromcosmospyimportpubkey_to_addresspubkey=bytes.fromhex("03e8005aad74da5a053602f86e3151d4f3214937863a11299c960c28d3609c4775")addr=pubkey_to_address(pubkey)Private key to addressfromcosmospyimportprivkey_to_addressprivkey=bytes.fromhex("6dcd05d7ac71e09d3cf7da666709ebd59362486ff9e99db0e8bc663570515afa")addr=privkey_to_address(privkey)Signing transactionsfromcosmospyimportTransactiontx=Transaction(privkey=bytes.fromhex("26d167d549a4b2b66f766b0d3f2bdbe1cd92708818c338ff453abde316a2bd59"),account_num=11335,sequence=0,fee=1000,gas=70000,memo="",chain_id="cosmoshub-3",sync_mode="sync",)tx.add_transfer(recipient="cosmos103l758ps7403sd9c0y8j6hrfw4xyl70j4mmwkf",amount=387000)tx.add_transfer(recipient="cosmos1lzumfk6xvwf9k9rk72mqtztv867xyem393um48",amount=123)pushable_tx=tx.get_pushable()One or more token transfers can be added to a transaction by calling theadd_transfermethod.When the transaction is fully prepared, callingget_pushablewill return a signed transaction in the form of a JSON string.
This can be used as request body when calling thePOST /txsendpoint of theCosmos REST API.
Package: cosmospy-protobuf
Cosmos ProtobufThis repository compains the whole cosmos protobuf files compiled for python and ready to use with grpc. Please use the according .proto file as documentation for each python file.InstallationYou can install this package directly from the repository by using:python -m pip install cosmospy-protobufUsageThe following code snippet will query the balances for the addressosmo15hzhcvgs2ljfng6unghvr5l32prwqdyq4aguxn. The according query.proto file in the bank subdirectory contains the Request and the Response for this request. The details for the response are defined inQueryAllBalancesResponse. It contains the balances and pagination attribute which can be accessed as shown in the example below.importgrpc# using grpcioimportcosmospy_protobuf.cosmos.bank.v1beta1.query_pb2_grpcasquery_pb2_grpc# for gprcio#import cosmospy_protobuf.cosmos.bank.v1beta1.query_grpc as query_grpc # for gprclibimportcosmospy_protobuf.cosmos.bank.v1beta1.query_pb2asquery_pb2host="osmosis.strange.love"port="9090"c=grpc.insecure_channel(f'{host}:{port}')stub=query_pb2_grpc.QueryStub(c)r=stub.AllBalances(query_pb2.QueryAllBalancesRequest(address="osmo15hzhcvgs2ljfng6unghvr5l32prwqdyq4aguxn"))print(r.balances)Build yourselfThere are two scripts helping you to fork this repository to work with any cosmos based coin.Addititional Requirements:grpcio-toolsgrpclibGitPythonprotoletariatSteps:Create a config inconfigsand take a existing one as exampleRun theaggregate.pyfile with your filename without.json(Examplepython aggregate.py cosmos)Run thecompile.pyto compile all your files to protobufBuild your package. You're done!Protobuf compilationThe files are compiled using thegrpc_tools.protoccommand from thegrpcio-toolslibrary.
To compile a .proto file manually use following command:python -m grpc_tools.protoc -I <absolute path to project root> --python_out=. --grpc_python_out=. --grpclib_python_out=. <absolute path to .proto file>After compiling all the files with protoc you need to fix the imports by usingprotoletariatNote:The --grpc_python_out=. and --grpclib_python_out=. is only needed when compiling a query.proto file as these define the actual grpc queryTo compile the whole project it is favorable to match all proto files by using*.protoinstead of each individual file. You can also match the whole folders to compile multiple folders at the same time. Not that the folders might contain sub-folders.Other Cosmos based coinsCurrently following coins are maintained by me:Cosmos (this branch)Evmos (branch:chain/evmos, package name:evmos-protobuf)Osmosis (branch:chain/osmosis, package name:osmosis-protobuf)Stargaze (branch:chain/stargaze, package name:stargaze-protobuf)Maintained by external contributors:Sentinel (branch:chain/sentinel, package name:sentinel-protobuf)
Package: cosmos-python
# CosMoS’ Python Library
###This library is still in beta, just like [cosmos-cms.com](https://cosmos-cms.com).Using this library it’s extremely easy to fetch and decrypt your content fromCosMoS, The Universal CMS.For detailed documentation, please go to: [cosmos-cms.com/docs](https://cosmos-cms.com/docs)## Instalation
CosMoS’ Python SDK can be installed within seconds using pip.` pip installcosmos-python`## Setup
This is where we’ll show how to setup CosMoS for Python.## Usage
Here is where we’ll tell you how to fetch data from our api.