Saravanan666/pypi-org huggingface dataset:
Package: cave-utils
Cave Utilities for the Cave AppBasic utilities for the MIT Cave App. This package is intended to be used by the Cave App and the Cave API.SetupMake sure you have Python 3.9.x (or higher) installed on your system. You can download ithere.Installationpip install cave_utilsRunning Validator TestsExample:In your cave_app, update the following file:cave_api/tests/test_init.pyfrom cave_api import execute_command
from cave_utils.socket import Socket
from cave_utils.validator import Validator


init_session_data = execute_command(session_data={}, socket=Socket(), command="init")

x = Validator(init_session_data)

x.log.print_logs()
# x.log.print_logs(level="error")
# x.log.print_logs(level="warning")
# x.log.print_logs(max_count=10)Run the following command:cave test test_init.pycave_utils developmentUsing Live ValidationIn your cave_app, update the following file:utils/run_server.sh#!/bin/bash

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
APP_DIR=$(dirname "$SCRIPT_DIR")

pip install -e /cave_utils

source ./utils/helpers/shell_functions.sh
source ./utils/helpers/ensure_postgres_running.sh
source ./utils/helpers/ensure_db_setup.sh

python "$APP_DIR/manage.py" runserver 0.0.0.0:8000 2>&1 | pipe_log "INFO"Removecave_utilsfrom the rootrequirements.txtfileIn your cave_app, setLIVE_API_VALIDATION_PRINT=Truein the.envfileThis will validate your data every time an API command is called for each sessionUse the following command to run your cave_app:cave run --docker-args "--volume {local_path_to_cave_utils}/cave_utils:/cave_utils"As you edit cave_utils, the logs will be updated liveUsing interactive mode and running testsRun cave_app in interactive mode mounting cave_utils as a volume:cave run --docker-args "--volume {local_path_to_cave_utils}/cave_utils:/cave_utils" -itThen install cave utils in the docker container:pip install -e /cave_utilsThen run some tests (egvalidate_all_examples.py):python cave_api/tests/validate_all_examples.pyGenerate DocumentationSet up your virtual environmentpython3 -m virtualenv venvsource venv/bin/activatepip install -r requirements.txtUpdate the docssource venv/bin/activate./update_documentation.shGenerate a New ReleaseSet up your virtual environmentpython3 -m virtualenv venvsource venv/bin/activatepip install -r requirements.txtUpdate the version number in:setup.cfgpyproject.tomlUpdate the releasesource venv/bin/activate./update_version.sh
Package: cavity-py
All rights reserved.Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.Description: # cavity_pyPlatform: UNKNOWN
Package: caw
PythonChRISClientA PythonChRISclient library.Installationpipinstall-UcawExamplefrompathlibimportPathfromchris.clientimportChrisClientclient=ChrisClient.from_login(address="https://cube.chrisproject.org/api/v1/",username="chris",password="chris1234")client.upload(Path("example.txt"),"my_examples")dircopy=client.get_plugin_by_name("pl-dircopy")plinst=dircopy.create_instance({"dir":"chris/uploads/my_examples/example.txt"})AsyncLooking for anasyncChRISclient? Let us know!
We have one implementedhere,
though it's not published to PyPI.Command-Line Clientchrsis the next-generationChRIScommand-line client, please check it out.cawpreviously included a command-line client forChRIS, however
since v0.7.0 it was deprecated and removed.To use thecawcommand:pipinstallcaw==0.6.1Usage:https://github.com/FNNDSC/caw/blob/d5b05b28af312b97ac80bd96376d70626db737a5/README.md
Package: cawdrey
Several useful custom dictionaries for Python 📖 🐍DocsTestsPyPIAnacondaActivityQAOtherContentsfrozendict: An immutable dictionary that cannot be changed after creation.FrozenOrderedDict: An immutableOrderedDictwhere the order of keys is preserved, but that cannot be changed after creation.AlphaDict: AFrozenOrderedDictwhere the keys are stored in alphabetical order.bdict: A dictionary wherekey, valuepairs are stored both ways round.This package also provides two base classes for creating your own custom dictionaries:FrozenBase: An Abstract Base Class for Frozen dictionaries.MutableBase: An Abstract Base Class for mutable dictionaries.Other Dictionary PackagesIf you’re looking to unflatten a dictionary, such as to go from this:{"foo.bar":"val"}to this:{"foo":{"bar":"val"}}check outunflatten,flatteryormorphto accomplish that.indexedprovides an OrderedDict where the values can be accessed by their index as well as by their keys.There’s alsopython-benedict, which provides a custom dictionary withkeylist/keypathsupport,I/Oshortcuts (Base64,CSV,JSON,TOML,XML,YAML,pickle,query-string) and manyutilities.InstallationCawdreycan be installed from PyPI or Anaconda.To install withpip:$python-mpipinstallcawdreyTo install withconda:First add the required channels$condaconfig--addchannelshttps://conda.anaconda.org/conda-forge$condaconfig--addchannelshttps://conda.anaconda.org/domdfcodingThen install$condainstallcawdreyAnd Finally:Why “Cawdrey”?
Package: caws
cawsconfigure AWS responsibly using profile names and environment vars.rather than changing your AWS SDK credentials withaws configure, AWS suggestssetting the ENV var AWS_DEFAULT_PROFILE to a [profile] in your ~/.aws/credentials.when set, this ENV var will over-ride the profile set withaws configure.caws will write to an rc file setting AWS_DEFAULT_PROFILE to the given profile name.if you do not have the rc file caws will create it for you.you'll need to add. .cawsrcto your RC file (using bash: .bashrc or .bash_profile)add new profiles using$ aws configure --profile newnameone benefit of using AWS_DEFAULT_PROFILE method instead ofaws configureis theability to add which AWS profile you're currently using to your command prompt.dependenciespython3aws cliusagechange AWS_DEFAULT_PROFILE to profilename$ caws profilenamechange AWS_DEFAULT_PROFILE to profilename and also update ~/.aws/credentials and ~/.aws/config$ caws profilename --withcredsshow help and exit$ caws -hexample bash usagebecause python cannot source files on the parent process, caws has the unfortunate inability to update the ENV var it is updating.therefore, a thin bash helper function can be used to run caws in the background:kaws(){eval"caws$1> /dev/null".~/.cawsrc}example PS1 with colored path parts!functioncolor_path(){ROYGBIV=('\e[31m''\e[38;5;208m''\e[93m''\e[92m''\e[36m''\e[94m''\e[95m''\e[97m''\e[93m''\e[38;5;208m''\e[91m''\e[95m''\e[96m''\e[34m''\e[92m')explode_path=$(pwd)exploded=$(echo$explode_path|tr"/""\n")final=""sep="/"x=0forpartin$explodeddofinal+="${ROYGBIV[$x]}$sep$part\e[0m"x=$(expr$x+1)doneprintf$final}parse_git_branch(){localb=$(gitsymbolic-refHEAD2>/dev/null)if["${b#refs/heads/}"!=""]thenprintf" \e[38;5;208m(${b#refs/heads/})\e[0m"fi}PS1='\[\033[45m\]\u\[\033[0;96m\] aws:\[\033[92m\]$AWS_DEFAULT_PROFILE`parse_git_branch` \[\033[37m\]- `color_path`\[\033[37m\]\n$ \[\033[0m\]'
Package: cawspr
cawsprCase And Word Separation Preserving Replace (CAWSPR)What does this do?This script is as simple as it is stupid: You give it a list of words to
replace (e.g.hello world) and a list of words to replace them with (e.g.goodbye world) and it will perform this replacement for various compositions
of these words that are common e.g. in programming:separated by spaces:hello world→goodbye worldlowercase and separated by underscores (snake_case):hello_world→goodbye_worlduppercase and separated by underscores (SCREAMING_SNAKE_CASE):HELLO_WORLD→GOODBYE_WORLDlowercase and separated by hyphens (kebab-case):hello-world→goodbye-worldseparated only by capitalizing the first letter of each word (CamelCase):HelloWorld→GoodbyeWorldseparated only by capitalizing the first letter of each word except the first
(lowerCamelCase):helloWorld→goodbyeWorldThe text in which to make these replacements must be piped into the script's
standard input and it will output the resulting modified text to standard
output.That's it.Installationpip3installcawsprUsageReplacing all occurrences ofhello worldand its variants in a fileoriginal.txtwithgoodbye worldand writing the result toreplaced.txt:catoriginal.txt|cawspr'hello world''goodbye world'>replaced.txtAdvertisementWant to perform such replacements for both file contentsandfile paths in a
directory recursively? Considerfull-applywhich works great with
cawspr!Similar projects and other resourcesSoftwarerecs StackExchange
questionin which I
asked if anyone knows of an existing CLI tool that does this (perhaps more
will crop up in the future)The answers to [this StackOverflow question] are full of links to vim plugins
for the same purpose (but I wanted it as a CLI tool):abolish.vim(can do this and other
loosely related things)SmartCasekeepcase.vim
Package: caxes
Some new Python data structure,can be afforded as APIs for new ways of configuration,
and configuration sharing mechanism implementation.It’s a subproject of uLFS.uLFS means “Your Manageable, Automatable and Templated Reusable Linux From Scratch”,it’s a set of tools to build your own customed Linux distribution with
more managability than raw LFS(Linux From Scratch). Include source package
manager, file system backup and realtime mirror apps, and some assistant data
structure such as Tree writen in Python, etc…
Package: cay
#+author: conao3#+date: <2020-03-20 Fri>[[https://github.com/conao3/cay][https://raw.githubusercontent.com/conao3/files/master/blob/headers/png/cay.png]][[https://github.com/conao3/cay/blob/master/LICENSE][https://img.shields.io/github/license/conao3/cay.svg?style=flat-square]][[https://github.com/conao3/cay/releases][https://img.shields.io/github/tag/conao3/cay.svg?style=flat-square]][[https://github.com/conao3/cay/actions][https://img.shields.io/badge/patreon-become%20a%20patron-orange.svg?logo=patreon&style=flat-square]][[https://twitter.com/conao_3][https://img.shields.io/badge/twitter-@conao__3-blue.svg?logo=twitter&style=flat-square]][[https://conao3-support.slack.com/join/shared_invite/enQtNjUzMDMxODcyMjE1LWUwMjhiNTU3Yjk3ODIwNzAxMTgwOTkxNmJiN2M4OTZkMWY0NjI4ZTg4MTVlNzcwNDY2ZjVjYmRiZmJjZDU4MDE][https://img.shields.io/badge/chat-on_slack-blue.svg?logo=slack&style=flat-square]]* Table of Contents- [[#description][Description]]- [[#install][Install]]- [[#usage][Usage]]- [[#information][Information]]- [[#community][Community]]- [[#contribution][Contribution]]- [[#license][License]]- [[#author][Author]]* DescriptionSimple calculator inplemented in Python.* Install* Usage* Information** CommunityAll feedback and suggestions are welcome!You can use github issues, but you can also use [[https://conao3-support.slack.com/join/shared_invite/enQtNjUzMDMxODcyMjE1LWUwMjhiNTU3Yjk3ODIwNzAxMTgwOTkxNmJiN2M4OTZkMWY0NjI4ZTg4MTVlNzcwNDY2ZjVjYmRiZmJjZDU4MDE][Slack]]if you want a more casual conversation.** ContributionWe welcome PR!** License#+begin_exampleMIT LicenseCopyright (c) Naoya Yamashita - https://conao3.comhttps://github.com/conao3/cay/blob/master/LICENSE#+end_example** Author- Naoya Yamashita ([[https://github.com/conao3][conao3]])
Package: cayenne
cayenne : Python package for stochastic simulationsIntroductioncayenneis a Python package for stochastic simulations. It offers a simple API to define models, perform stochastic simulations with them and visualize the results in a convenient manner.Currently under active development in thedevelopbranch.InstallInstall withpip:$pipinstallcayenneDocumentationGeneral:https://cayenne.readthedocs.io.Benchmark repository, comparingcayennewith other stochastic simulation packages:https://github.com/Heuro-labs/cayenne-benchmarksUsageA short summary follows, but a more detailed tutorial can be foundhere. You can define a model as a Python string (or a text file, seedocs). The format of this string is loosely based on the excellentantimonylibrary, which is used behind the scenes bycayenne.fromcayenne.simulationimportSimulationmodel_str="""const compartment comp1;comp1 = 1.0; # volume of compartmentr1: A => B; k1;r2: B => C; k2;k1 = 0.11;k2 = 0.1;chem_flag = false;A = 100;B = 0;C = 0;"""sim=Simulation.load_model(model_str,"ModelString")# Run the simulationsim.simulate(max_t=40,max_iter=1000,n_rep=10)sim.plot()Change simulation algorithmYou can change the algorithm used to perform the simulation by changing thealgorithmparameter (one of"direct","tau_leaping"or"tau_adaptive")sim.simulate(max_t=150,max_iter=1000,n_rep=10,algorithm="tau_leaping")Ourbenchmarksare summarizedbelow, and showdirectto be a good starting point.tau_leapingoffers greater speed but needs specification and tuning of thetauhyperparameter. Thetau_adaptiveis less accurate and a work in progress.Run simulations in parallelYou can run the simulations on multiple cores by specifying then_procsparametersim.simulate(max_t=150,max_iter=1000,n_rep=10,n_procs=4)Accessing simulation resultsYou can access all the results or the results for a specific list of species# Get all the resultsresults=sim.results# Get results only for one or more speciesresults.get_species(["A","C"])You can also access the final states of all the simulation runs by# Get results at the simulation endpointsfinal_times,final_states=results.finalAdditionally, you can access the state a particular time point of interest $t$.cayennewill interpolate the value from nearby time points to give an accurate estimate.# Get results at timepoint "t"t=10.0states=results.get_state(t)# returns a list of numpy arraysBenchmarksdirecttau_leapingtau_adaptivecayenne:heavy_check_mark: Most accurate yet:heavy_check_mark: Very fast but may need manual tuningLess accurate than GillespieSSA's versionTellurium:exclamation: Inaccurate for 2nd orderN/AN/AGillespieSSAVery slow:exclamation: Inaccurate for initial zero counts:exclamation: Inaccurate for initial zero countsBioSimulator.jl:exclamation: Inaccurate interpolation:exclamation: Inaccurate for initial zero counts:exclamation: Inaccurate for initial zero countsLicenseCopyright (c) 2018-2020, Dileep Kishore, Srikiran Chandrasekaran. Released under: Apache Software License 2.0CreditsCythonantimonypytestCookiecutteraudreyr/cookiecutter-pypackageblackLogo made withlogomakr
Package: cayenneLPP
A Python module for the Cayenne Low Power Packet formatIt aims to facilate the conversion of values typically read from sensors
to a sequence of bits (the payload) that can be send over a network
using the Cayenne Low Power Packet format. This format is particularly
suited for LPWAN networks such as LoRaWAN.The payload can then be send for instance to an application of The
Things Network, a LoRaWAN-based community network, which will then
forward the data to a Cayenne application thanks to its Cayenne
integration.The module consists of constants defining the different sensors and
their size and one class CayenneLPP containing the methods to build a
payload.The constants have the format NAME_SENSOR = (LPP id, Data size) where
LPP id is the IPSO id - 3200 and Data size is the number of bytes that
must be used to encode the reading from the sensor.More info here:https://mydevices.com/cayenne/docs/lora/#lora-cayenne-low-power-payload-overviewCayenneLPP classThe class contains the methods to pack data from sensors in a Cayenne
LPP format. The payload structure for the Cayenne LPP format is data
frame of the form: [SENSOR_1, SENSOR_2, … SENSOR_N], where the
format for one sensor is defined by: [CHANNEL, SENSOR TYPE, DATA].The channel is an unique identifier for each sensor in the data frame.The type of sensors compatible with this class are: - digital
input/output; - analog input/output; - luminosity (or illuminance)
sensor; - presence sensor; - temperature sensor; - humidity sensor; -
accelerometer; - barometer; - gyrometer; - gps.An object of this class has 3 attributes: - payload: the data from one
or more senors formatted with the Cayenne LPP format; - size: the
maximum size of the payload (depends on the network on which the data
will be send to); - socket: a socket via which we can send the payload.The constructor will generate an object with an empty payload and with a
maximum size.It is possible to reset the payload with the ‘reset’ method and change
the maximum size with the ‘change_size’ method.The current payload and maximum size can be obtained with the methods
‘get_payload’ and ‘get_size’ methods.You can send the payload via the socket using the ‘send’ method. The
socket can be set using the ‘set_socket’ method.To add the data from a sensor, the methods ‘add_sensor_name’ are
provided.The documentation is provided in the directorydocof the GitHub
repository.Example# importing the module
import cayenneLPP

