Saravanan666/pypi-org huggingface dataset:
Package: pyinfra
pyinfra automates infrastructure using Python. It’s fast and scales from one server to thousands. Great for ad-hoc command execution, service deployment, configuration management and more.Documentation⇒Getting Started•Examples•Help & Support•ContributingChat ⇒#pyinfraon MatrixWhy pyinfra? Design features include:🚀Super fastexecution over thousands of hosts with predictable performance.🚨Instant debuggingwith realtime stdin/stdout/stderr output (-vvv).🔄Idempotent operationsthat enable diffs and dry runs before making changes.📦Extendablewith the entire Python package ecosystem.💻Agentless executionagainst anything with shell access.🔌Integratedwith connectors for Docker, Terraform, Vagrant and more.QuickstartInstall pyinfra withpip:pip install pyinfraNow you can execute commands on hosts via SSH:pyinframy-server.netexec--echo"hello world"Or target Docker containers, the local machine, and otherconnectors:pyinfra@docker/ubuntuexec--echo"Hello world"pyinfra@localexec--echo"Hello world"As well as executing commands you can define state usingoperations:# Install iftop apt package if not presentpyinfra@docker/ubuntuapt.packagesiftopupdate=true_sudo=trueWhich can then be saved as a Python file likedeploy.py:frompyinfra.operationsimportaptapt.packages(name="Ensure iftop is installed",packages=['iftop'],update=True,_sudo=True,)The hosts can also be saved in a file, for exampleinventory.py:targets=["@docker/ubuntu","my-test-server.net"]And executed together:pyinfrainventory.pydeploy.pyNow you know the building blocks of pyinfra! By combining inventory, operations and Python code you can deploy anything.See the more detailedgetting startedorusing operationsguides. See how to useinventory & data,global argumentsandthe CLIor check out thedocumented examples.
Package: pyinfra-docker
pyinfra DockerA basicpyinfradeploy that installs and optionally configures Docker on the target hosts. Officially tested & supported Linux distributions:Ubuntu 16/18/20Debian 8/9/10CentOS 7/8This deploy installs packages in thedocker-ceecosystem (docker-ce/docker-ce-cli/docker-ce-rootless-extras) You can specifydocker_versionin the host data and it will install that version for alldocker-cepackages.UsageSeethe examplefor a more complete example.frompyinfra_dockerimportdeploy_dockerdeploy_docker()
Package: pyinfra-forked-by-stone-w4tch3r
pyinfra automates infrastructure using Python. It’s fast and scales from one server to thousands. Great for ad-hoc command execution, service deployment, configuration management and more.Documentation⇒Getting Started•Examples•Help & Support•ContributingChat ⇒#pyinfraon MatrixWhy pyinfra? Design features include:🚀Super fastexecution over thousands of hosts with predictable performance.🚨Instant debuggingwith realtime stdin/stdout/stderr output (-vvv).🔄Idempotent operationsthat enable diffs and dry runs before making changes.📦Extendablewith the entire Python package ecosystem.💻Agentless executionagainst anything with shell access.🔌Integratedwith connectors for Docker, Terraform, Vagrant and more.QuickstartInstall pyinfra withpip:pip install pyinfraNow you can execute commands on hosts via SSH:pyinframy-server.netexec--echo"hello world"Or target Docker containers, the local machine, and otherconnectors:pyinfra@docker/ubuntuexec--echo"Hello world"pyinfra@localexec--echo"Hello world"As well as executing commands you can define state usingoperations:# Install iftop apt package if not presentpyinfra@docker/ubuntuapt.packagesiftopupdate=true_sudo=trueWhich can then be saved as a Python file likedeploy.py:frompyinfra.operationsimportaptapt.packages(name="Ensure iftop is installed",packages=['iftop'],update=True,_sudo=True,)The hosts can also be saved in a file, for exampleinventory.py:targets=["@docker/ubuntu","my-test-server.net"]And executed together:pyinfrainventory.pydeploy.pyNow you know the building blocks of pyinfra! By combining inventory, operations and Python code you can deploy anything.See the more detailedgetting startedorusing operationsguides. See how to useinventory & data,global argumentsandthe CLIor check out thedocumented examples.
Package: pyinfraformat
pyinfraformatPython library for Finnish Infraformat (version 2.5)InstallationLatest (stable)pyinfraformatcan be installed with pippython -m pip install pyinfraformatThe latest (unstable) version can be installed from git with pip (needs git-tools).python -m pip install git+https://github.com/ahartikainen/pyinfraformatLibrary can be installed also bygit clone/ downloading zip.git clone https://github.com/ahartikainen/pyinfraformat
cd pyinfraformat
python -m pip install .To install inplace for development work, use-ecommand.python -m pip install -e .
Package: pyinfra-tinc
pyinfraTincApyinfradeploy that installs & configures theTinc mesh VPN. Developed & tested with:Ubuntu 18/20Debian 9/10CentOS 7/8UsageA default install and configure of a Tinc network is shown below. Each of the three deploy functions is detailed below.frompyinfra_tincimportconfigure_tinc,install_tinc,sync_tinc_configurationsSUDO=Trueinstall_tinc(netname='vpn0')configure_tinc(netname='vpn0')sync_tinc_configurations(netname='vpn0')install_tincThis deploy downloads, compiles & installs thetincdbinary, along with any requireddeb/rpmpackages required to do so. This uses thehost.data.tinc_versionvariable.configure_tincThis deploy generates the Tinc configuration directory and files.sync_tinc_configurationsThis deploy syncs the host configuration files to all other hosts, which actually enables thetincddaemons to connect to each other and form the mesh network.
Package: pyinid
pyINIDIran National ID ToolsCheck validity of Iran National ID as the following algorithm:(checksumwill be the rightmost digit of National ID code )Generate a random valid Iran National ID prefixed with desired numbersInstallation[sudo -H ]pip(3) install pyinidUsing  as a libraryCheck validityimportinidifinid.check_id('0123456789'):print("Correct")else:print("Incorrect")or use class based approach:importinidobj1=inid.INID("0012345679")obj1.is_valid()# Trueobj2=inid.INID("001234567")# incompleteobj1.value# True# iterate through all NIDsfornidininid.INID_RANGE():print(nid)# all NIDs for one/multiple citiesfornidininid.INID_RANGE(city_codes=inid.CITY_CODES['تهران']['تهران مرکزی']):print(nid)# all NIDs for one/multiple cities from a rangefornidininid.INID_RANGE(100,777,city_codes=inid.CITY_CODES['تهران']['تهران مرکزی']):print(nid)Generateimportinidprint(inid.generate_id())# Completely Randomprint(inid.generate_id('12345'))# With Desired Prefixprint(inid.generate_id('123456789'))# Only generate checksumUsing  as a cli tool$ python3 -m inid
Package: pyini-parser
ini-configuration-parserdescriptionAn INI file is a configuration file for computer software that consists of a text-based content with a structure and syntax comprising key–value pairs for properties, and sections that organize the properties.[1] The name of these configuration files comes from the filename extension INI, for initialization, used in the MS-DOS operating system which popularized this method of software configuration. The format has become an informal standard in many contexts of configuration, but many applications on other operating systems use different file name extensions, such as conf and cfg.Getting startedInstall the package$pipinstallpyini-parserfrompyini_parser.configure.parserimportConfigParserconfig=ConfigParser()config["deployment"]={"domain_name":"www.example.com","secret_key":"!@#$#$#@!!",}config["database"]={"host":"localhost","port":"3306","user":"root",}config["email"]={"host":"smtp.gmail.com","port":"587",}config["devolvement"]={"api_key":"!@#$%^&*()_+",}string_content="""[deployment]domain_name=www.example.comsecret_key=!@#$#$#@!![devolvement]api_key=!@#$%^&*()_+"""withopen("example.ini","w")asf:config.write(f)# Check example.ini file contentsconfig.sections()# Return a list of sectionsconfig.get("deployment","domain_name")# Get the value of a key in a sectionconfig.append('devolvement',{'password':'#%$%80@#$36415'})# Append a new key/value pair to section 'devolvement'config.read_from_string(string_content)# you can use this method to check if everything working well# Uncomment the following lines to test the read method if you have a file# config.read(f) # Read example.ini file contents | you must have file example.ini in the same directoryThen you can test you'r file with pytest test library.$pytestYou should see something like this======= 11 passed in 0.08s =======
Package: py-init
pyinitis a command line tool for generating skeletons of python
packages from a directory ofjinjatemplates.The interface is easy:pyinit -p my-new-project -g my-github-user-nameThis will initialize a highly-opinionated github repository, with your
command line args inserted in relevant places throughout the following
directory tree:my-new-project
├── README.md
├── build_docs.sh
├── docs
│   ├── Makefile
│   ├── _static
│   │   └── logo.png
│   ├── _themes
│   │   ├── flask_theme_support.py
│   │   └── kr
│   │       ├── autotoc.html
│   │       ├── layout.html
│   │       ├── relations.html
│   │       ├── sidebarlogo.html
│   │       ├── static
│   │       │   └── flasky.css_t
│   │       └── theme.conf
│   ├── conf.py
│   ├── index.rst
│   └── install.rst
├── requirements.txt
├── setup.py
├── src
│   └── __init__.py
└── tests
    ├── README.md
    ├── __init__.py
    ├── fixtures
    │   └── README.md
    └── tests.pyThis default template comes withnosefor testing,sphinxfor
