Saravanan666/pypi-org huggingface dataset:
Package: envtoml
envTOMLis an answer to a fairly simple problem: including values from
environment variables in TOML configuration files. In this way, it is very
similar to bothenvyamlandvaryamlwhich provide very
similar functionality for YAML and which greatly inspired this small
package.ExampleSuppose we have the following configuration saved inconfig.toml[db]host="$DB_HOST"port="$DB_PORT"username="$DB_USERNAME"password="$DB_PASSWORD"name="my_database"with the environment variables being set to the followingDB_HOST=some-host.tld
DB_PORT=3306
DB_USERNAME=user01
DB_PASSWORD=veryToughPas$w0rdthis config can then be parsed withenvTOMLin the following way:importenvtomlcfg=envtoml.load(open('./config.toml'))print(cfg)# {'db': {'host': 'some-host.tld',#   'port': 3306,#   'username': 'user01',#   'password': 'veryToughPas$w0rd',#   'name': 'my_database'}}TestsAs this project makes use ofPoetry, after
installing it the tests can be ran by executing the following from the
project’s root directory:poetryrunnoseteststestsThey can also be ran withcoverage:poetryrunnosetests--with-coveragetestsLicenseLicensed under the MIT license (seeLICENSEfile for more
details).
Package: env-tools
A simple module for loading and applying .env files.Works in Python 2 and Python 3.Running tests$py.testOr, withtox(test with multiple Python versions):$toxExample.envVARIABLE_A=123VARIABLE_B="testing, testing"example.pyimportosfromenv_toolsimportapply_env# loads '.env' by default, to load another file use# apply_env(load_env('filename'))apply_env()assertos.environ['VARIABLE_A']=='123'assertos.environ['VARIABLE_B']=='testing, testing'
Package: envtpl
envtplRender jinja2 templates on the command line with shell environment variablesInstallationpip install envtplHow-toSay you have a configuration file called whatever.conf that looks like thisfoo = 123
bar = "abc"You can use envtpl to setfooandbarfrom the command line by creating a file called whatever.conf.tplfoo = {{ FOO }}
bar = "{{ BAR }}"If you runFOO=123 BAR=abc envtpl < whatever.conf.tpl > whatever.confyou'll get back the original whatever.conf.You can also specify default valuesfoo = {{ FOO | default(123) }}
bar = "{{ BAR | default("abc") }}"RunningFOO=456 envtpl < whatever.conf.tpl > whatever.confwill generatefoo = 456
bar = "abc"This is all standardJinja2 syntax, so you can do things like{% if BAZ is defined %}
foo = 123
{% else %}
foo = 456
{% endif %}
bar = "abc"If an environment variable is missing, envtpl will throw an error$ echo '{{ FOO }} {{ BAR }}' | FOO=123 envtpl
Error: 'BAR' is undefinedYou can change this behaviour to insert empty strings instead by passing the--allow-missingflag.Instead of reading from stdin and writing to stdout, you can pass the input filename as an optional positional argument,
and set the output filename with the--output-file(-o) argument.envtpl -o whatever.conf  whatever.conf.tplAs a convenience, if you don't specify an output filename and the input filename ends with.tpl, the output filename will be the input filename without the.tplextension, i.e.envtpl whatever.conf.tpl
# is equivalent to
envtpl -o whatever.conf whatever.conf.tplBy default, envtpl willdeletethe input template file. You can keep it by passing the--keep-templateflag.There's a specialenvironment(prefix='')function that you can use as a kind of wildcard variable. If you havehello.tplhello = {{ FOO }}
{% for key, value in environment('MY_') %}{{ key }} = {{ value }}
{% endfor %}and compile it usingFOO=world MY_baz=qux MY_foo=bar envtpl hello.tplYou end up withhello = world
baz = qux
foo = barWhat's the point?I use this script quite a lot in Docker images. Usually I'll have the CMD execute some file, like /bin/start_container, that sets up the runtime configuration for the container by inserting environment variables into config files before starting the main process. A redis example could look like this#!/bin/bash
# start_container

envtpl /etc/redis.conf.tpl