# create a LoRa socket
s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)
s.setsockopt(socket.SOL_LORA, socket.SO_DR, 0)
s.setblocking(True)

# creating Cayenne LPP packet
lpp = cayenneLPP.CayenneLPP(size = 100, sock = s)

# adding 2 digital outputs, the first one uses the default channel
lpp.add_digital_input(True)
lpp.add_digital_input(False, channel = 112)

# sending the packet via the socket
lpp.send()Scripts to test the module with a LoPy (https://www.pycom.io/) and The
Things Network is provided in thetest_lopydirectory. Note that you
need to update the values ofapp_euiandapp_keywith the
correct credentials.
Package: cayenne-mqtt
The Cayenne MQTT Python Library provides functions to easily connect to theCayenne IoT project builder. With it you can send data to and receive data from Cayenne.RequirementsPython 2.7.9+ or 3.4+.This library.Eclipse Paho MQTT Python client library. This is installed as part of the Cayenne library installation.Getting StartedInstallationThis library can be installed using pip:pip install cayenne-mqttIt can also be installed from the repository:git clone https://github.com/myDevicesIoT/Cayenne-MQTT-Python
cd Cayenne-MQTT-Python
python setup.py installCayenne SetupCreate your Cayenne account athttps://mydevices.com.Add a new device using the Bring Your Own Thing API selection.ExamplesSimple examples are available in the repository here:https://github.com/myDevicesIoT/Cayenne-MQTT-Python/tree/master/examples.Below is an example of a simple client that publishes some sample data and receives data from Cayenne in a message callback. The Cayenne authentication variables must be modified with the authentication info you received when adding a new device in Cayenne:import cayenne.client
import time

# Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
MQTT_USERNAME  = "MQTT_USERNAME"
MQTT_PASSWORD  = "MQTT_PASSWORD"
MQTT_CLIENT_ID = "MQTT_CLIENT_ID"

# The callback for when a message is received from Cayenne.
def on_message(message):
  print("message received: " + str(message))
  # If there is an error processing the message return an error string, otherwise return nothing.

client = cayenne.client.CayenneMQTTClient()
client.on_message = on_message
client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID)
# For a secure connection use port 8883 when calling client.begin:
# client.begin(MQTT_USERNAME, MQTT_PASSWORD, MQTT_CLIENT_ID, port=8883)