docs (with Kenneth Reitz’s Template),travis-cifor continuous
integration andpandocfor rendering your markdown README.md on
py-pi.You can build and serve the docs by runningbuild.sh.CustomizingIf you’d like, you can also create your own folder ofjinjatemplates and pass it in as follows:pyinit -p my-new-project -g my-github-user-name -t path/to/my-template/You can also pass in a series of custom json key-value pairs if you want
to add extra context:pyinit -p my-new-project -g my-github-user-name -t my-template/ -k "{'key1':'value1', 'key2':'value2'}"These values can be inserted anywhere in your custom templates using
standardjinjasyntax:{{ key1 }}, {{ key2 }}Heres the full cli specification:usage: pyinit [-h] [-p PROJECT_NAME] [-g GITHUB_USER] [-a AUTHOR] [-e EMAIL]
              [-d DESCRIPTION] [-t TEMPLATE_PATH] [-k KWARGS]

Initialize a python repository.

optional arguments:
  -h, --help            show this help message and exit
  -p PROJECT_NAME, --project-name PROJECT_NAME
                        The name of your project.
  -g GITHUB_USER, --github-user GITHUB_USER
                        Your github user name.
  -a AUTHOR, --author AUTHOR
                        Your name.
  -e EMAIL, --email EMAIL
                        Your email.
  -d DESCRIPTION, --description DESCRIPTION
                        The projects' description.
  -t TEMPLATE_PATH, --template TEMPLATE_PATH
                        A directory of custom templates
  -k KWARGS, --kwargs KWARGS
                        A json string or a .json / .yml filepath of custom
                        kwargsInstallationpip install pyinitTODO: * Don’t rely onos.system()* create repository ongithub* activate virtualenv * linkREADME.md-> index.rst for