redis-serverThis is the use case I've optimised for, so that's why envtpl by default will delete the original template file.
Package: envuitest
Salesforce Web DriverWeb Auto Test Framework with Selenium For Salesforce Lightning AppFunction APIS:login: login Salesforce's Scratch Orgopen_url: open target urlclick_element: click element by visibility textset_value: set value to element by it's label or visibility textcheck_table_value: check table data by record data and row_indexExample:fromseleniumimportwebdriverchrome_options=webdriver.ChromeOptions()prefs={"profile.default_content_setting_values.notifications":2}chrome_options.add_experimental_option("prefs",prefs)driver=webdriver.Chrome('/your path/chrome_driver/chromedriver',chrome_options=chrome_options)login(driver,'test@example.com','password')open_url(driver,'https://builder-playground-4380-dev-ed.lightning.force.com/lightning/n/PC_DivisionTab')record={'体系编号':'DIV007'}check_table_value(driver,record,False)click_element(driver,'新建体系','')check_table_value(driver,record,True)
Package: envutil
Python Environment Variable HelperThis Python package provides an easy way to interact with environment variables in your Python applications. It is designed to simplify the process of loading and parsing various data types from environment variables.FeaturesAuto load environment variables from .env files based on application environment (devortest).Provide easy-to-use functions to access environment variables with type hinting.Support different data types including strings, lists, dictionaries, integers and booleans.Allow defaults for environment variables.Provide decorator@depends_on_envfor user-defined functions to ensure environment variables are loaded.InstallationInstall the package from PyPi using pip:pipinstallenvutilUsageImport the package in your Python code as follows:fromenvutilimportenv_str,env_csv,env_int,env_bool,env_list,env_dictAccess your environment variables:# Access string variablemy_var=env_str('MY_VAR',default='default-value')# Access comma separated value as a listmy_csv=env_csv('MY_CSV',default=[])# Access integer variablemy_int=env_int('MY_INT',default=0)# Access boolean variablemy_bool=env_bool('MY_BOOL',default=False)# Access list variablemy_list=env_list('MY_LIST',default=[])# Access dictionary variablemy_dict=env_dict('MY_DICT',default={})Environment ConfigurationBy default, this package loads.envfile. If theAPP_ENVis set totest, it will load.env.testfile. You can also specify a custom environment file by setting theAPP_ENV_FILEenvironment variable.ContributingYour contributions are always welcome! Please have a look at thecontribution guidelinesfirst. 🎉LicenseThis package is released under theMIT License.
Package: envutils
envutilsThis python library contains some utils functions to read and parse environment variables.It can be installed with:pip3installenvutilsUsage examples:# Set some example values for demonstration purposes>>>importos>>>os.environ['MY_ENV']='my_value'>>>os.environ['MY_INT_ENV']='42'>>>os.environ['MY_BOOL_ENV']='True'>>>fromenvutilsimportenvutils# Read env variable as string>>>envutils.get_from_environment('MY_ENV','my_default_value')'my_value'# Read env variable as int>>>envutils.get_int_from_environment('MY_INT_ENV',666)42# Read env variable as boolean>>>envutils.get_bool_from_environment('MY_BOOL_ENV',False)True# Read a non-existing env variable>>>envutils.get_from_environment('UNSET_ENV','my_default_value')'my_default_value'
Package: env_utils
env utilsThis library extends the standard library’sgetenvfunction, allowing
you to coerce the return value into a type.And that’s it.It’s been released as a library because every project we have includes the
same requirements - read in environment variables, coerce them into the
correct type.The problem is that environment variables are always stored as strings, but
Python will evaluate any string (even “”) as True if cast to a boolean. This
is almost never the desired behaviour. If you set an environment variable to
“”, “0” or “False”, you want it to be False.>>>os.environ['foo']="0">>>val=os.getenv('foo')>>>val"0">>>bool(val)Trueenv_utils.get_envwill coerce the value into the type you require. The package contains basic helper functions that coerce booleans, integers, decimals, floats, dates, lists and dictionaries.# FOO=0>>>env_utils.get_env('FOO')"0">>>env_utils.get_bool('FOO')False>>>env_utils.get_int('FOO')0# FOO=foo,bar>>>env_utils.get_list('FOO',separator=',')['foo','bar']# FOO='{"foo": true}'>>>env_utils.get_dict('FOO'){'foo':True}# FOO=2016-11-23>>>env_utils.get_date('FOO')datetime.date(2016,11,23)You can supply any function you like to coerce the value, e.g.:>>>importos>>>os.getenv('FOO_NAME')'bob'>>>classFoo(object):...def__init__(self,name):...self.name=name>>>coerce=lambdax:Foo(x)>>>importenv_utils>>>foo=env_utils.get_env('FOO_NAME',coerce=coerce)>>>foo.name>>>'bob'InstallationThe library is available at pypi as ‘env_utils’, and can installed using pip:$ pip install env_utilsTestsThe tests can be run usingtox:$tox
Package: env-validate
.env ValidatorValidate your .env file locally and within a pipelineCheck you're not missing items from your .env file or os environmentExit immediately if required settings are missingThis script will tell you if you're missing items from your env file, and crucially, what they are.TipUse this package in combination withpython-dotenvin your
project.RunIf you have an.env.examplepresent in the root of your repo,
then this will be taken as the list of required environment vars.Optionally, create a file namedrequired_envs.Validate env within your app start upfrom env_validate import validate_env
# (Optional) use python-dotenv to load your settings
from dotenv import load_dotenv


