Saravanan666/pypi-org huggingface dataset:
Package: environment-variables
Environment variablesEnum style access to environment variables with type annotations~ Av vars och env efter förmåga,
åt vars och env efter behov ~The package is hosted atPyPIDocumentationThe documentation can be found onReadTheDocsRequirementsThis package supports Python 3.7 or laterInstallationInstall usingpip:$pipinstallenvironment-variablesUsageDefine your environment variables as class attributes with type annotation:fromenvironment_variablesimportenvironment_variables@environment_variablesclassEnvironment:MY_VARIABLE:strMY_INTEGER:int=10MY_FEATURE_FLAG:bool=FalseWhen accessing a class attribute, the class will automatically check
the system for a environment variable of the same name and return
its value cast to the annotated type. If it is not defined, the default
value will be used instead.It is also possible to annotate a class attribute with any class
using thevariablesfunction:fromenvironment_variablesimportenvironment_variables,variable@environment_variablesclassEnvironment:MY_VARIABLE:CustomClass=variable(CustomClass,default='some default value',default_factory=custom_class_factory,args=(1,2,3,),kwargs={'more_custom':True},)The problem this is trying to solveWhen configuring a python program with environment variables, one would
typically access them in a fashion similar to this:importosmy_value=os.getenv('MY_VALUE',default=123)This leaves a lot of strings lying around in the code, and it gets hard
to keep track on which values are being used and what variables are needed
to be set when. A better approach would be to collect everything in a
config file:importosclassMyConfig:@classmethoddefget_my_value(cls,default):returnos.getenv('MY_VALUE',default=default)This makes it slightly easier to keep track of, but we are still using
strings that we have to keep track of. An even better approach would
be to use Enums:importosimportenumclassMyVariables(enum.Enum):MY_VALUE='MY_VALUE'classMyConfig:@classmethoddefget_my_value(cls,default):returnos.getenv(MyVariables.MY_VALUE.value,default=default)Much better, now we can just look at the enum to see what variables we have,
but there is a lot of boilerplate code. For instance, do we really have to
write out 'MY_VALUE' twice in the enum definition? It would be much more
convenient to have the 'MyVaribles' class understand that the attribute name
should be the environment variable to look for, instead of having to specify
the string name of the variable again.On top of that,os.getenvalways returns strings, so we would have to
take care of the type casting ourselves if we want to have server ports
as integers or feature flags as booleans.
Package: environ-secretmanager
environ_secretmanagerTheenviron_secretmanagermodule is designed to be used to download Google Cloud Secrets Manager secrets and set them
as environment variables. This is useful for using secrets in various environments, and works especially well with App
Engine and Cloud Functions where the correct environment variables can be created in an env file during CI/CD and used
in the final build files for production.Usagefromenviron_secretmanager.env_secretsimportEnvironSecretManagersecrets=EnvironSecretManager(GOOGLE_CLOUD_PROJECT_ID="my-project-id")# To create a .env file with the secretssecrets.create_dot_env_file()# To use the secrets in the current environmentMY_SECRET=secrets.get_env_secret("MY_SECRET",1)Build For Local DistributionBuild the files then extract the setup.py file from the tarball and run it to install the package locally.poetrybuild--formatsdist
tar-xvfdist/*-`poetryversion-s`.tar.gz-O'*/setup.py'>setup.pyThen on the machine you want to install the package on, runpipinstall-e.DevelopmentThis project usesPoetryin development to create a virtual environment and manage
dependencies.
To install poetry, runcurl-sSLhttps://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py|python-Then, from the same directory aspyproject.toml, runpoetryinstallRunpoetrycommands from this same directory to manage your development environment and/or setup the virtual environment created in the last step in your IDE.SeePoetry Docsfor more info.
Package: environs-serviceurl
environs-serviceurl is a Python library that extends theenvironslibrary with support for
turning service urls likepostgres://user:pass@host:port/databaseinto
Python dictionaries.Install$ pip install environs-serviceurlUsage# export DATABASE_URL=postgres://me:sekrit@postgres.example.com:5432/catpics# export REDIS_URL=redis://redis.example.com?dbid=3fromenvironsimportEnvfromenvirons_serviceurlimportservice_urlenv=Env()env.add_parser('service_url',service_url)# Parse a service url.postgres_config=env.service_url('DATABASE_URL')# {'host': 'postgres.example.com',#  'port': 5432,#  'user': 'me',#  'password': 'sekrit',#  'extras': 'catpics'}# Give the extras a specific namepostgres_config=env.service_url('DATABASE_URL',extras_name='database')# {'host': 'postgres.example.com',#  'port': 5432,#  'user': 'me',#  'password': 'sekrit',#  'database': 'catpics'}# Parse a service url with defaults, using query params for extra values.redis_config=env.service_url('REDIS_URL','redis://localhost/',defaults={'host':'service.example.com','port':6379,'dbid':0})# {'host': 'redis.example.com',#  'port': 6379,#  'user': None,#  'password': None,#  'extras': None,#  'dbid': '3'}LimitationsThere’s currently no way to do casting on any extras or query string paramaters.
They will always be returned as string types.LicenseMIT.  See theLICENSEfile for details.
Package: envirophat
https://shop.pimoroni.com/products/enviro-phatThe Pimoroni Enviro pHAT boast a plethora of sensors and connectivity
for measuring your environment.Enviro pHAT includes:An LSM303D accelerometer/magnetometer for detecting orientation,
motion and headingA BMP280 temperature/pressure sensorA TCS3472 colour sensor, for detecting the amount and colour of lightAn ADS1015 analog sensor with four 3.3v tolerant channels for your
external sensorsA 5v power supply pin for powering your sensors, which you can
regulate or divide to 3v if neededTwo LEDs connected to GPIO #4 for illuminating objects over the
colour sensorInstallingFull install (recommended):We’ve created an easy installation script that will install all
pre-requisites and get your Enviro pHAT up and running with minimal
efforts. To run it, fire up Terminal which you’ll find in Menu ->
Accessories -> Terminal on your Raspberry Pi desktop, as illustrated
below:Finding the terminalIn the new terminal window type the command exactly as it appears below
(check for typos) and follow the on-screen instructions:curlhttps://get.pimoroni.com/envirophat|bashAlternatively, on Raspbian, you can download thepimoroni-dashboardand install your product by browsing to the relevant entry:sudoapt-getinstallpimoroni(you will find the Dashboard under ‘Accessories’ too, in the Pi menu -
or just runpimoroni-dashboardat the command line)If you choose to download examples you’ll find them in/home/pi/Pimoroni/envirophat/.Manual install:Library install for Python 3:on Raspbian:sudoapt-getinstallpython3-envirophatother environments:sudopip3installenvirophatLibrary install for Python 2:on Raspbian:sudoapt-getinstallpython-envirophatother environments:sudopip2installenvirophatDevelopment:If you want to contribute, or like living on the edge of your seat by
having the latest code, you should clone this repository,cdto the
library directory, and run:sudopython3setup.pyinstall(orsudo python setup.py installwhichever your primary Python
environment may be)In all cases you will have to enable the i2c bus.Documentation & SupportGuides and tutorials -https://learn.pimoroni.com/enviro-phatFunction reference -http://docs.pimoroni.com/envirophat/GPIO Pinout -https://pinout.xyz/pinout/enviro_phatGet help -http://forums.pimoroni.com/c/support1.0.1Fix: Corrected upper bounds check for tilt_heading1.0.0Fix: Defer setup to avoid import side-effectsFix: QNH changed to ISA standardTweak: New Enviro pHAT I2C addr now defaultAdded: unit argument to pressure to choose Pa or hPa0.0.6Added __version__ to moduleAdded DocStrings0.0.5Bug fix to lsm303d raw_heading0.0.4Tidy up of read functions in bmp280Fixed incorrect call to pressure method0.0.3Python3 fix0.0.2Bug fixes0.0.1Initial release
Package: envirophat-mqtt
Envirophat MQTTPoll a Pimoroni envirophat and publish to MQTTInstallpip install envirophat_mqttpython3 ./setup.py sdist installConfigureusage: envirophat_mqtt [-h] [--mqtt_host MQTT_HOST] [--mqtt_topic MQTT_TOPIC]
                   [--mqtt_clientid MQTT_CLIENTID] [--mqtt_port MQTT_PORT]
                   [--poll_time POLL_TIME] [--overscan OVERSCAN]

