Saravanan666/pypi-org huggingface dataset:
Package: main-function
@main_functionA beginner-friendly decorator alternative toif __name__ == '__main__': main()idiom.This PyPi is meant to demonstrate a decorator-based alternative to the old-school idiom,if __name__ == '__main__': main(). Traditionally, this idiom indicates that a script
is meant to both be run directly and be imported as a module, but its (possibly unjustified)
prevalence in educational materials nudges beginners to wrap their head around magic methods
and how Python works under the hood before it might be appropriate.  Purely from cursory
overview of beginner-to-intermediate educational content available for free, the idea
of using magic methods for this specific purpose does seem to be the biggest source
of confusion for people new to Python - as of the moment of writing this, YouTube video
explaining what this bit of code does by Corey Schafer is sitting on 1,7 million views
(one of his best), and video explaining the same concept by mCoding is at 865 thousand
views (his most viewed video ever). Question asking what this idiom does on StackOverflow
has more than 7600 upvotes, and more than 3200 bookmarks (second most upvoted Python
question). Furthermore, this improvement fits in line with introduction of dataclasses,
which is basically a way of declaring classes without writing boilerplate magic methods.This very telling, self-explanatory decorator provides an alternative for people who donâ€™t
want to remove the  if __name__ == “__main__”: main() idiom altogether, be it for lack of
understanding, concerns about future extensibility or any other reason.Example:This (following from main_function import main_function):@main_function
def main() -> None:
    print("Hello, world!")Is fully equivalent to this:def main() -> None:
    print("Hello, world!")

if __name__ == "__main__":
    main()For further discussion that has inspired this PyPi, please see this:https://discuss.python.org/t/built-in-is-main-function-as-a-more-beginner-friendly-alternative-to-if-name-main/18570CreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.LicenseMITHistory1.0.0 (2022-08-31)First release on PyPI.