load_dotenv(verbose=True) # optional
validate_env() # will exit if any missing envs, priting missing valuesValidate your env locallyIn a new shell:source .env
export $(grep ^[a-zA-Z] .env | cut -d= -f1)
python
from env_validate import validate_env
validate_env()Validate env inside a pipelineIn your pipeline:from env_validate import validate_env
validate_env()
Package: env-var
env_varA simple utility for working with environment variables. The main goal was to provide proper type check.Installationpipinstallenv-varUsagefromenv_varimportenvminio_port=env('MINIO_PORT').as_port_number().default(9000).required()# port type hint is `int`minio_host=env('MINIO_HOST').as_hostname().optional()# minio_host type hint is `str | None`minio_secure=env('MINIO_SECURE').as_bool().required()# minio_host type hint is `bool`Settingdefaultwill result in always returning a value, so it makes little sense to use it withoptional.It might be useful to gather all environment variables that are used in an application to a separate file.fromenumimportEnumfromenv_varimportenvclassSomeImportantOption(Enum):option_a="a"option_b="b"option_c="c"PG_HOST=env('PG_HOST').as_hostname().required()PG_PORT=env('PG_PORT').as_port_number().default(5432).required()PG_DB=env('PG_DB').as_string().required()PG_USER=env('PG_USER').as_string().required()PG_PASSWORD=env('PG_PASSWORD').as_string().required()IMPORTANT_OPTION=env('IMPORTANT_OPTION').as_enum(SomeImportantOption).required()Sometimes it might happen that some variables will be required only in specific circumstances, in such cases callingrequiredcan be postponed until the variable is actually needed.UPDATE_URL=env('UPDATE_URL').as_url()"""required only when some condition is met"""# elsewhere in the codedefsend_update(status:str):url=UPDATE_URL.required()requests.post(url,dict(status=status))It's also possible to pass custom transformers/validators.@dataclassclassMyOwnClass:initial:strinitial_class=env("INITIAL").custom_transformer(MyOwnClass).required()# intial_class is of type MyOwnClass
Package: env-var-config
This project allows you to describe the configuration of your application as atyping.NamedTuple, like so:importtypingclassMyAppConfig(typing.NamedTuple):some_string:strsome_int:intsome_float:floatsome_bool:bool=TrueThen, gather the configuration from the environment variables:importenv_var_configconfig=env_var_config.gather_config_for_class(MyAppConfig)The code will look for variables that are called like the fields of the tuple, but uppercase.As you might have noticed, you can set default values on the fields.
If the fields with defaults are not found in the environment, they’re set to their default value
(which is quite unsurprising).
If a value without a default is missing, though, an error will be raised.
That is, unless you setallow_emptyoption toTruein the call togather_config_for_class.
Then all missing values will be initialized with the default value for their type,
such as an empty string forstr, 0 forint, etc.Installationpipinstallenv_var_config
Package: envx
envx介绍环境信息管理模块，适用于跨设备区分环境类型的情况安装教程pip安装pip3installenvxpip安装（使用淘宝镜像加速）pip3installenvx-ihttps://mirrors.aliyun.com/pypi/simple使用说明环境文件目录（如果没有对应目录，请创建对应的目录）Windows 系统使用目录：C:\env\macOS 系统使用目录：/Users/env/Linux 系统使用目录：/env/环境文件案例文件名：local.any.env文件内容：HOST=192.168.0.1
PORT=6379读取结果：{"HOST":"192.168.0.1","PORT":"6379"}项目中使用代码importenvxlocal_any_env=envx.read('local.any.env')建议使用环境类型标记文件：DEFAULT_ENV.env一般用来描述当前的环境信息，可以用来标记当前的环境类型，
然后后续使用时先去读当前默认的环境类型，再根据设定选取不同的环境文件，
即，会先从当前环境中读取DEFAULT_ENV.env中设定的环境类型，再读取settings.ini的具体设定，
然后根据当前环境类型取对应的环境文件；
注意：settings.ini文件必须和使用此代码的文件在同一目录，若为其他目录，需修改文件路径settings.ini[DEFAULT]
env=DEV
msg=在这里的env中设置将要使用哪个具体的环境

