Saravanan666/pypi-org huggingface dataset:
Package: pyComtrade
DescriptionpyComtrade is a python module that provides you a transparent way for reading and writing (not implemented yet) oscillographic files stored in IEEE Comtrade format.Comtrade stands for COMmon format for Transient Data Exchange for power systems. It is a file format standardised by the IEEE that is used to store transient signals from Digital Fault Recorders, Oscillographs or Digital Protective Relays.pyComtrade was created and maintained by Miguel Moreto at Federal University of Santa Catarina - BrazilFeel free to use the module in your program. Don’t forget that pyComtrade is licensed under the GNU version 3 license. For more info about this read theCOPYING.txt.Release NotesVersion 0.3.0
- Added ASCII data file support.
- Source code refactored.
- Changed metadata handling from lists to dictionaries.
- Python 3 support.Many thanks to the contributors @ldemattos and @bluesdog164 who made most of the changes for this release.Version 0.2.0Implemented a method to read digital channels.Updated example.Added one more test data with digital channel data.Version 0.1.0Reads only analog channels.Reads only binary Comtrade files (1999 Standard).To DoReview the last version of Comtrade Standard C37.111-2013.Write Comtrade files.InstallPipRun pip install pyComtrade from the command line.From source (windows and linux)Extract the source .zip file.Run:python.exe setup.py installUsageSeeexample1.pyat the source file.Thanks for using pyComtrade module.
Package: pycomunefirenze
PyComuneFirenzeUtility di usointernoal Comune di Firenze per semplificare e aggregare ad uso comune diverse operazioni, come:loggingcreare e cancellare cartelle di lavoroinserire dati su databasemandare emailInstallazioneÃˆ altamente consigliato installare i proprio pacchetti/librerie tramite virtual environment:python -m venv *nome_del_virtual_environment*

cd *nome_del_virtual_environment*/Scripts/activate
	
pip install pycomunefirenzeBreve guida all'usoImportazione del modulofrom pycomunefirenze import cdfPer utilizzare le funzioni di logging integrate, inizializzare un loggergenerale, per esempio:import logging
logging.basicConfig(filename='file.log',
				    filemode='a',
				    level=logging.INFO,
                    format='%(asctime)s - CHANGEME - %(levelname)s - %(message)s'
                    )