docs. * webhooks for read the docs / s3 upload for data / binaries.
Package: pyinitials
PyInitials, because GvR is shorter than Guido van Rossumfrompyinitialsimportinitialsprint(initials('Guido van Rossum'))# prints "GvR"This project is a Python clone of theJavaScript initials package.InstallationInstall fromPyPi, for example with
Poetry:poetryaddpyinitialsUsagefrompyinitialsimportinitials,find,parse,add_toinitials('John Doe')# 'JD'initials(['John Doe','Robert Roe'])# ['JD', 'RR']# alias for initials('John Doe')find('John Doe')# 'JD'parse('John Doe')# Parts(name='John Doe', initials='JD', email=None)# add initials to name(s)add_to('John Doe')# 'John Doe (JD)'# Pass existing initials for namesinitials(['John Doe','Jane Dane'],existing={'John Doe':'JD'})# ['JD', 'JDa']NotesPreffered initials can be passed in(JD), e.g.initials('John Doe (JoDo)')# 'JoDo'If a name contains an email, it gets ignored when calculating initialsinitials('John Doe joe@example.com')# 'JD'If a nameisan email, the domain part gets ignoredinitials('joe@example.com')# 'jo'When passing an Array of names, duplicates of initials are avoidedinitials(['John Doe','Jane Dane'])# ['JDo', 'JDa']Build and testInstall dependencies:poetryinstallRun the unit-tests:poetryrunpytestLICENSEISC
Package: py-init-structure
py-init-structureThis project to create sample structure for the tests projectpy-init-structureAvailable options for now:general-tests-project- creates folders for common test project without binding to any language or frameworkpytest-tests-project-  creates folders for common test project with pytest, adds common files with package descriptionsHow to useStart withinit_structurecommand and follow interactive instruction to setup project file structureHow to contributeIf you want to add sample structure of your project (doesn't matter language or purpose), it could be done in following way:install this libgoto directory of your projectexecutedir_tree_to_jsoncommand (tree in required format will be printed )use output of command above to create new class for you project. Refer tocommon_components/trees/test_project_sample.pyfile
Package: pyInjection
pyInjectionpyInjector is a .Net style dependency injection container built for Python3 and utilising the typing module.Registertype,instanceandlambdafunctions against a base type for constructor injecting.SupportsABCbase types and mock interfaces.Validates container for duplicate registrations, missing registrations and inconsistent scope registrations at runtime.Table of ContentsClass Setup (for Injectables)Constructor Setup (for accepting Injectables)Registration3.1.Type Registration3.2.Instance Registration3.3.Lambda Registration (for decorators)Resolving4.1.Lambda Registration with a Resolve4.2.Resolve for application executionValidationClass Setup (for Injectables)In order for pyInjection to register and inject a class into a constructor, classes must extend a base class. This class can be an abstract class (using ABC) or a mock interface:fromabcimportABC,abstractmethodclassIFoo(ABC):@abstractmethoddefdo_something(self)->None:passorclassIFoo:defdo_something(self)->None:passConstructor Setup (for accepting Injectables)In order for pyInjection to inject objects into class constructors, the constructor must be decorated with@Container.inject:frompjInjectionimportContainerclassBar:__foo:IFoo@Container.injectdef__init__(self,foo:IFoo):self.__foo=foodefrun(self)->None:self.__foo.do_something()RegistrationpyInjection supports 3 types of injectable registration across bothtransientandsingletonlifetimes.frompyInjectionimportContainerContainer.add_transient(interface=IFoo,implementation=Foo)Container.add_singleton(interface=IBar,implementation=Bar)Container registrations (like in .Net) maps animplementationto theinterfacebase within supported constructors.Type Registration:Container.add_transient(interface=IFoo,implementation=Foo)Instance Registration:# Note this is registered as transient but will be resolved as a singletonContainer.add_transient(interface=IFoo,implementation=Foo())Lambda Registration (for decorators):Container.add_transient(interface=IFoo,implementation=lambda:Foo())ResolvingIn some cases you may wish to resolve an instance from the container (for a lambda function or running the application).Lambda Registration with a Resolve...Container.add_transient(interface=IFoo,implementation=Foo)Container.add_transient(interface=IBar,implementation=lambda:Bar(foo=Container.resolve(interface=IFoo))Resolve for application execution...Container.add_singleton(interface=IFoo,implementation=Foo)Container.add_singleton(interface=IBar,implementation=Bar)bar:IBar=Container.resolve(interface=IBar)bar.run()ValidationIn order to ensure that the container has been configured correctly and has everything necessary to build all injectable dependencies run thevalidatemethod in the composition root:...Container.validate()Any issues found within the container will be raised as an Exception. Exceptions will be raised for the following:Duplicate registrationsMissing registrationsType registrations for constructors with primitive types (these should be an instance registration)
Package: pyinjector
PyinjectorA cross-platform tool/library allowing dynamic library injection into running processes.
If you are looking for a way to injectpythoncode into a running process, try thehypnolibrary.Pyinjector has no external python dependencies.
It is implemented as a python wrapper forkubo/injector.InstallationpipinstallpyinjectorBoth source distributions,manylinux2010wheels and windows wheels are uploaded to Pypi for every release.UsageCLIinject<pid><path/to/shared/library>APIfrompyinjectorimportinjectinject(pid,path_to_so_file)How it worksWe buildkubo/injectoras a C-extension and use its interface usingctypes.kubo/injectoris an awesome repo allowing to inject shared libraries into running
processes both on Windows (CreateRemoteThread), Linux (ptrace), and Mac (task_for_pid).
Package: pyinkscape
pyinkscapeA library to manipulate Inkscape SVG content using Python 3A quick lookTo run piechart demo, please try:python3-mpipinstall--userpyinkscape
python3demo_piechart.pyUseful LinkspyInkscape documentation:https://pyinkscape.readthedocs.io/pyInkscape on PyPI:https://pypi.org/project/pyinkscape/Soure code:https://github.com/letuananh/pyinkscape/
Package: pyinline
PyinlineA function inliner for Python. Importinlinefrompyinlineand run:$python-mpyinlinesource.pyThis will convert the following:frompyinlineimportinlineimportlogginglog=logging.getLogger(__name__)@inlinedeflog_error(msg:str,exception:Exception):log.error(msg,exception,exc_info=True)try:x=1/0exceptExceptionase:log_error("Could not divide number",e)will generate:importlogginglog=logging.getLogger(__name__)try:x=1/0exceptExceptionase:log.error("Could not divide number",e,exc_info=True)Call with--diffto generate a patch.
Package: pyinmem
PyInMemStorePyInMemStore is a lightweight, in-memory data store written in Python. It provides a simple way to store and manipulate data structures such as strings, lists, sets, and sorted sets. The store offers thread-safe operations and supports key expiry, similar to Redis.FeaturesBasic data types: Strings, Lists, Sets, and Sorted Sets.Thread-safe operations.Key expiry functionality.Dynamic method dispatching based on data type.Easy extensibility for additional data types and operations.Data Types and OperationsStringset(key, value, ttl=None): Set a string value under a key. Optionally, specify a Time-To-Live (TTL) in seconds.get(key): Retrieve the string value for a given key.Listlpush(key, value): Push a value to the beginning of a list at a given key.rpop(key): Pop a value from the end of a list at a given key.llen(key): Get the length of the list at a given key.Setsadd(key, *values): Add one or more values to a set at a given key.srem(key, *values): Remove one or more values from a set at a given key.smembers(key): Get all the members of the set at a given key.sis_member(key, value): Check if a value is a member of the set at a given key.Sorted Setzadd(key, scores): Add one or more member-score pairs to a sorted set at a given key.zrange(key, start, stop): Get a range of members from a sorted set at a given key, sorted by score.zscore(key, member): Get the score of a member in a sorted set at a given key.UsagefrompyinmemstoreimportPyInMemStorestore=PyInMemStore(save_data=True)store.set('hello','world')print(store.get('hello'))store.lpush('mylist','hello')store.lpush('mylist','world')print(store.rpop('mylist'))store.sadd('myset','hello','world')print(store.smembers('myset'))store.zadd('my_sorted_set',{'Alice':100,'Bob':90})print(store.zrange('my_sorted_set',0,-1))print(store.zscore('my_sorted_set','Alice'))
Package: pyinotify
# PyinotifyLicense          : MITProject URL      : [http://github.com/seb-m/pyinotify](http://github.com/seb-m/pyinotify)Project Wiki     : [http://github.com/seb-m/pyinotify/wiki](http://github.com/seb-m/pyinotify/wiki)API Documentation: [http://seb-m.github.com/pyinotify](http://seb-m.github.com/pyinotify)## DependenciesLinux ≥ 2.6.13Python ≥ 2.4 (including Python 3.x)## Install### Get the current stable version from PyPI and install it withpip# To install pip followhttp://www.pip-installer.org/en/latest/installing.html$ sudo pip install pyinotify### Or install Pyinotify directly from source# Choose your Python interpreter: either python, python2.7, python3.2,..
# Replacing XXX accordingly, type:
$ sudo pythonXXX setup.py install## Watch a directoryInstall pyinotify and run this command from a shell:$ python -m pyinotify -v /my-dir-to-watch
Package: pyinotify-smarkets
# pyinotify-smarketsLicense          : MITProject URL      : [http://github.com/smarkets/pyinotify-smarkets](http://github.com/smarkets/pyinotify-smarkets)Change log       :https://github.com/smarkets/pyinotify-smarkets/blob/master/CHANGES## DependenciesLinux ≥ 2.6.13Python ≥ 3.5## Install### Get the current stable version from PyPI and install it withpip# To install pip followhttp://www.pip-installer.org/en/latest/installing.html$ sudo pip install pyinotify-smarkets### Or install pyinotify-smarkets directly from source$ sudo python setup.py install## Watch a directoryInstall pyinotify-smarkets and run this command from a shell:$ python -m pyinotify -v /my-dir-to-watch
Package: pyinputhandler
InputHandlerA (basic) cross-platform python input handlerTable of ContentsAbout The ProjectGetting StartedInstallationUsageLicenseAcknowledgementsAbout The ProjectThis project aims to implement a finer control for the input, especially when in use with threads.It was partially inspired by aiming to be a cross-platform alternative to theget_line_bufferfunction from the Unix only python standard libraryreadline.Getting StartedFor the manual installation you must havesetuptoolsinstalled.Python usually comes withsetuptools, but if yours does not, then runpipinstall--upgradesetuptoolsThen clone the repositorygitclonehttps://github.com/DaHunterTime/InputHandlerAnd move to the newly cloned foldercdInputHandlerInstallationManual installation:For a manual installation you can use any of the following options.Using python (not recommended)Run the following line in your terminalpythonsetup.pyinstallTo uninstall you must remove the files manuallyUsing pipRun the following line in your terminalpipinstall.To uninstall runpipuninstallpyinputhandlerPip installation:To install runpipinstallpyinputhandlerTo uninstall runpipuninstallpyinputhandlerUsageTo begin with, we can import the library withimportinputhandlerOr you can import specific things likebuffer_inputfrominputhandlerimportbuffer_inputWe can use thetry_inputlikefrominputhandlerimporttry_inputn=try_input("Enter an integer: ",cast=int,default=0)The previous code will prompt the user for an integer, process the input and then turn it into anintif it can, otherwise it returns the specified default value.For more uses and tests you can execute the specific test file fromtestsor runpython test.pyto select which test to run.LicenseDistributed under the MIT License. SeeLICENSEfor more information.AcknowledgementsNone of the following are associated with the project in any way. They are mentioned as a source of
learning and inspiration for parts of this project.README TemplateCross-Platform getch() for PythonWindows Cursor Position
Package: pyinputstats
pyInputStats - An keyboard and mouse statistics toolpyInputStats watches your mouse and your keyboard in order to generate some statistics. With pyInputStats you are able to answer substantial questions like:
* how many metres do I move my mousepointer every day
* how many times to I press a key on my keyboard
* do I click my mouse more oftenly on fridays?
* to I make more mouse-metres in the morning hours?