[DEV]
env_name=DEV-开发
env_file_name_mysql=dev.mysql.env
env_file_name_mongo=dev.mongo.env
silence_mysql=False

[TEST]
env_name=TEST-测试
env_file_name_mysql=test.mysql.env
env_file_name_mongo=test.mongo.env
silence_mysql=False

[PROD]
env_name=PROD-生产
env_file_name_mysql=prod.mysql.env
env_file_name_mongo=prod.mongo.env
silence_mysql=False项目代码# ----------------- 读取配置信息 -----------------importconfigparserimportplatformimportosifplatform.system()=='Windows':path_separator='\\'else:path_separator='/'config_dir=(os.path.dirname(os.path.realpath(__file__)))+path_separator+'settings.ini'config=configparser.ConfigParser()# 类实例化config.read(config_dir,encoding='utf-8')default_config=config['DEFAULT']default_env=default_config['env']config_config=config[default_env]# 从这里开始写需要读取为内容env_file_name_mysql=config_config['env_file_name_mysql']env_file_name_mongo=config_config['env_file_name_mongo']silence_mysql=eval(config_config['silence_mysql'])# ----------------- 读取配置信息 -----------------
Package: env-yaml
evn-yamlThis is similar to what is done in Quarkus:https://quarkus.io/guides/config-reference#property-expressionsAllows for substitution of environment variables when loading a yaml file, while providing defaults, for e.g.:database:mongodb:connection_string:${MONGODB_CONNECTION_STRING:localhost:27017}database:${MONGODB_DATABASE_NAME:test}UsageCreateconfig.yaml:a:b:${ENV_B:default_used_b}c:${ENV_C:default_used_c}d:${ENV_D}Read file and useEnvLoader:importosfromenv_yamlimportEnvLoaderimportyamlos.environ['ENV_B']='default_not_used_b'withopen('config.yaml','r')asf:file_contents=f.read()result=yaml.load(file_contents,EnvLoader)print(result)Results in:{'a':{'b':'default_not_used_b','c':'default_used_c','d':None}}
Package: envyconfig
envyconfigEnvyconfig is a python package for reading YAML config files with pointers to external keys.  It reads the specified YAML file, fetches data from the configured sources, and returns the corresponding dict structure.The primary purpose is to allow keys to secret configuration items to be stored in the YAML file, for ease of use during program loading.Builds on the PyYAML package, with the following additions:Environment variables can be specified as config values.GCP Secrets can be specified as config values.Nested YAML structures can be flattened to get a simple key / value dict.Default values can be specified, for instance from the command line.Requires Python 3.8 or higher.Basic Usage>>>importenvyconfig>>>config=envyconfig.load(config_file='my_config.yaml')>>>print(config){'foo':{'bar':'baz'}}Sample config file.foo:# Google Cloud Secret Manager: Loads "bar" from secret "bar" in the "my-project"#  GCP project.bar:${gs:/my-project/my-secret}# Environment variables: Loads "baz" from the environment variable "BAZ".# If this variable is not set, it defaults to "something_else".baz:${env:BAZ:something_else}# HashiCorp Vault: Loads "bam" from the secret "bam" mounted Vault mount# "/path/to/secrets/mount/my-secrets/".bam:${vault:/path/to/secrets/mount/my-secrets/bam}Usage DetailsInterpolation keys.You indicate the values you want interpolated by one of the configured engines through a wrapper${<method>:<key>:<default>}, such as${env:MY_VAR:my_default}.  The currently supported engines areenvironment (os.environ) variables (key:env), andGoogle Secret Manager (key:gs).HashiCorp VaultFormat strings for run-time interpolation.
The engines are lazy-loaded, so unless you request interpolation by one of them, the configuration is not loaded.
This is useful for advanced engines (presentlygs), that rely on external libraries and configuration.As the method, key and default values are separated by a:, this character is not allowed in the method or
key names.  It is allowed in default values, though.  So$(env:REDIRECT_PAGE:https://localhost/}is legal syntax.Environment variablesEnvironment variables behave like you expect them to.Google Secret ManagerThis engine requires the optional dependency (or separate installation of)google-cloud-secret-manager(i.e.pip install envyconfig[google-cloud-secret-manager]), and a pointer to your GCP key
(GOOGLE_APPLICATION_CREDENTIALS), as described onAuthenticating as a service account)Credits and further documentationGCP Python Secret ManagerPython Environment VariablesHashiCorp VaultPyYAMLEnvyConfig
Package: envzigzag
Install:pip install envzigzagUsage:# Snapshot one state
envzig