optional arguments:
  -h, --help            show this help message and exit
  --mqtt_host MQTT_HOST
                        MQTT host
  --mqtt_topic MQTT_TOPIC
                        MQTT topic
  --mqtt_clientid MQTT_CLIENTID
                        MQTT client ID
  --mqtt_port MQTT_PORT
                        MQTT port
  --poll_time POLL_TIME
                        How often in seconds to poll (60)
  --overscan OVERSCAN   How many readings to average together during the
                        polltimeA systemd unit file is provided for use.  You may want to edit the settings
in the ExecStart line of this file before installing.  Copy to /etc/systemd/system/ and then run systemctl daemon-reload.Use with homeassistantThis is my setup, in my sensors.yaml file:# garage envirophat
- platform: mqtt
  name: garage_temperature
  state_topic: merope/envirophat/temperature
  unit_of_measurement: '°C'
- platform: mqtt
  name: garage_pressure
  state_topic: merope/envirophat/pressure
  unit_of_measurement: 'hPa'
- platform: mqtt
  name: garage_lux
  state_topic: merope/envirophat/lux
  unix_of_measurement: 'lux'I run envirophat_mqtt with the following ExecStart:ExecStart=/usr/local/bin/envirophat_mqtt --mqtt_host elgafar.garbled.net --mqtt_topic merope/envirophat --mqtt_clientid meropeMaking sure it worksRun the following command:mosquitto_sub -v -t "#" -h <your MQTT server>Watch for messages from the envirophat.