Package: main-gas-pipeline
Main gas pipelines calculationsA program for thermal and hydraulic calculation of a gas pipeline section between
two compressor stations of a main gas pipeline is presented.The purpose of the calculation is to determine the pressure and temperature of the gas at the end of the section.The calculations are performed according to the theory that is presented in Bykov's handbook[1].Seedocumentation.main-gas-pipelineon github.Installpip install main-gas-pipeline==0.0.2Seeexamplesof using the package.References[1]Bykov, L. I., Mustafin, F. M., Rafikov, S. K., Nechval', A. M., Lavrent'ev, A. E. (2006).
Tipovye raschety pri sooruzhenii i remonte gazonefteprovodov: ucheb. posobie. St. Petersburg: Nedra, 824.
Package: maingopy
maingopy - Python interface for MAiNGOMaingopy is the Python interface for MAiNGO, the McCormick-based Algorithm for mixed-integer Nonlinear Global Optimization.
MAiNGO is a deterministic global optimization solver for nonconvex mixed-integer nonlinear programming problems.
For more information on MAiNGO, please visit theMAiNGO website.
The open source version of MAiNGO is available on ourGitLab page.
The documentation of MAiNGO is availablehere.Obtaining maingopyMaingopy can either be obtained as a source of binary distribution via PyPI or built from source via the git repository.To obtain it via PyPI, run$ pip install maingopyThis will typically get you the binary distribution of the maingopy package that contains a pre-compiled version of MAiNGO along with its Python bindings, as well as an extension module forMeLOn, which contains machine learning models for use in optimization problems to be solved by MAiNGO.Note that the pre-compiled version of MAiNGO contained in this package does not allow the use ofthe optional closed-source subsolvers CPLEX or KNITRO, even if they are installed on your system,the MPI parallelization of MAiNGO.To use these features, you will need to build maingopy from source. In this case, please obtain the code from ourGitLab pageand follow the instructions provided there.Using maingopyMaingopy provides Python bindings (enabled bypybind11) for the C++ API of MAiNGO.
Details on how to use it are available in thedocumentation of MAiNGO.
Example problems can be found in theexamples directoryin the MAiNGO repository.
Package: mainhash
MainHashОписаниеУдобные команды для контрольных суммУстановкаДля установки через PIP используйтеpipinstall-UmainhashИспользованиеДля импорта рекомендуется сокращённое названиеimportMainHashasmhВстроенная информация о модулеms.__version__->str# Версия модуляms.__functions__->list# Функции, которые существуют в модулеms.__variables__->list# Переменные, которые существуют в модулеms.__depends__->dict# Обязательные и необязательные зависимостиДоступные алгоритмыmh._algs# [...]В примерах дальше используетсяsha256, но его можно заменить на любой алгоритм из списка в переменнойКонтрольная сумма для текстаДля создания контрольной суммы из текста, текст сначала преобразуется в байтыmh.sha256.text("Привет",encoding="utf-8")# 'dd679c0b9fd408a04148aa7d30c9df393f67b7227f65693fffe0ed6d0f0ade59'Кодировка по умолчанию:utf-8Контрольная сумма для локального файлаmh.sha256.path("LICENSE")# '340204d649a396644d27507047d9bd8b48d71e642aaae8d39c4c8806e231bf03'Контрольная сумма для открытого файлаwithopen("LICENSE","rb")asfile:ms.sha256.file(file)# '340204d649a396644d27507047d9bd8b48d71e642aaae8d39c4c8806e231bf03'
Package: mainmethod
mainmethod.pyProvides C-like main method support.Sample usage:# file: script.pyfrommainmethodimportmainmethod@mainmethoddefmain():print('hello, world!')Running the script defined above will execute the methodmain.$ python script.py
hello, worldNo more need forif__name__=='__main__':main()The decorator inspects the method marked as main and supports these signatures;main().                        -> No command line arguments.main(argv)(ormain(args))   -> Getsys.argvpassed to the main method call.frommainmethodimportmainmethod@mainmethoddefmain(argv):message='hello, world'if'--loud'inargv:message=message.upper()print(message)The decorator also automatically gathers the return value from the main method and uses it as the return status code.
Package: mainpy
@main.pyBasic ExamplesInstead of the verbose "boilerplate"defmain():...if__name__=='__main__':main()mainpy can be used to write it as:frommainpyimportmain@maindefapp():...Similarly, the async boilerplateimportasyncioasyncdefmain():...if__name__=='__main__':asyncio.run(main())can be replaced with@mainasyncdefasync_app():...If, for some reason, you cannot or don't want to use a decorator, you can also call the decorator with the function as an argument:importmainpydefmain():...mainpy.main(main)External LibrariesClickWithclickyou can simply add the decorator as usual, as long as you keep in mind that it has to be the first decorator (i.e. above the@click.command()):importclickimportmainpy@mainpy.main@click.command()defclick_command():click.echo('Hello from click_command')If you want to use@click.groupyou probably don't want to decorate the group because the decorator will immediately execute. In those cases you probably want to move themainpy.main(...)execution to the bottom of the file:importclickimportmainpy@click.group()defgroup():...@group.command()defcommand():...mainpy.main(group)TyperWhen usingtyperyou also need to use the regular call instead of the decorator:importtyperimportmainpyapp=typer.Typer()@app.command()defcommand():typer.echo('typer.Typer()')mainpy.main(app)Automatic uvloop usageIf you haveuvloopinstalled, mainpy
will automatically calluvloop.install()before running your async main
function. This can be disabled by settinguse_uvloop=False, e.g.:@main(use_uvloop=False)asyncdefapp():...Debug modeOptionally, python'sdevelopment modecan be emulated by settingdebug=Truein@main. This will enable thefaulthandler,
configure thewarningsfilter to display all warnings, and activate theasyncio debug mode:@main(debug=True)defapp():...Installationpipinstallmainpyrequires python > 3.7
Package: mainshortcuts
MainShortcutsОписаниеСокращение и упрощение встроенных операций PythonУстановкаДля установки через PIP используйтеpipinstall-UmainshortcutsИспользованиеДля импорта рекомендуется сокращённое названиеimportMainShortcutsasmsВстроенная информация о модулеms.__version__->str# Версия модуляms.__functions__->list# Функции, которые существуют в модулеms.__variables__->list# Переменные, которые существуют в модулеms.__depends__->dict# Обязательные и необязательные зависимостиВыход с кодом ошибкиЗакрывает процесс программы с указанным кодом ошибки# Любой ненулевой код означает ошибкуms.exit()# Выход с кодом 0 (нет ошибки)ms.exit(1)# Выход с кодом 1Очистка терминалаОчищает окно терминала от всего текстаms.clear()# Очистить окно терминалаmc.cls()# То же самое, но с названием из Windows CMDПоддерживается только на Windows и LinuxЗагрузка/сохранение данныхДля удобной загрузки или сохранения данных можно использовать классcfgcfg=ms.cfg("config.json",json_args={"mode":"p"})cfg.load()# Загрузить данныеprint(cfg.data)# Вывести данныеcfg.data={"example":"Пример данных"}# Изменить данныеcfg.save()# Сохранить данныеТип сохранения определяется по расширению, но можно это изменитьcfg=ms.cfg("data",type="pickle")# Использовать Pickle для файла данных# Предупреждение: использование Pickle может быть не безопасным!Чтобы посмотреть поддерживаемые типы сохранения, импортируйте часть модуляfromMainShortcuts.cfgimporttypesprint(", ".join(types))Также можно изменить расположение файла, тип и аргументы во время любой загрузки или сохранения, это не повлияет на обычные настройкиcfg.load("data.toml",toml_args={"encoding":"utf-8"})cfg.save("data.pkl")
Package: maintain-website-tool
maintain-website-toolA tool to make it simpler to maintain a website against the increasing entropy on the web.This tool includes:A link checkerA CLI InterfaceA visualization of the links on a websiteUsage$ python3 -m maintain-website-tool --help
usage: maintain-website-tool [-h] {link} ...