# Change things, or switch to a different terminal, then compare:
envzagWhen you run the second command, it shows what has changed. It might look
something like this:Removed [in zig, not zag]:
  CONDA_DEFAULT_ENV=envzig-test

Added   [in zag, not zig]:
  OLDPWD=/home/me/Code

Changed:
  PWD=
  ├zig: /home/takluyver/Code/flit
  └zag: /home/takluyver/Code/envzigzag
Package: envzy
A library that explores dependencies from a given namespace in a local Python environment, then classifies these dependencies.The library was isolated from theLZY project's codebase to ensure reusability and reduce the difficulty of dependency management.If you are interested in using our library, please contact us via Github Issues.Brief exampleIn[1]:fromenvzyimportAutoExplorerIn[2]:explorer=AutoExplorer(pypi_index_url='https://pypi.org/simple',additional_pypi_packages={},target_python=(3,9))In[3]:namespace={'foo':AutoExplorer}In[4]:explorer.get_local_module_paths(namespace)Out[4]:['/home/lipkin/repos/envzy/envzy']In[5]:explorer.get_pypi_packages(namespace)Out[5]:{'mailbits':'0.2.1','urllib3':'2.0.7','charset-normalizer':'3.3.1','certifi':'2023.7.22','pydantic_core':'2.10.1','packaging':'23.2','soupsieve':'2.5','importlib-metadata':'6.8.0','pypi-simple':'1.2.0','annotated-types':'0.6.0','idna':'3.4','zipp':'3.17.0','attrs':'23.1.0','beautifulsoup4':'4.12.2','pydantic':'2.4.2','typing_extensions':'4.8.0','requests':'2.31.0'}Developmentpoetry installfor installing project in dev-mode with all of it dependencies.poetry publish --buildfor publishing package to PyPI.toxfor run tests.
Package: enwheel
# enwheelStarting with a file describing a set up git-hosted Python packages, generatewheels and a PEP 503-compatible package repository.The list of source packages looks like this, and is always called 'repos.ini':This is a single-entry repos.ini that downloads all Django releases after 1.10.0:```[Django]repo: https://github.com/django/django.gitignore-before: 1.10.0```## DependenciesThis has not yet been tested with Python 3. Python dependencies are listed insetup.py## Installation`pip install enwheel`## Usage```Usage:enwheel build  (build all software listed in repos.ini)enwheel build <name> (build just one package, by name in repos.ini)enwheel generate  (refresh the Python repository at /simple/)enwheel serve [--port=8000] (start a toy web server hosting the contents of /simple/)```## Known issues- We presume that the setup.py version will always reflect the git tag. For examplebuilding Django at tag 1.10.2 will produce a Django wheel with version 1.10.2- Capitalization in repos.ini matters, names must match the 'name' in setup.py- We only process tags with valid, 3-part semantic versions, and no other text.1.10.2 is valid, v.1.10.2 isn't.## Getting involvedSee [CONTRIBUTING](CONTRIBUTING.md).----## Open source licensing info1. [TERMS](TERMS.md)2. [LICENSE](LICENSE)3. [CFPB Source Code Policy](https://github.com/cfpb/source-code-policy/)
Package: en-ww2spacy
This is a spaCy pipeline for processing primary and secondary sources pertaining to World War 2Feature | Description |— | — |Name|en_ww2spacy|Version|0.0.9|spaCy|>=3.4.4,<3.5.0|Default Pipeline|sentencizer,span_ruler,military_personnel,find_ghetto,clean_spans,clean_tank,clean_ships|Components|sentencizer,span_ruler,military_personnel,find_ghetto,clean_spans,clean_tank,clean_ships|Vectors| 0 keys, 0 unique vectors (0 dimensions) |Sources| n/a |License| n/a |Author| [W.J.B. Mattingly](https://github.com/wjbmattingly/ww2-spacy) |### Label Scheme<details><summary>View label scheme (34 labels for 1 components)</summary>Component | Labels |— | — |`span_ruler`|AIRBORN_DIVISION,AMPHIBIOUS_VESSEL,ANTI_TANK,ARMORED_DIVISION,ARMY_GROUP,BATTALION,BATTLE,BATTLESHIP,BLADE,CAMP,CARRIER,CARRIER_ESCORT,CAVALRY,CORPS,CRUISER,DESTROYER,FIELD_ARMY,FLAMETHROWER,FRIGATE_DESTROYER_ESCORT,GRENADE,GUNBOAT,INFANTRY_DIVISION,MACHINE_GUN,MINE_VESSEL,MORTAR,MOUNTAIN_DIVISION,OPERATION,PISTOL,PLANE,RIFLE,SHOTGUN,SUBMACHINE_GUN,SUBMARINE,TANK|</details>
Package: enyo
AboutEnyois a lightweight multistage partition-based encryption algorithm. Enyo cipher demonstrates good resistance to a brute-force attack. It is well suited for small-scale applications where the computational power is a bottleneck.Combines the performance of primitive ciphers with enhanced securityCustom encoding ensures URL safe encryptionTransposition stage for additional securityModulesenyoencryption- Enyo Encryption moduleenyodecryption- Enyo Decryption moduleInstallationPython3 is required.Openterminaland execute:pipinstallenyoDevelopment InstallationOpenterminaland execute:gitclonehttps://github.com/apratimshukla6/enyo.gitcdenyo
pipinstall--editable.Example UsageEncryptionfromenyo.enyoencryptionimportEnyoEncryption# Third parameter is an optional integer for partition (by default 2), the fourth parameter is optional Boolean for transposition (default False)test=EnyoEncryption("test","secretkey",partition=2,transposition=True)# To print the encrypted textprint(test.encrypted)OutputSaSQpNDecryptionfromenyo.enyodecryptionimportEnyoDecryption# Third parameter is an optional integer for partition (by default 2), the fourth parameter is optional Boolean for transposition (default False)test=EnyoDecryption("SaSQpN","secretkey",partition=2,transposition=True)# To print the decrypted textprint(test.decrypted)OutputtestLinksResearch PaperDemoContributingBefore creating an issue, please ensure that it hasn't already been reported/suggested.The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in theDiscord serverinstead of opening an issue â€“ you will get redirected there anyway.If you wish to contribute to the Enyo codebase or documentation, feel free to fork the repository and submit a pull request.HelpIf you don't understand something in the documentation, you are experiencing problems, or you just need a gentle
nudge in the right direction, please don't hesitate to join ourDiscord Server.Change log[0.1.1] - 2021-09-26Updated README[0.1.0] - 2020-10-24Updated READMENull Character in Decryption Fix[0.0.9] - 2020-10-01Updated READMEReverted Fix[0.0.8] - 2020-10-01Updated READMEMinor Bug Fix[0.0.7] - 2020-10-01Updated READMETransposition stage made optional in Enyo[0.0.6] - 2020-10-01Updated READMEAdded Transposition stage in Enyo[0.0.1] - 2020-09-15Updated READMEAdded initial files for Enyo