Package: enviroplus
Enviro+Designed for environmental monitoring, Enviro+ lets you measure air quality (pollutant gases and particulates), temperature, pressure, humidity, light, and noise level. Learn more -https://shop.pimoroni.com/products/enviro-plusInstallingYou're best using the "One-line" install method if you want all of the UART serial configuration for the PMS5003 particulate matter sensor to run automatically.NoteThe code in this repository supports both the Enviro+ and Enviro Mini boards.The Enviro Mini board does not have the Gas sensor or the breakout for the PM sensor.:warning: This library now supports Python 3 only, Python 2 is EOL -https://www.python.org/doc/sunset-python-2/One-line (Installs from GitHub)curl -sSL https://get.pimoroni.com/enviroplus | bashNotereport issues with one-line installer here:https://github.com/pimoroni/getOr... Install and configure dependencies from GitHub:git clone https://github.com/pimoroni/enviroplus-pythoncd enviroplus-pythonsudo ./install.shNoteRaspbian Lite users may first need to install git:sudo apt install gitOr... Install from PyPi and configure manually:Runsudo python3 -m pip install enviroplusNotethis wont perform any of the required configuration changes on your Pi, you may additionally need to:Enable i2c:raspi-config nonint do_i2c 0Enable SPI:raspi-config nonint do_spi 0And if you're using a PMS5003 sensor you will need to:Enable serial:raspi-config nonint set_config_var enable_uart 1 /boot/config.txtDisable serial terminal:sudo raspi-config nonint do_serial 1Adddtoverlay=pi3-miniuart-btto your/boot/config.txtAnd install additional dependencies:sudo apt install python3-numpy python3-smbus python3-pil python3-setuptoolsAlternate Software & User Projectsenviro monitor -https://github.com/roscoe81/enviro-monitormqtt-all -https://github.com/robmarkcole/rpi-enviro-mqtt- now upstream:see examples/mqtt-all.pyadafruit_io.py -https://github.com/dedSyn4ps3/enviroplus-python/blob/master/examples/adafruit_io.py- uses Adafruit Blinka and BME280 libraries to publish to Adafruit IOenviroplus_exporter -https://github.com/tijmenvandenbrink/enviroplus_exporter- Prometheus exporter (with added support for Luftdaten and InfluxDB Cloud)homekit-enviroplus -https://github.com/sighmon/homekit-enviroplus- An Apple HomeKit accessory for the Pimoroni Enviro+go-enviroplus -https://github.com/rubiojr/go-enviroplus- Go modules to read Enviro+ sensorsHelp & SupportGPIO Pinout -https://pinout.xyz/pinout/enviro_plusSupport forums -http://forums.pimoroni.com/c/supportDiscord -https://discord.gg/hr93ByCChangelog0.0.6Fix noise by specifying adau7002 device0.0.5Drop Python 2.x supportAdd "available()" method for gas sensor0.0.4Add support for ads1015 >= v0.0.7 (ADS1115 ADCs)Packaging tweaks0.0.3Fix "self.noise_floor" bug in get_noise_profile0.0.2Add support for extra ADC channel in GasHandle breaking change in new ltr559 libraryAdd Noise functionality0.0.1Initial Release
Package: envirun
envirunLoadenvironmentfrom file andrunany program with this loaded environment.This is useful if you want to easily run program with different environment, or troubleshoot systemd services which reads environment from /etc/default/ files.Installationpip3installenvirunExample Usage/tmp/x.sh:#!/bin/shechoX:$Xecho$*/tmp/x1.env:X=1/tmp/x2.env:X=2$envirun.py/tmp/x1.env/tmp/x.shsomeargs
X:1someargs