logger = logging.getLogger(__name__)E poi utilizzare il metodologgingnormalmentelogging.info("log messages go here")Interrogazione di APIresponse_text = general_request('metodo', 'url', **kwargs)Per eventuali argomenti extra si riferimento alla documentazione direquests.Creazione directory di lavorowd = cdf.create_directory('directory_a')Cancellazione di directory di lavorocdf.delete_directory(wd)Inserimento di righe su dbcdf.insert_on_db(
    'user'
    'password'
    'example.intranet'
    '5432',
    'database',
    'table_name',
    {
	    'col1': 'data',
	    'col2': 42
	},
    truncate = False)Ãˆ possibile passare come parametrotruncateper far sÃ¬ che la tabella venga prima svuotata e poi popolata. Il default Ã¨False.Mandare emailcdf.send_email(
    'oggetto', 
    'mittente', 
    [
	    'destinatario1@example.org',
	    'destinatario2@example.org'
	],
	'testo della mail', 
	**kwargs
)Per eventuali argomenti extra comecc,bccetc..., si fa riferimento alla documentazione diRedMail.
Package: pyconcatsrt
PyConcatSRTConcatenate multiple SRT files into one, easily.Available commandsconcatsrt: cli PyConcatSRTconcatsrt_gui: gui PyConcatSRTInstall$pipinstallpyconcatsrtUsageconcatsrt[-h]-pPATH[-dDISCS][-lLOG][-oOUTPUT]PATH, path to file(s), or directory is required.
Package: pyconcordion2
pyconcordion2A python implementation of the Concordion Acceptance Testing framework.Installation$ pip install pyconcordion2UsageSimply extend your python test cases from ConcordionTestCasefrom pyconcordion2 import ConcordionTestCaseExecute as you would normal unittests.Key DifferencesThis is not a 100% port of the original Concordion framework. If you
found a differing behaviour please let me know.Differences:Not possible to link to test data via CSVExtensions are currently not supported.Development Setup$ git clone git@github.com:concordion/pyconcordion2.git
$ cd pyconcordion2
$ virtualenv env_concordion
$ source ./env_concordion/bin/activate
$ pip install -r requirements.txt
$ nosetests  # to run testsLicenseCopyright 2013 John JiangLicensed under the Apache License, Version 2.0 (the “License”); you may
not use this file except in compliance with the License. You may obtain
a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an “AS IS” BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.AttributionThanks to theConcordion teamfor making the original framework.Thanks to JC Plessis for makingpyconcordion python port
Package: pyConditions
Commenting sucks so let your code do it for you with preconditions that
actually do something.Examples:frompyconditions.preimport*@Between("b",1,10)defdivideAbyB(a,b)returna/b@NotNone("a")@Between("a","a","n")@NotNone("b")@Between("b","n","z")defconcat(a,b):returna+b@Custom("a",lambdax:x%2==0)@Custom("b",lambdax:notx%2==0)defevenOdd(a,b):returna*bThe documenting is there with the code it self, and if you violate the
preconditions then aPyConditionexception is thrown with a much nicer
error message than broken code.evenOdd(3,1)pyconditions.exceptions.PyCondition: 3 did not pass the custom condition for parameter 'a' in function evenOddHow about some postconditions?frompyconditions.postimport*@NotNone()deftest(a):returna@Custom(lambdaa:a%2==0)defeven(a):returnatest(None)pyconditions.exception.PyCondition: The return value for uber.awesome.project.test was NoneYou can also mix the two as well.frompyconditionsimportprefrompyconditionsimportpost@pre.Custom("a",lamdaa:a%2==0)@post.Custom(lambdaa:a%2==0)defsuperSafeEven(a):returnaWant some class invariant shenanigans?frompyconditions.invariantimportInvariant,FieldsNotNone@FieldsNotNone(["test"])classTest:def__init__(self):self.test=1defadd(self):returnself.test+1defset(self,v):self.test=vt=Test()printt.add()t.set(None)That last call toaddwill cause the invariant to fail and thus throw
the following:pyconditions.exceptions.PyCondition: Field "test" was None when it should not have been in invariant "notNone"Need a custom invariant?frompyconditions.invariantimportCustomInvariantdefinvariant(self):returnself.test==1@CustomInvariant("test",invariant)classTest(object):def__init__(self):self.test=1defmethod1(self):self.testThis is great but the conditions slow my code down a lot? No problem.frompyconditions.stageimportStagestage=Stage()stage.prod()Just set that somewhere in your code and you’ll be fine. There is still
some overhead, mainly there will be two function calls for each method,
the wrapper and the original function. But, for stacked Preconditions
and Invariants it will not execute into the other conditions and
invraiants whenprodis called. If you want to go back toDevthen
calldev().Have conditions you want added? Open a PR with code.Have an issue? Open a PR with fixed code.
Package: pyconductor
Python client for ConductorPython client for Conductor provides two sets of functions:Workflow management APIs (start, terminate, get workflow status etc.)Worker execution frameworkNOTE: This repository has been forked fromNetflix:conductor'sclient/pythonfolder. Apart from the results of renaming the module fromconductortopyconductor,
(as pip already contains aconductormodule), there are no code changes. This repository is mostly meant
to act as an easy way to install the python client forNetflix:conductor. There are also attempts made
to add documentation to the client overall. As far as possible, the library will be kept in sync with
the upstream branch.InstallpipinstallpyconductorUsing Workflow Management APIPython classWorkflowClientprovides client API calls to the conductor server to start manage the workflows.ExampleimportsysfrompyconductorimportconductorimportjsondefgetStatus(workflowId):workflowClient=conductor.WorkflowClient('http://localhost:8080/api')workflow_json=workflowClient.getWorkflow(workflowId)printjson.dumps(workflow_json,indent=True,separators=(',',': '))returnworkflow_jsonTask Worker ExecutionTask worker execution APIs facilitates execution of a task worker using python client.
The API provides necessary mechanism to poll for task work at regular interval and executing the python worker in a separate threads.ExampleThe following python script demonstrates workers for the kitchensink workflow.frompyconductor.ConductorWorkerimportConductorWorkerdefexecute(task):return{'status':'COMPLETED','output':{'mod':5,'taskToExecute':'task_1','oddEven':0},'logs':['one','two']}defexecute4(task):forkTasks=[{"name":"task_1","taskReferenceName":"task_1_1","type":"SIMPLE"},{"name":"sub_workflow_4","taskReferenceName":"wf_dyn","type":"SUB_WORKFLOW","subWorkflowParam":{"name":"sub_flow_1"}}];input={'task_1_1':{},'wf_dyn':{}}return{'status':'COMPLETED','output':{'mod':5,'taskToExecute':'task_1','oddEven':0,'dynamicTasks':forkTasks,'inputs':input}}defmain():print'Hello World'cc=ConductorWorker('http://localhost:8080/api',1,0.1)forxinrange(1,30):if(x==4):cc.start('task_{0}'.format(x),execute4,False)else:cc.start('task_{0}'.format(x),execute,False)cc.start('task_30',execute,True)if__name__=='__main__':main()
Package: pyconduit
pyconduitA simple workflow manager that executes pre-defined functions from user-defined workflow files. You ("developer") create the functions, and they ("users") will able to call the functions by typing its name and pass the required parameters.It can be used to provide a "custom code evaluation" / "safe eval" feature to your users in your app. So they will only able to access functions that you allow. Users can also reference to other steps, set variables, and use standard functions in their workflow files.pyconduit comes with Text, Math, Dictionary, List and Variable blocks like in Python's standard built-in functions. So you don't need to reinvent the wheel by writing these functions again.Itdoes notexecute multiple functions in the same time. It executes functionsstep by step(because that's a how "workflow" works), so next function will only executeafterprevious function has finished execution. Even if they are asynchronous / coroutines.FeaturesPrevent access to a block for specific user. For example, if you have a block that makes a HTTP request, you can add a label to it, and pyconduit will not allow your users to use the function if job doesn't have that label too.Add step limits, max usage limit for a block per workflow (it can be changed for a specific job too).If you installpydanticlibraryin your environment, pyconduit will use it automatically to enforce type hints / annotations in function parameters, so users won't able to send invalid type of values when parameter expects a specific type of value.UseContext Tagsin the workflows to access variables, get the return value of previous steps and read object values with dotted path. For example, users can type{: my_step_id :}in the workflow to get the return value ofmy_step_iddynamically.WarningAs pyconduit can be used as "isolated space", you should be careful about functions that you enabled to user. (for example, you shouldn't make a function that allows users to get a global value in the runtime from their input). Also, even pyconduit blocks access to keys that starts or ends with underscore, there is no 100% warranty about security.Installpython -m pip install pyconduitLinksQuick StartDocumentationLicenseSource code is licensed under MIT license. You must include the license notice in all copies or substantial uses of the work.
Package: pycondusco
PyConduscoOverviewpycondusco lets you run a function iteratively, passing it the rows of a dataframe or the results of a query.We call the functions pycondusco runs pipelines, and define a pipeline as a function that accepts a list of parameters and does something based on the values of the parameters.The most common use case for pycondusco are data pipelines.  For data pipelines that primarily run SQL queries, we can template queries with a library (ie.pystache), so that parametrized values are separated from the query logic.  We can then render the query with the appropriate values:import pycondusco
from pycondusco.run_pipeline import run_pipeline
import pystache

