semvec/pypi-packages huggingface dataset:
flexi-settings 1.0.1.dev270739073
Manages embedded variables and blending settings
License: MIT
Requires Python: >=3.7

Library for handling variable resolution in scalars found within strings and "tree"-like
data such as dict (internally), JSON/YAML content.

.. note::

    This is a Python 3 only library. There is no support for Python 2.x.

Overview
========

This is to support YAML settings files that may have embedded variable references in
scalar values that reference keys found within the same, or other content.

.. code-block:: python

    ROOT_DIR: "/var/log/my_project"

    LOG_FILENAME: "!ROOT_DIR!/my_log_file.log"

The use-cases for this include:

* Reducing redundancy in YAML data
* Support for "local overrides" to replace some data at run-time
* Support for tests where the content is changed (overloaded) for unit tests

Features
========

This library provides a number of features including:

* A ``TreeData`` class for easily loading files from JSON/YAML or from native ``dict`` objects
* Visitor base classes for inspecting/manipulating the tree data
* Support for specifying primary content, overload content, and variable content
* Both variable resolution at load time and dynamically at run-time
* A set of standard "resolvers"

Resolvers
---------

The library includes a set of standard resolvers. New resolvers can be defined
easily by extending the `Resolver` base class.

* `TreeDataResolver` - Resolution from a `TreeData` (dict) object/YAML files
* `DockerSwarmResolver` - Resolution from Docker swarm configs/secrets
* `EnvVarResolver` - Resolve from environment variables

Visitors
--------

The library includes a set of visitors for inspecting and updating `TreeData` objects.

Library Usage
=============

A service (both standard "system-d" and container services) may use this to handle settings.

Overview
--------

The settings are accessed via the `ServiceSettings` (or custom, extended class) Singleton. The
specifics of what actors are involved in providing the settings are specified within a
`SettingsContext` instance. These include the location of the primary settings file (generally
a YAML file), the location of an optional override settings file, and the inclusion of
resolvers for environment variables, Docker swarm secrets/configs, and any other optional
resolvers (such as pulling settings from a database).

Startup Sequence
~~~~~~~~~~~~~~~~

One of the first steps that a service should perform is creating an instance of the `SettingsContext`
object. This instance is passed into the ServiceSettings and provides contextual details
for loading the settings and resolving variables.
valve-range-query-3 2.0.3
Python library for Query of Valve Servers over a range of IPs
License: MIT
Keywords: valve query servers counter strike csgo team fortress tf2 left for dead l4d2

Python library for Query of Valve Servers over a range of IPs
=============================================================

This is a Python 3 port of https://github.com/anshulshah96/valve-range-query. It should support all Valve Source Dedicated Servers (CS:GO, TF2, L4D2).

To install the library run

::

	pip3 install valve-range-query-3


To scan servers in range " <base_ipaddr> . <axlimits> . <aylimits> "

For example scan '172'.'25'.'0-34'.'0.254'

::
	
	from valverangequery import *
	axlimits = [0,35]
	aylimits = [0,255]
	base_ipaddr = "172.25"
	scanner = SourceScanner(timeout = 20.0, axlimits = axlimits, aylimits = aylimits, base_ipaddr="172.25")
	server_list = scanner.scan_servers()


To obtain player info from server having IP <ip>

::
	
	from valverangequery import *
	ip = "172.25.12.121"
	player_query = PlayerQuery(ip)
	player_list= player_query.player()


----

The respose of **SourceScanner** is a dictionary of list of servers

Each list entry "server_obj" will have following key-value pairs:
	
::

	for server_obj in server_list:
		sample_new_dictionary = {
				'map_name' : server_obj['map'],
				'host' : server_obj['host_ip'],				'num_players' : server_obj['numplayers'],
				'max_players' : server_obj['maxplayers'], 	'server_name' : server_obj['name'],
				'game_name' : server_obj['game'],			'folder' : server_obj['folder'],
				'protocol' : server_obj['protocol'],		'num_bots' : server_obj['bots'],
				'num_humans' : server_obj['numplayers'] - server_obj['bots']
		}

----

The respose of **PlayerQuery** is a dictionary of list of players

Each list entry "player_obj" will have following key-value pairs:
	
::
	
	for player_obj in player_list:
		sample_new_dictionary = {
				'score' : player_obj['score'], 'duration' : int(player_obj['duration'])	, 
				'name'	: player_obj['name']
		}