$envirun.py/tmp/x2.env/tmp/x.shsomeotherargs--foo--bar
X:2someotherargs--foo--barSource codeSee environ.py, it'sverysimple. Main code is just three lines:load_dotenv(dotenv_path=sys.argv[1],override=True)rc=subprocess.run(sys.argv[2:])sys.exit(rc.returncode)More detailsEnvironment files are loaded usingdotenvload_dotenv(), overriding existing env variables. Environment lines may start withexport. Seedotenvdocumentation if you want more details.See also similar project:envrunHow to achieve same result without envirun in bash (with few more commands):$set-a
$./tmp/x1.env# Load environment from /tmp/x1.env file$set+a
$/tmp/x.shsomeargs
X:1someargs
Package: envisage
Documentation:https://docs.enthought.com/envisageEnvisage is a Python-based framework for building extensible applications,
that is, applications whose functionality can be extended by adding “plug-ins”.
Envisage provides a standard mechanism for features to be added to an
application, whether by the original developer or by someone else. In fact,
when you build an application using Envisage, the entire application consists
primarily of plug-ins. In this respect, it is similar to the Eclipse and
Netbeans frameworks for Java applications.Each plug-in is able to:Advertise where and how it can be extended (its “extension points”).Contribute extensions to the extension points offered by other plug-ins or
its own.Create and share the objects that perform the real work of the application
(“services”).The Envisage project provides the basic machinery of the Envisage
framework. You are free to use:the envisageCorePluginavailable through theenvisage.apimoduleplug-ins from the envisagepluginsmoduleplug-ins from other ETS projects that expose their functionality as plug-insplug-ins that you create yourselfPrerequisitesThe supported versions of Python are Python >= 3.7.  Envisage requires:apptoolstraitsEnvisage has the following optional dependencies:PyfaceTraitsUITo build the full documentation one needs:Sphinxversion 2.1 or later.TheEnthought Sphinx Theme.
Package: enviscerate
ENViscerateOne line access to environment variables, handling typecasts automatically. Simply declare a variable with the same name, assigning it to the output of the functionenv(default_value)wheredefault_valueis of the type you want the env variable casted as. It is easier to say with an examplefromenviscerateimportenvHOME=env('/this/dir')Will set the value of HOME with the following precedenceenv var$HOME.env file supplied valuevalue'/this/dir'you supplied to env() function abovefeaturesif type is dict, it will be parsed as JSLOB using jsonofabitch module(if available). parsed as JSON using builtin json.loads() otherwiseif bool it will be set toTrueifstr(val).lower() in ["t", "true", "1", "yes", "y"]forenv(val)andFalseotherwiseIfNone, the case ofenv(), you will getNoneif the variable is not declared and a string otherwiseotherwise it will be casted as whatever you supply. presumably anintfloatorstrbut with no presumptions or restrictions thereofIt will use dotenv if available but does not require it, but will spit warnings to avoid frustrating mysterious why-are-my-settings-not-registering hickups
Package: envitro
A module for reading values from OS environment variables.Compared to using os.getenv(), this module provides convenience functions,
for parsing basic datatypes. It also allows specifying optional default values if
the environment variable does not exist. Basic environment variable parsing and
sanitizing is also performed.Usageimportosimportenvitro# fails when environment variables are missingbool_required=envitro.bool("BOOL_ENV")int_required=envitro.int("INTEGER_ENV")float_required=envitro.float("FLOAT_ENV")str_required=envitro.str("STRING_ENV")# basic sanitizingos.environ["STR_ENV"]="  var with spaces  "envitro.str("STR_ENV")# returns "var with spaces"# falls back to defaultsbool_default=envitro.bool("BOOL_NOT_FOUND",default=False)int_default=envitro.int("INTEGER_NOT_FOUND",default=42)float_default=envitro.float("FLOAT_NOT_FOUND",default=42.44)str_default=envitro.str("STRING_NOT_FOUND",default="my_default")# try multiple fallback ENV variablesos.environ["FALLBACK_ENV"]="fallback_val"single_fallback=envitro.str("MISSING",fallback="FALLBACK_ENV")multiple_fallback=envitro.str("MISSING",fallback=["FALL_MISSING_1","FALL_MISSING_2","FALLBACK_ENV"])# get and set raw environment variablesenvitro.write("EXISTING_VAR",None)# clear the environment variableenvitro.write("RAW_STRING"," raw_string ")envitro.read("RAW_STRING")# returns " raw_string "envitro.read("MISSING_RAW_STRING",default=" defaultval ")# returns " defaultval "# lists/tuplesos.environ["LIST_ENV"]="item1,item2,item3"list_required=envitro.list("LIST_ENV")# returns ["item1", "item2", "item3"]tuple_required=envitro.tuple("LIST_ENV")# returns ("item1", "item2", "item3")os.environ["LIST_ENV2"]="item1;item2;item3"list_required2=envitro.list("LIST_ENV2",separator=";")# returns ["item1", "item2", "item3"]tuple_required2=envitro.tuple("LIST_ENV2",separator=";")# returns ("item1", "item2", "item3")# utility functionsenvitro.isset("MAYBE_SET_VARIABLE")# return True/FalseDecoratorsThere are also decorators available to selectively enable or disable functions based on environment
variables.importenvitro@envitro.decorators.isset('ALLOW_FOO')deffoo():return"Hello World"envitro.write('ALLOW_FOO','1')foo()# allowedenvitro.write('ALLOW_FOO',None)foo()# return "None" and is not executed@envitro.decorators.bool('ALLOW_REMOTE')defget_remote(arg1,arg2):returncall_remote_service(arg1,arg2)envitro.write('ALLOW_REMOTE','True')get_remote('hello','world')# calls remote serviceenvitro.write('ALLOW_REMOTE','False')get_remote('hello','world')# returns "None" and is not executed
Package: enviz
AboutEnviz is a python module that allows you to write and read environment variables from a file.InstallationpipinstallenvizUsagefromenvizimportEnv# Read environment variables from a fileenv=Env(path='.env.example',autowrite=True)# We can update the environment variables with a dictionaryenv.update({'TEST1':'1','TEST2':'2'})# We can also update the environment variables by setting them manuallyenv['TEST3']='3'# env.exampleTEST1="1"TEST2="2"TEST3="3"Enviz will automatically write the environment variables to the file if theautowriteparameter is set toTrue. If you want to write the environment variables manually, you can use thewrite()method.
Package: envkeeper
EnvKeeperLikelocalStorage, but forpython!Simple Python library for managing and storing variables as JSON-encoded dictionaries in environment variables. It provides a dictionary-like interface for storing and retrieving data in environment variables, and allows for global access once stored.InstallationInstall EnvKeeper via pip:pipinstallenvkeeperUsageSee theMakefilefor a list of examples and available commands.Here's a basic example of using BlobStorage:fromenvkeeperimportStorageContainer# Create an instance with an environment variable key# Be sure to replace `'MY_VAR'` with the actual name of the environment variable you want to use.store=StorageContainer('MY_VAR')# Set itemsstore['foo']='bar'store['baz']=42# Get itemsprint(store['foo'])# Outputs: 'bar'print(store['baz'])# Outputs: 42# Delete itemsdelstore['foo']# Check if a key existsprint('baz'instore)# Outputs: TrueContributingContributions are welcome! Please feel free to submit a pull request.LicenseThis project is licensed under the terms of the MIT license.
Package: envlight
EnvlightA toolkit to load*.hdrenvironment light map and sample lighting under the split-sum approximation.This is basically a wrapped version oflight.pyfrom nvdiffrec.InstallAssumetorchandnvdiffrastalready installed.pipinstallenvlight# from githubpipinstallgit+https://github.com/ashawkey/envlight# or locallygitclonehttps://github.com/ashawkey/envlightcdenvlight
pipinstall.Usageimportenvlightnormal# [..., 3], assume normalized, in [-1, 1]reflective# [..., 3], assume normalized, in [-1, 1]roughness# [..., 1], in [0, 1]light=envlight.EnvLight('assets/aerodynamics_workshop_2k.hdr',device='cuda')diffuse=light(normal)# [..., 3]specular=light(reflective,roughness)# [..., 3]# to load another hdr filelight.load('assets/mud_road_puresky_1k.hdr')light.build_mips()An example renderer:# requries extra dependencies: pip install trimesh dearpyguipythonrenderer.pyhttps://github.com/ashawkey/envlight/assets/25863658/505d57e6-6e8a-4492-ae02-586e28e038adAcknowledgementCredits to Nvidia'snvdiffrec.
Package: env-logger
Env LoggerA replacement for the standard librarylogging.basicConfig, with some extra bells and whistles.Value propositionNice defaultsIt uses subjectively nicer defaults e.g. by using a handler that colors the output.Multiple configuration sourcesIt allows users to override the configuration environment variables e.g. likeLOG_LEVEL=DEBUG\LOG_FORMAT='%(levelname)8s %(message)s'\env_loggerdemoIn general, the name of the environment variable follows the name of the basicConfig parameter and takes the same values.EcosystemThe package is designed to be compatible withriche.g. likeimportloggingimportenv_loggerimportrich.loggingenv_logger.configure(handlers=[rich.logging.RichHandler()])logging.getLogger(__name__).info("Hello!")ContributeFor Linux like environments the ambition is that setting up a development environment should be as easy assource./init_env.sh
makeinstall_deps_pyImportant workflows are documented in theMakefileand can be listed withmake help.PrerequisitesPython e.g. byinstalling pyenv following theseinstructions, andinstalling the targeted python version(s) likepyenv install
Package: env-minion
PurposeThe tool aims to help developers synchronize their environmental variable keys. This is achieved by
comparing each local.env{specificity extension (e.g. .docker)}file with the corresponding.env{specificity extension}.examplefile
and ensure all keys are matched. Therefore when pushed to remote and pulled by other developers, they can update their env variables
according to the updated .example templates.UseTo work theminions, your root directory must be a git repo.
Run the commandgruin terminal and they shall add the necessary git hooks to .git/hooks.Successfully made hook file an executable
Hook file '/path-to-your-directory/.git/hooks/pre-push' successfully populated.You are good to go!
Package: envmodules
This is a tiny importable Python wrapper for theEnvironment Modulessystem - themodule loadcommand often used in the shell on HPC systems.Installation:pip install envmodulesUsage:import envmodules
envmodules.load('gcc/6.1.1')Loading modules like this mostly affects external programs which you
run in subprocesses.
Most modules won’t have much effect on Python code in the same process.