json_string = '{"first_name": "First", "last_name":"Last"}'

params = [
    {
        'k1':'v1',
        'k2':'v2',
    },
    {
        'k1':'v1',
        'k2': json_string,
    },
]

def pipeline(params):
    print pystache.render('k1 value is {{k1}}, k2 is {{k2}}',params)

run_pipeline(pipeline,params)pycondusco provides the following extensions in functionality to the above design pattern:the user can provide a query and each row of results is iteratively passed to the pipelineany JSON-string parameter will be converted to an object before being passed to the pipelineFunctionsfunctiondescriptionrun_pipeline(pipeline, parameters)iteratively pass each row of parameters to a pipeline, converting any JSON parameters to objectsrun_pipeline_gbq(pipeline, query, project)calls run_pipeline with the results of query executed via bigqueryInstallationpip install pycondusco
export GOOGLE_APPLICATION_CREDENTIALS="<FILE_PATH_TO_CREDENTIALS>"FeaturesName-based substitution of query-results including JSON into pipelines, iterating through rows of parameters dataframe:import pystache
from google.cloud import bigquery
import pycondusco
from pycondusco.run_pipeline_gbq import run_pipeline_gbq

client = bigquery.Client()

def pipeline(params):
    query = """
      SELECT
        {{#list}}
          SUM(CASE WHEN author.name ='{{name}}' THEN 1 ELSE 0 END) as n_{{name_clean}},
        {{/list}}
        repo_name
      FROM `bigquery-public-data.github_repos.sample_commits`
      GROUP BY repo_name
    """

    query_job = client.query(pystache.render(query, params))
    results = query_job.result()  # Waits for job to complete.
    for row in results:
        print(dict(row.items()))