positional arguments:
  {link}
    link      Tools to maintain the links on a website

optional arguments:
  -h, --help  show this help message and exitThis tool always outputs to stdout (with one exception atlink check visualize)
and often takes input from stdin or files. I try to follow UNIX and Linux command
line convention as much as possible and as often as possible.linkToolThis can be used to:Collect a list of all links on your website.Collect latency, status and errors for each link on your website.Format results as CSV, YAML and JSONTake the difference in status, latency and errors between two different checks of a website.Visualize the results as a PyVIS Graph with domains as vertices and links as edges.How to check a website$echo"https://example.org"python3-mmaintain-website-toollink--formatcsvcheck->example.org.csvThelink checkcommand executes a check starting with the websites it receives as a file either from stdin (as in this example) or through some filename. You can even execute checks of multiple sites by providing more than one URI to the check (seperated by newlines).Seepython3 -m maintain-website-tool link check --helpfor more information.Usage$ python3 -m maintain-website-tool link --help
usage: maintain-website-tool link [-h] [--format {csv,yaml,yml,json}] [--in-format {csv,yaml,yml,json}]
                                  [--out-format {csv,yaml,yml,json}]
                                  {check,sort,diff,visualize} ...

positional arguments:
  {check,sort,diff,visualize}
    check               Check all the locations in the locations for their reachability, latency and status
    sort                Sort the results from check according to some options
    diff                Take the difference between two check results
    visualize           Visualize the results of a page as a graph stored in a static HTML.

