Saravanan666/pypi-org huggingface dataset:
Package: clean-cmake-project
clean_cmake_projectpython script to generate skeleton for cmake project for c++https://github.com/FrenchCommando/clean_cmake_projectDependencypython package stringcase - to convert name formats from/to pascal/snake/constantlisted in requirement.txtpython 3 - currently working with 3.7Usagedirectly use the scriptorinstall the package and call a functionRun the script - Old / Simple versionRun the script in cmdThe script will prompt a name for the new sub_projectEnter the project name and hit EnterYou may also enter a path to another folder is you want to create the file in another folder
(creates the folder if not exists), otherwise the files will be created in the current working directory and the name of the project is the base name of the current directory(optional) If you also want to build an executable, you can specify a suffix for it (typically "run").using pippip install clean_cmake_projectimport clean_cmake_project.ProjectSkeleton as ccpccp(name, path)orinstalling the package also adds an entrypointcmake-python-projectthat has the same effect as running the scriptStructureIf not already present, a CMakeLists.txt file will be created and filled.googletest will be cloned in /libs/googletestsource files are placed in the /src/ folder - with one sub-folder for each sub-projecttest files are placed in the /tests/ folder - with one sub-folder for each sub-project(optional) source files for executable in /src/*-exe_suffix/ folder##LinksThe name of the main project is retrieve from the location of the script, it is used forname of the project in the main CMakeList.txtguards for .h files (#define CLEAN_CMAKE_PROJECT_TOTO_H)The main CMakeLists.txt contains links togoogletest directoryeach src and tests sub-directoriesThe CMakeLists.txt from the test folder has a link to the project defined in the src folderthe .cpp test contains and include to the .h in the src folderContributionAnything is always welcomeGithub
Package: cleanco
cleanco - clean organization namesWhat is it / what does it do?This is a Python package that processes company names, providing cleaned versions of the
names by stripping away terms indicating organization type (such as "Ltd." or "Corp").Using a database of organization type terms, It also provides an utility to deduce the
type of organization, in terms of US/UK business entity types (ie. "limited liability
company" or "non-profit").Finally, the system uses the term information to suggest countries the organization could
be established in. For example, the term "Oy" in company name suggests it is established
in Finland, whereas "Ltd" in company name could mean UK, US or a number of other
countries.How do I install it?Just use 'pip install cleanco' if you have pip installed (as most systems do). Or download the zip distribution from this site, unzip it and then:Mac:cdinto it, and entersudo python setup.py installalong with your system password.Windows: Same thing but withoutsudo.How does it work?Let's look at some sample code. To get the base name of a business without legal suffix:>>> from cleanco import basename
>>> business_name = "Some Big Pharma, LLC"
>>> basename(business_name)
>>> 'Some Big Pharma'Note that sometimes a name may have e.g. two different suffixes after one another. The cleanco
term data covers many of these, but you may want to runbasename()twice on the name, just in case.If you want to use your custom terms, please seecustom_basename()that also provides some other ways to adjust how base name is produced.To get the business type or country:>>> from cleanco import typesources, matches
>>> classification_sources = typesources()
>>> matches("Some Big Pharma, LLC", classification_sources)
['Limited Liability Company']To get the possible countries of jurisdiction:>>> from cleanco import countrysources, matches
>>> classification_sources = countrysources()
>>> matches("Some Big Pharma, LLC", classification_sources) ´
['United States of America', 'Philippines']Are there bugs?See the issue tracker. If you find a bug or have enhancement suggestion or question, please file an issue and provide a PR if you can. For example, some of the company suffixes may be incorrect or there may be suffixes missing.To run tests, simply install the package and runpython setup.py test. To run tests on multiple Python versions, installtoxand run it (see the provided tox.ini).Special thanks to:Wikipedia'sTypes of Business Entity article, where I spent hours of research.Contributors:Petri Savolainen
Package: cleand
cleanedpypi:https://pypi.org/project/cleand/(pypi's project name is not cleaned because it wasn't available then)Overviewcleanedis a declarative data validator.ExamplesimportjsonimportcleanedasclclassRequest(cl.Cleaned):username=cl.Str(pattern='^[a-zA-Z_]+$',blank=False,min_length=3)password=cl.Str(blank=False,min_length=8)age=cl.Int()defregister_user_api(request_json:str)->...:dirty_data=json.loads(request_json)cleaned_data=Request(**dirty_data)# username matches ^[a-zA-Z_]+$ and it has at least 3 charactersusername=cleaned_data.username# password is at least 8 characterspassword=cleaned_data.password# age is a int valueage=cleaned_data.age# do something with the dataprint(username,password,age)...register_user_api(json.dumps({'username':'user','password':'KJF83h9q3FAS','age':'20',}))try:Request(username='invalid format',password='short')exceptcl.ValidationErrorase:print(e.nested['username'])# ('The value must match: ^[a-zA-Z_]+$', 'pattern')print(e.nested['password'])# ('The length of the value must be longer than or equal to 8.', 'min_length')print(e.nested['age'])# ('This field is required', 'required')Static Typingmypy can handle almost all cleaned values in the library.importcleanedasclimportenumclassExamples(cl.Cleaned):classNestedExample(cl.Cleaned):a=cl.Int()classEnumExample(enum.Enum):a=1b=2a=cl.Either(cl.Int(),cl.Str(blank=False))b=cl.Int().opt()c=cl.Dict(key=cl.Int(),value=cl.Float().opt()).opt()d=cl.Nested(NestedExample)e=cl.Enum(EnumExample)f=cl.List(cl.Nested(NestedExample))g=cl.List(cl.Nested(lambda:Examples))ex=Examples()reveal_type(ex.a)# Revealed type is 'Union[builtins.int*, builtins.str*]'reveal_type(ex.b)# Revealed type is 'Union[builtins.int*, None]'reveal_type(ex.c)# Revealed type is 'Union[builtins.dict*[builtins.int*, Union[builtins.float*, None]], None]'reveal_type(ex.d)# Revealed type is 'Examples.NestedExample*'reveal_type(ex.e)# Revealed type is 'Examples.EnumExample*'reveal_type(ex.f)# Revealed type is 'builtins.list*[Examples.NestedExample*]'reveal_type(ex.g)# Revealed type is 'builtins.list*[hoge.Examples*]'
Package: cleandat
# CleanDat
Python functions to facilitate the pre-processing of data to prepare them for ML tasks, especially suitable for data in a clinical context.—Major functionalities include heuristic based data cleaning and feature engineering like:
- Automatic detection of encoding strings (e.g. 1=m) and application of the corresponding encoding to un-encoded data of the corresponding column
- Automatic detection of date strings of different formats (e.g. 2019-01-01, 01/01/2019, January 2022) and conversion to a unified format
- Encoding of date strings into decomposed date features (e.g. year, month, day, weekday, etc.)
- Heuristics for unification of different number formats, e.g. 1,000.00 vs. 1.000,00 or exponential notations like 1e3 vs 10x10^2
- Detection and replacement of inconsistent data values# SetupInstall via pip:pip install cleandat
Package: cleandata
An example package. Generated with cookiecutter-pylibrary.Free software: MIT licenseInstallationpip install cleandataYou can also install the in-development version with:pip install https://github.com/rinman24/cleandata/archive/master.zipDocumentationhttps://cleandata.readthedocs.io/DevelopmentTo run all the tests run:toxNote, to combine the coverage data from all the tox environments run:Windowsset PYTEST_ADDOPTS=--cov-append
toxOtherPYTEST_ADDOPTS=--cov-append toxChangelog0.0.0 (2021-06-22)First release on PyPI.
Package: cleandev-api-template
Cleandev Api TemplateEl objetivo es facilitar la creación de APIS con flask de una forma sencilla, para ellos se ha creado un wrapper
que añade las libreriasFlask-CorsyFlask-RESTfuly las preconfigura para que solo tengas que dedicar tiempo
en programar tu API.DiagramaApiFactoryNo hay mucho que decir en este punto, ya que solo hay que configurar algunos parámetros en el archivo de configuración
y pedirle a la factoría que nos cree una instancia de unaappde Flask y ya esta, como se muestra en el siguiente
ejemplo.fromflaskimportFlaskfromapi_templateimportApiFactoryfromapi_template.configimport_debugfromwerkzeug.servingimportrun_simpleapp_factory:ApiFactory=ApiFactory()app:Flask=app_factory.appif__name__=='__main__':run_simple('127.0.0.1',5000,app,use_debugger=_debug,use_reloader=True)Para crear los recursos del API se sigue los mismos pasos que paraFlask-RESTfulcon una pequeña variante, y es que
deberemos configurar como se mostrara a continuación un paquete donde iran dichos recursos y cada clase que representa
un recurso debe implementar un metodo que retornara una lista que contendrá la dirección del endpoint que se quiera
agregar de forma automatica en lugar del tradicionalapi.add_resource(HelloWorld, '/')como pone en la documentación.Agregando recursosA continuacion veremos la forma de añadir un recurso a nuestra API.importjsonfromflask_restfulimportResourcefromflaskimportrequest,Responsefromflask_jwt_extendedimportcreate_access_tokenclassLogin(Resource):defget(self):data:dict={'message':'OK','data':create_access_token(identity='test@mail.com')}returnResponse(json.dumps(data),status=200,mimetype='application/json')defpost(self):# Example loginemail=request.json.get('email')password=request.json.get('password')ifemail=='test@mail.com'andpassword=='test':data:dict={'message':'OK','data':create_access_token(identity=email)}returnResponse(json.dumps(data),status=200,mimetype='application/json')else:data:dict={'message':'User not found','data':{}}returnResponse(json.dumps(data),status=404,mimetype='application/json')@staticmethod# Este metodo agrega automaticamente el endpoint al APIdefendpoint()->list:return['/login']ConfigPara que esto funcione correctamente deberemos indicarle en el archivo de configuración el nombre del paquete donde se
encuentran los recursos, puedes ponerlos en un unico fichero o en multiples ficheros dentro del mismo paquete para que
puedas organizarlo de la forma que desees[API_TEMPLATE]path_resources_api=resources
Package: cleandev-generic-utils
Utilidades GenericasUn proyecto para recoger utilidades usadas a lo largo de otras librerias.ReflectionClassUtilsImplEsta clase posee metodos delicados en los cuales se apollan librerias muy importantes, todos ellos estan relacionado,
con la busca dinamica de paquetes y clases con el fin de instancias y comprobar dinamicamente jerarquia de clases que
son usadas por otras librerias.get_sub_packages(parent_package: str)Este metodo dado un nombre (parent_package: str) de un paquete raiz del proyecto recopila el nombre de sus paquetes
en su interior y los retorna en una listaget_class_from_package(cls, parent_package: str, class_name: str)Dado la ruta de un paquete y un nombre de una clase retorna el objeto con el nombre de esa clase del paquetedef get_class_filter_parent(cls, parent_package: str, parent_class: str)Dado un nombre de un paquete y un nombre de la clase retorna todas las clases que como padre hereden de dicha claseCleanDevGenericUtilsClase con funciones genericas y no relacionadas entre si, su unico motivo es agruparlas en un mismo lugar para organizar
la gestion de dependencias de otras libreriasget_total_page(row_for_page: int, total_row: int)Dado un numero de filas y un numero de filas por pagina calcula el numero de paginas necesario para mostar todas las
filas, muy util para calcular las paginas de un paginador.get_uuid4()Abstrae el tipado de UUDI4 que trae python y lo retorna directamente en formato (str)"check_uudi_4(uuid_string: str)Conprueba que la string pasada por parametro se un uuid4 validocheck_email_format(email: str)Comprueba si la string pasada por parametro tiene un formato valido de emailget_random_string(length=5)Retorna una string de una logintud definida por la variable length que por defecto tiene valor 5Metodo:to_camel_case(name)Convierte una string en formato "snake" como por ejemplo mi_variable en "Camel case" como por ejemplo MiVariableMetodo:def camel_to_snake(name)Convierte una string en formato "Camel case" como por ejemplo MiVariable en "snake" como por ejemplo mi_variableget_fernet_key(original_key: str = None)A diferencia que la libreria original deFernettanto las llaves como los mensajes no se pasan encodeados.Usa la libreriaFernety simplemente tiene como objetivo facilitar el proceso de obtener llaves, cifrar y desifrar
junto con dos funciones más que sonencryptydecryptencrypt(message: str, key: str):Se pasa el mensaje y la llave con la que se quiere encriptar y retonar el mensaje en formatostrencriptado.decrypt(message: str, key: str):Se pasa el mensaje y la llave con la que se quiere desencriptar y retonar el mensaje en formatostren claro.
Package: cleandev-resp-builder
Cleandev Response BuilderCon esta libreria podras constuir "Response" para las apis de una forma facil usando un fichero de codigos de error
para retornar mensajes en tus APIS.PropertiesRequeridoValor por defectoDescripciónname_file_codes:heavy_check_mark:-Nombre del archivo de los codigos de errorEs una clase con un solo método y varios parametros que analizaremos a continuaciónConfiguracionEl archivoproperties.iniexiste una varaiblename_file_codesdonde es la ruta de un fichero que contiene unjsoncon codigos y mensajes predefinidosproperties.ini[RESP_BUILDER]name_file_codes=resp_codes.jsonresp_codes.json{"ERROR":{"message":"Error"},"SUCCESS":{"message":"Success"}}mediante esta configuracion podremos acceder al contenido mediante el codigoEjemploDefinimos el siguiente endpoint/loginen nuestra Apifromresp_builderimportResponseBuilderfromflaskimportResponserespose_builder=ResponseBuilder()response:Response=respose_builder.response(code='SUCCESS',data={'anykey':'anyvalue'},status_code=200,is_merge=True)print(response.json)# {"message": "Success", "anykey": "anyvalue"} http_code = 200En este caso la salida de la request es{"message": "Success", "anykey": "anyvalue"}con un codigohttp 200 OKParametroscode: Este es el codigo que debe estar en el ficheroresp_codes.jsony retornara el valor asociado a dicho códigodata: Este parametro añade informacion extra a el response final, añadiendo los datos a la data que devuelve junto con
el codigo del fichero antes mencionado.status_code: Codigo http del responseis_merge: Por defectois_mergeesFalsesu implicación es en la forma que se construye los datos que retorna el
respone, en caso de serFalsese genera por un lado los datos provenientes del codigo del ficheroresp_codes.jsony por otro los datos que pasamos endatadentro de una llavedataen el json resultante.EjemplosPara el siguiente caso se mezclan el contenido que viene del fichero de codigos{"message": "Success"}+ lo que se
le pasa en la variabledatay dado queis mergeesTrueno crea la llavedataen el json resultantefromresp_builderimportResponseBuilderfromflaskimportResponserespose_builder=ResponseBuilder()response:Response=respose_builder.response(code='SUCCESS',data={'anykey':'anyvalue'},status_code=200,is_merge=True)print(response.json)# {"message": "Success", "anykey": "anyvalue"} http_code = 200El mismo ejemplo perois_mergeesFalsefromresp_builderimportResponseBuilderfromflaskimportResponserespose_builder=ResponseBuilder()response:Response=respose_builder.response(code='SUCCESS',data={'anykey':'anyvalue'},status_code=200,is_merge=False)print(response.json)# {"message": "Success", "data":{"anykey": "anyvalue"} http_code = 200
Package: clean-directories
clean=====## ObjectiveThe python script "clean" allow the user to clean directory off temporary files with its default behavior.With anoter configuration, it can allow you to clean a working directory before committing.The final goal is to provide multiple configurations to clean a directory the exact way you want it.## SuggestionThe best way to use this script at its fullest is to place clean.py in a personnal bin directory.For example, you can create a directory "bin" in your home and add it to the variable $PATH.Then, place the binaries and script you want to execute them wherever you are.You can of course rename clean.py to clean or another name you prefer.## Important options### Help./clean.py -h or ./clean.py --helpPrint basical informations to the user, with a summary of the available commands.### Pattern./clean.py -p PATTERN or ./clean.py --pattern PATTERNAllow the user to search for one or more pattern, overridding the default patterns.You can use this option multiple times. For example, this command imitate the normal behavior : "./clean.py -p '#*#' -p '*~'"### Force./clean.py -f or ./clean.py --forceSkip the prompt for all the files targeted.Use this command with prudence, and verify that the command will not remove a file you want to keep.### Recursive./clean.py -r or ./clean.py --recursiveMake a recursion to clean every subdirectory found.Usefull if your working directory is subdivised into multiple directories.### Configuration./clean.py -c CONFIGURATION or ./clean.py --configuration CONFIGURATIONOverride the default behavior with the given configuration.The argument for this option must be the name of the configuration placed in $HOME/.config/clean.
Package: clean-docker
clean-dockerBasic script to get rid of Docker images, containers, volumes, and networksInstallationpip install -U --user clean-dockerThe package will be installed in your user home directory. Seepipdocumentation aboutuser installs. You need the installation directory
to be present inPATHto runclean-dockerfrom the terminal.Usage$clean-docker--helpUsage: clean-docker [OPTIONS]Remove Docker images, containers, volumes, and networksOptions:--version  Show the version and exit.--help     Show this message and exit.RequirementsTested with Python 3.9+You need a Docker daemon running on your machine
Package: clean-dotenv
clean-dotenvAutomatically creates an.env.examplewhich creates the same keys as your.envfile, but without the valuesWhy?There are projects which make use of an.envfile. An.envfile contains environment variables which are used during runtime, such as API keys.
A typical.envfile might look like this:OPENAI_KEY="12345"S3_BUCKET_NAME="testbucket"An.envfile should not be commited into a repo, since it can contain sensitive information^1(you should probably adding the.envfile into your.gitignore). However, one needs to know which variables can be set in the.envfile and as a result, a lot of projects (such as laravel), provide an.env.examplefile which is a template file. So you would copy the.env.template, rename it to.envand fill in the environment variables.However, there is one issue with this approach: If one introduces a new environment variable, they need to remember to add it to the.env.examplefile. Unfortunately, if they forget this, it will not be noticed, since the program is using the.envfile and not the.env.example. This pre-commit hook tries to mitigate this problem by creating an.env.examplefile automatically (based on your.envfile), so the example.envfile would become the following.env.example:OPENAI_KEY=S3_BUCKET_NAME=Installationpipinstallclean-dotenvConsole scriptsConsultclean-dotenv --helpfor the full set of options.Common options:--root path: Defines the root path in which to look for .env filesAs a pre-commit hookSeepre-commitfor instructionsSample.pre-commit-config.yaml-repo:https://github.com/hija/clean-dotenvrev:v0.0.5hooks:-id:clean-dotenvWhat does it do?The tool looks for.envfiles in all directories and creates a new, corresponding filename.env.examplewhich is save to commit, since it contains all the keys from your.envfile, but without its values.As a result, you always have an up-to-date.env.examplefile. This shall help to reduce forgetting updating the.env.examplefiles!Technical BackgroundSince a.envfile is probably in the.gitignorefile, we cannot rely on pre-commitsfiles-filter. Instead, we tell pre-commit to run always. We then check for each subdirectory if an.envfile exists. If it exists, we automatically create an.env.examplefile.AlternativesThe biggest alternative is to not use.envfiles at all^2. If you want to keep using.envfiles without using clean-dotenv you can use language specific tools, such asdotenv-safefor node.Next Steps / IdeasAdd an option to specify theglobpattern to increase the performance (e.g. you could specify to look fordev/local.envonly)
Package: clean_enoa
Clean ENOAThis package makes requests to INEGI about unemployment in MexicoEnvironment VariablesTo run this project, you will need to add the following environment variables to your~/.profilefileINEGI_TOKENGet a tokenhere.InstallationInstall clean_enoa with pippipinstallclean_enoaFeedbackIf you have any feedback, please reach out to us atnepo.rojas@islas.org.mx
Package: cleaner
CleanerCleaner is a cool interactive shell that allows you to clean your directories
with less eforts.Why Cleaner ?Have you ever been tired to clean a messy~/Downloads/directory ? Do you
think this bunch oflsandrm <file>ormv <file> <destination>are
needed ?Cleaner solve exactly this problem, submiting to you each file of the directory
you want to clean, and reducing the commands to type tormandmv
<destination>.InstallationVia pipyou can justpip install cleanerUsageUsecleaner <directory>to clean a messy directoryA shell will be spawn, with the prompt containing a filename. The command you
will type will take effect on this file. Next, another filename will be prompted
and each file of the directory will be submited to you this way.Directories end with a ‘/’ character on the prompt.To exit the shell, you can either typequit,Ctrl-DorCtrl-C.Theinfocommand prints a line containing some useful informations. The
default format is<mode> | <user>:<group>wiht<mode>being in the same
format than the first columns of als –longcommand in bash.Useenteron a directory to list its tree. The directory will be printed
again after the traversal.Usermon a filename to remove an entry. If it’s used on a directory, it
will recursively remove all its tree.Usemv <destination>to move an entry to<destination>. If it’s used on
a directory, it will recursively move all its tree to<destination>.Usechmod <mode>to modify permissions of a file or directory. The shell will
keep the same file after this command.Usechown <user>[:<group>]to modify ownership of the file or directory. The
shell will keep the same file after this command.If you don’t type anything, the shell will go to the next element. This same
effect will take place if you typepass.
Package: cleaner-project
PyCleanerPyCleaneris a simple Python library that helps you to keep the repository
clean by finding all redundant py-files there. It is especially helpful when
you incorporate someone else's repositories, your project is growing huge, and
at some point, you need to get rid of the Python scripts you don't use.PyCleanerscans the project folder for dependencies of the core project
files (target). After exploring the project directory, it provides stats
about modules directly or indirectly imported in the target files. These
modules are referred to (in the context of this package) aslibraries. The
rest files whose names were not found during recursive search of the import
statements of the core files are namedscripts. While the removal of scripts
is possible by design, a user should prefer manual deletion after more thorough
inspection.UsageInstall with pippipinstallpycleanerGet stats about the core file dependenciespycleaner--project<proj_dir>--target<dir_w/_project_core_files>Remove those files on which the core file do not dependpycleaner--project<proj_dir>--target<dir_w/_project_core_files>--rm-scriptsLearn more aboutpycleaner's optionspycleaner--help