query = """
   SELECT CONCAT('[',
   STRING_AGG(
     CONCAT('{\"name\":\"',name,'\",'
       ,'\"name_clean\":\"', REGEXP_REPLACE(name, r'[^[:alpha:]]', ''),'\"}'
     )
   ),
   ']') as list
   FROM (
     SELECT author.name,
       COUNT(commit) n_commits
     FROM `bigquery-public-data.github_repos.sample_commits`
     GROUP BY 1
     ORDER BY 2 DESC
     LIMIT 10
   )
"""

run_pipeline_gbq(pipeline, client, query)
Package: pycones
pycones...basic utilsflatten a listflatten([1,2,[3,[4,5]]])# [1, 2, 3, 4, 5]join lists into a stringlist_join(list("abc"),list("def"),sep=",")# "a,b,c,d,e,f"switch jupyter kernel into python or rnb_kernel_switch(notebook_path,kernel='python')round a number to significant digitssignif_number(1.232,2)concat two lists with None toleranceconcat_list([1,2,3],None)concat_list([1,2,3],[4,5,6])
Package: pyconf
Python-based configuration readerSimply enough, loads a file into a Python module object but does not place it
in the module cache or otherwise bind it.>>> import posixpath
>>> conf = load(posixpath.__file__)
>>> conf  # doctest: +ELLIPSIS
<module '<config>' from '...'>
>>> conf.pathsep
':'And so on. You could also useload_dictto get a dict instead:>>> type(load_dict(posixpath.__file__))
<type 'dict'>Though, if you try to load files that aren’t recognized or loadable, you get
an error:>>> load("lala.ini")
Traceback (most recent call last):
  ...
ConfigurationError: no suitable loader for config module 'lala.ini'
Package: py-config
Config Classa class for managing project variables based upon bash env variablesrecommended to be used with .export filesJon Morehouse
ScriptsSample Usagefrom config import Config

# load variables from env
Config.load_from_list(["PATH", "PWD", "ENV"])

# load an exports file of the following format
# ENV=PRODUCTION
# MODULE=TEST
Config.load_from_path(".test.exports")

# load yaml/json file
Config.load_from_path("config.json")
Config.load_from_path("config.yml")