optional arguments:
  -h, --help            show this help message and exit
  --format {csv,yaml,yml,json}, -f {csv,yaml,yml,json}
                        Format to expect for input and output (is overwritten by in-format and out-format
  --in-format {csv,yaml,yml,json}, -in-f {csv,yaml,yml,json}
                        Format to expect from input only
  --out-format {csv,yaml,yml,json}, -out-f {csv,yaml,yml,json}
                        Format to use for output onlyContributingI want to extend this into a multipurpose tool to help with the maintance of a website.
If you have an idea for other tools to be added, create an issuehere.Social CodingI'm a subscriber to the ideals and principles ofSocial Coding.
Package: maintboot
maintboot runs commands outside of the current OS,with exclusive access to the system and hardware.This can be useful to run maintenance tasks,
like repartitioning, in a controlled environment.Maintboot builds an appliance on the fly from a list
of packages (using supermin).
It then loads the appliance with kexec, bypassing
the bios, and runs the maintenance script in that
new context.Seegithub.com/g2p/maintbootfor installation and usage instructions.
Package: maintenance.py
maintenance.py: Utilities for MaintenanceUsagetodo(fn:Optional[Callable[P,R]]=None)->Callable[P,NoReturn]|NoReturndeprecated(message:Optional[str]=None,*,since:Optional[str]=None,new:Any=None,add_sphinx_directive:bool=False)->Callable[[Callable[P,R]],Callable[P,R]]ParametersmessageOverrides the default warn message.sinceThe version since when the object is deprecated.newThe new object that replaces the deprecated one. This may be
the object itself or its name as a string.add_sphinx_directiveAdds thedeprecated directiveto the beginning of the docstring of the object.Examplesdefnew():return1@deprecated(since="1.2.3.post4",new=new)defold():returnNoneunstable(message:Optional[str]=None,*,until:Optional[str]=None)->Callable[[Callable[P,R]],Callable[P,R]]LinksSource CodePyPI
Package: main-wrapper
Usemain-wrappereither as a command-line script or as a library to makePythonscripts that set up or change some global Python environment and then run another script
within that environment.  It seeks to combine into one library all the gloss and polish
of other Python software that does this, such as usingpython-mwithpdbandprofilein the standard library or thecoveragepackage’s command-lineruncommand.InstallationInstall using any tool for installing standard Python 3 distributions such aspip:$ sudo pip3 install main-wrapperUsageYou may use this package either as a library in your code that needs to wrap another
script or as a command-line script.To use as a library, use the provided decorator to wrap your function that sets up the
global environment you need the script to be run in:import logging
import argparse

import mainwrapper

parser = argparse.ArgumentParser()
parser.add_argument(
    "--level",
    default="INFO",
    help="The level of messages to log at or above",
)

@mainwrapper.wrap_main(parser)
def main(level=parser.get_default("level")):
    """
    As an example, this function will set up logging at level INFO.
    """
    logging.basicConfig(level=getattr(logging, level))The changes to Python’s global execution environment that support running the wrapper
function and the final script are also cleaned up upon completion, so it should be
possible to use this library to execute multiple scripts in the same process as if they
were run independently.See the command-line help for details the options and arguments for using this package
as a command-line script:$ usage: python-main-wrapper [-h] wrapper script

Set up global environment and run another script within, ala pdb, profile, etc..  Both
script arguments may either be a path to a Python script, a Python module or package
to be run in the same manner as Python's `-m` option, or a setuptools
`path.to.import:callable` entry-point.

positional arguments:
  wrapper     A Python script that sets up the environment
  script      The Python script to run within the wrapper's environment

optional arguments:
  -h, --help  show this help message and exitNote that this package usesargparse.ArgumentParser.parse_known_argsunder the hood
and as such be sure to use it’s support for the--convention to separate arguments
and options to be passed to the wrapped script:$ python-main-wrapper site site:_script --help
...
site.py [--user-base] [--user-site]

Without arguments print some useful information
With arguments print the value of USER_BASE and/or USER_SITE separated
by ':'.

Exit codes with --user-base or --user-site:
  0 - user site directory is enabled
  1 - user site directory is disabled by user
  2 - user site directory is disabled by super user
      or for security reasons
 >2 - unknown errorMotivationI found myself writing such wrapper scripts repeatedly over the years and kept
struggling to remember how I did it last time.  I made this package to capture all that
knowledge and to have one place to put improvements as I discover them.
Package: maioffice
Maishu Office package基于python-docx和openpyxl一个简易的操作office套件的库示例：读取word文档frommaiofficeimportworddoc=word.load('sample.docx')替换word文档中的文字doc=word.load('sample.docx')word.replace(doc,'旧的文字','新的文字')读取excel文档frommaiofficeimportexcelworkbook=excel.load('sample.xlsx')
Package: maison
MaisonRead configuration settings from configuration files.MotivationWhen developing apythonpackage, e.g a command-line tool, it can be
helpful to allow the user to set their own configuration options to allow them
to tailor the tool to their needs. These options are typically set in files in
the root of a project directory that uses the tool, for example in apyproject.tomlor an{project_name}.inifile.maisonaims to provide a simple and flexible way to read and validate those
configuration options so that they may be used in the package.FeaturesSupports multiple config files and multiple config filetypes.Optional merging of multiple configs.Optional config validation withpydantic.Caching of config files for quick access.Fully tested and typed.InstallationpipinstallmaisonUsageSuppose the followingpyproject.tomllives somewhere in a project directory:[tool.acme]enable_useful_option=truemaisonexposes aProjectConfigclass to retrieve values from config files
like so:frommaisonimportProjectConfigfrommy_useful_packageimportrun_useful_actionconfig=ProjectConfig(project_name="acme")ifconfig.get_option("enable_useful_option"):run_useful_action()HelpSee thedocumentationfor more details.LicenceMIT
Package: mait-manager
mait: package manager for text adventure games.Installing is by the PIP manager [Linux]pip3 install mait-managerSimilar for [Windows]py -m pip install mait-managerYou invoke mait via CLI by using the following:mait --helpuploading.The above demonstrates how to upload a single file(You can now upload folders in 0.1.5.4v!!!)Uploading.mait uploadCode must be source code! Compiled sources are not allowed!Providing a JSON.{"name":"Donuts!!!","short":"I do donuts","long":"Now this is a long description.","creator":"@Porplax","exec":"python3 donut.py"}A JSON provides the command to compile/or interpret the code &is required.You must put it in the parent directory of your project.
Package: maixcdk-example
maixcdk-example: example component for MaixCDKInstallInstall from source:pip install .Install from pypi:pip install maixcdk-example -USet index url for pip temporarily:pip install -i https://pypi.tuna.tsinghua.edu.cn/simple maixcdk-exampleOr globally set index url for pip:pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simplePublishpip install -U twine

python setup.py sdist
# python setup.py sdist bdist_wheel

twine upload dist/*
Package: maixpy3
MaixPy3MaixPy3 is a Python3 toolkit based oncpython, which simplifies the development of applications on Linux AI edge devices through Python programming.See the wiki.sipeed.com for more informationSupport Jupyter EnvironmentInstallrpyc_ikernelkernel in jupyter notebook & lab to get an IDE that can remotely call Python code, videos, and image streaming.Installationready linux ubuntu20.04 desktopsudoaptupdate&&sudoaptinstalllibjpeg-devgcclibopencv-dev-qq-y&&wgethttp://mirrors.kernel.org/ubuntu/pool/main/libf/libffi/libffi6_3.2.1-8_amd64.deb&&sudoaptinstall./libffi6_3.2.1-8_amd64.deb-qq-y

python3-mpipinstallpybind11maixpy3run this python codefrommaiximportcamera,displaydisplay.show(camera.capture().draw_string(0,0,"hello world!"))DevelopUnderlinux x86_64, usepython3 setup.py build && python3 -m pip install .to complete the linux package construction.
If you need.whlpre-compiled package, please changebuildtobdist_wheel.
For other platforms, take the version ofmaix_v83xas an example, match the Python3 + cross-compilation chain of the corresponding platform, and runpython3.8 setup.py build maix_v83xto complete the construction of the target platform package.Welcome to provide configurations of different platforms toMaixPy3/envs/to adapt to the MaixPy3 environment.PlatformStatusConfigProgressToolchainlinux_pc & RPi_2Bworkinglinux_desktop70%develop.md&maixpy3_build.ymlmaix_v83xworkingmaix_v83x99%v83x_linux_x86_python3.8_toolchainmaix_r329workingmaix_r32999%r329_linux_x86_python3.9_toolchainLicenseCopyright (c) Sipeed Corporation. All rights reserved.Licensed under the MIT license.
Package: majesticseo
majesticseoPython Wrapper around the MajesticSEO APIFree software: MIT licenseDocumentation:https://majesticseo.readthedocs.io.FeaturesTODOCreditsThis package was created withCookiecutterand theaudreyr/cookiecutter-pypackageproject template.History0.0.2 (2017-01-16)Pypi release fix0.0.1 (2017-01-16)First release on PyPI.
Package: majiko
#Installation##Install from PyPIGR_F4Cis available on PyPI. To installGR_F4C, run this command in your terminal:pipinstallGR_F4C##Install from conda-forge`GR_F4C` is also available on conda-forge. If you have Anaconda or Miniconda installed on your computer, you can create a conda Python environment to install `GR_F4C`:condainstall-cdefaults-cconda-forgeGR_F4C##Install from GitHubTo install the development version from GitHub using Git, run the following command in your terminal:
```sh
```
##ColaboratoryColaboratory lets you connect to a local runtime using Jupyter. This allows you to execute code on your local hardware and have access to your local file system.Step 1: Install JupyterInstallJupyteron your local machine.Step 2: Install and enable the jupyter_http_over_ws jupyter extension (one-off)Thejupyter_http_over_wsextension is authored by the Colaboratory team and available onGitHub.pipinstalljupyter_http_over_ws
jupyterserverextensionenable--pyjupyter_http_over_wsStep 3: Start server and authenticateNew notebook servers are started normally, though you will need to set a flag to explicitly trust WebSocket connections from the Colaboratory frontend.jupyternotebook\--NotebookApp.allow_origin='https://colab.research.google.com'\--port=8888\--NotebookApp.port_retries=0Once the server has started, it will print a message with the initial backend URL used for authentication. Make a copy of this URL as you'll need to provide this in the next step.Step 4: Connect to the local runtimeIn Colaboratory, click the 'Connect' button and select 'Connect to local runtime…'. Enter the URL from the previous step in the dialogue that appears and click the 'Connect' button. After this, you should now be connected to your local runtime.##Upgrade GR_F4CIf you have installedGR_F4Cbefore and want to upgrade to the latest version, you can run the following command in your terminal:pipinstall-UGR_F4CIf you use conda, you can updateGR_F4Cto the latest version by running the following command in your terminal:condaupdateGR_F4C