i=0
timestamp = 0

while True:
  client.loop()

  if (time.time() > timestamp + 10):
    client.celsiusWrite(1, i)
    client.luxWrite(2, i*10)
    client.hectoPascalWrite(3, i+800)
    timestamp = time.time()
    i = i+1DocumentationFor more detailed info about the Cayenne client API you can usepydoc.pydoc cayenne.clientAdditional Cayenne MQTT LibrariesAdditional libraries are available for connecting to Cayenne with other languages. These can be found athttps://github.com/myDevicesIoT.
Package: cazart
cazartFlask + schema = cazart!cazartis a small helper for writing schematized JSON endpoints with Flask. It rollsschemainto Flask'sroutedecorator, allowing
for one-shot route and schema specification.Installationcazartrequires Python 3.6 or newer.pip3installcazartUsageTo usecazart, just swap yourFlaskinstance out for aCazartone:fromcazartimportCazartapp=Cazart(__name__)You can access all of Flask's baseline functionality (including non-validated routes)
viaapp.flask.Then, useapp.routeto specify a combination route and schema:fromcazartimportCazartfromschemaimportSchema,Orapp=Cazart(__name__)@app.route("/cazart",schema=Schema({"name":Or("alice","bob","mary")}))defcazart(res):print(f"my verified payload is{res}!")return("ok",200)See theexamplesfor full usage examples, including custom error handling
and dispatching to different schemas on a route based on HTTP method.
Package: cazipcode
Welcome to cazipcode DocumentationPowerful Canada zipcode search engine. Powerful geo lat lng search, fuzzy province, city name search out of the box. And powerful search API with high performance sorting.Quick LinksGitHub HomepageOnline DocumentationPyPI downloadInstallIssue submit and feature requestAPI reference and source codeFeatures200,000 + postal code covers most of the place.Rich information of postalcode is available:{"postalcode":"K1G 0A1","province":"ON","city":"Ottawa","area_name":"Ottawa","area_code":613,"latitude":45.417874,"longitude":-75.648284,"population":33994,"dwellings":14817,"elevation":56,"timezone":5,"day_light_savings":1}Human friendly APIfromcazipcodeimportfields,SearchEnginewithSearchEngine()assearch:# built-in geo searchresult=search.near(lat=45.477873,lng=-75.721100,radius=100)# by province, fuzzy name search.result=search.by_province("on")# by city, fuzzy name search.result=search.by_city("otawa")# easy to sort and limit result# Top 5 high population postal ocde in ONresult=search.by_province("on",sort_by=fields.province,ascending=False,returns=10)# by population dwellings timezoneresult=search.by_population(population_greater=10000)result=search.by_dwellings(dwellings_greater=10000)result=search.by_timezone(timezone_greater=5,timezone_less=8)# by 3-d space(lat_greater,lat_less,lng_greater,lng_less,elevation_greater,elevation_less,)=None,None,None,None,None,Noneresult=search.by_lat_lng_elevation(lat_greater,lat_less,lng_greater,lng_less,elevation_greater,elevation_less,)Powerful queryfromcazipcodeimportfields,SearchEngine# combination of any criterionsresult=search.find(lat=None,lng=None,radius=None,lat_greater=None,lat_less=None,lng_greater=None,lng_less=None,elevation_greater=None,elevation_less=None,prefix=None,substring=None,province=None,city=None,area_name=None,area_code=None,population_greater=None,population_less=None,dwellings_greater=None,dwellings_less=None,timezone=None,timezone_greater=None,timezone_less=None,day_light_savings=None,sort_by=None,ascending=True,returns=5,)Installcazipcodeis released on PyPI, so all you need is:$pipinstallcazipcodeTo upgrade to latest version:$pipinstall--upgradecazipcode