# access config
print Config.PATH
Package: pyConfigAnalysis
This is a python project that parses the configuration file for the "key = value" type.Usage :# analysis.conf# remark ...key1 = value1key2 = value2------------Create a ConfigAnalysis object:from pyConfigAnalysis import ConfigAnalysisconfig = ConfigAnalysis()config.read("analysis.conf")Get all of the key:config.keys()->["key1","key2"]Get the value from a key:config.get("key1")->"value1"Update a configurationconfig.update("key2","newvalue2")#checkconfig.get("key2")->"newvalue2"#save to configuration fileconfig.save()Add a configurationconfig.add("key3","value3")#checkconfig.get("key3")->"value3"#save to configuration fileconfig.save()
Package: pyconfigator
ConfiGatorA configuration file generator meant to be used withGatorGradle.OverviewConfiGator is a tool to be used in hand with GatorGradle to generate configuration
files for assignments that require GatorGradle. ConfiGator usesPoetryfor package and dependency management.UsageInstalling ConfiGatorCommand to install ConfiGatorpipxinstallpyconfigatorifpipxdoes not work, usepipinstead.Running ConfiGatorCommand to run ConfiGator (after installing usingpiporpipx)configatorCommand to Change Specific ConfigurationsThe command below will show a list of every available command to change
specific configurations inconfig/gatorgrader.ymlorbuild.gradle.configator--helpIf you need AssistanceCreate an issue or a discussion post for assistance if you encounter any issues
with ConfiGator.ContributorsWilliam Connelly,@connellywKyrie Doniz,@donizkKevin Lee,@Kevin487Peter Snipes,@Peter-SnipesKai'lani Woodard,@kailaniwoodardAdam Shinomiya,@TheShiny1Maria Kim Heinert,@mariakimheinertSaejin Heinert,@Michionlion
Package: pyconfig-env
PyConfigAutomatic Python Environment Variable Configuration PackageDescriptionPyConfigis a DevOps tool that helps Python developers to efficiently import various configuration files into their environment. It also automates config file exports to VCS such as Git while hiding sensitive information.InstallationInstallPyConfigwith Pip:pipinstallpyconfig-envUpgrade using the-Uflag:pipinstall-Upyconfig-envUsageImporting into the environmentAfter installing, importPyConfiginto your main Python file:importpyconfigThen you can import configurations as Python files, JSON objects, JSON files, or .env files:# Python filepyconfig.parse_py('config.py')# JSON objectjson_dict={'DEBUG':True}pyconfig.parse_json_obj(json_dict)# JSON filepyconfig.parse_json('config.json')# .env filepyconfig.parse_env('config.env')The variables can be accessed anywhere in the Python program viaos.environ:print(os.environ['DEBUG'])# Prints TrueExporting a file for VCSPyConfigcurrently only supports exporting Python config files for VCS. In order to make use of this feature, first ensure that the original config file is hidden from the VCS. For example, with Git, add the filename to a.gitignorefile.# config.py - This file was added to .gitignore

DEBUG = True  # Ending a line with an asterisk (*) denotes a variable that is safe to upload in the VCS system*
SECRET = 'database password'  # All other variables will be cleared for the template configuration file (config.py.sample)Then simply generate the template configuration file:pyconfig.py_template('config.py')# Creates config.py.sample# config.py.sample

DEBUG = True  # Ending a line with an asterisk (*) denotes a variable that is safe to upload in the VCS system
SECRET = ''  # All other variables will be cleared for the template configuration file (config.py.sample)As shown above, the entire file remained exactly the same, except that the variables which were not marked as safe had their values cleared. The asterisks at the end of the lines were also removed, as they are unnecessary for the VCS system itself.DevelopersAshish D'Souza -@computer-geek64ReleasesThe current stable release forPyConfigisv1.0.0It is also released as a Python package onPyPI(the Python Package Index).VersioningThis project is uses theGitVersion Control System (VCS).LicenseThis project is licensed under theMIT License.
Package: pyconfig-extension
===============Configuration Manager for Python===============Python ConfigurationThis library is designed for managing Configuration in Python projects and is inspired bythe Microsoft.Extensions.Configuration library in C#.InstallationThis library can be installed via pip:.. code-block:: bashpip install pyconfigUsageTo use the configuration manager, you first need to create aConfigurationBuilderobject and add one or more configuration sources.For example, you can add a JSON file source and an environment variable source like this:.. code-block:: pythonfrom pyconfig import ConfigurationBuilder, IConfigurationBuilder



builder: IConfigurationBuilder = ConfigurationBuilder() \

    .add_json_file('config.json') \

    .add_environment_variables()



config = builder.build()
Package: py-configfile
Python ConfigFile Package说明这是一个 Python 配置文件加载模块，主要解决 Ymal, Json 配置文件的快速加载，同时支持网络配置动态加载。使用from configfile import ConfigFile

configfile = ConfigFile('config_dir')

print(configfile.load_app('config'))
print(configfile.load_app_json('config'))加载动态配置import json
import time
from configfile import ConfigFile


timestamp1 = time.time()
timestamp2 = False

configfile = ConfigFile('config_dir)

def callback():
    global timestamp1
    global timestamp2
    if timestamp2 is False:
        timestamp2 = timestamp1
    else:
        timestamp2 = time.time()
    return json.dumps({"timestamp": timestamp2})

print(configfile.load_dynamic_json('config', callback, 3))
time.sleep(1)
print(configfile.load_dynamic_json('config', callback, 3))
time.sleep(3)
print(configfile.load_dynamic_json('config', callback, 3))