Saravanan666/pypi-org huggingface dataset:
Package: py2loggly
Py2Loggly is a proxy server listening on UDP and TCP for messages coming
from python’s UDP/TCP logging handler, it will forward all these
messages tologgly.com.InstallationInstall dependenciespy2loggly only depends ongeventInstall py2logglyFrom sources$ python setup.py installFrom Pypi$ pip install py2logglyUsageStarting the serverThe only required parameter is--loggly-tokento provide your loggly
TOKEN.$ py2loggly --loggly-token $LOGGLY_TOKENThe default TCP port is 9020 and the default UDP port is 9021.Parametersusage: py2loggly [-h] [-v] [--bind-ip IP] [--tcp-port PORT] [--udp-port PORT]
                 [--fqdn] [--hostname HOSTNAME] --loggly-token TOKEN
                 [--tags TAG1 TAG2 [TAG1 TAG2 ...]]

Proxy for python UDP/TCP logging to loggly

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         show program's version number and exit
  --bind-ip IP          IP address to listen on
  --tcp-port PORT       TCP port to listen on
  --udp-port PORT       UDP port to listen on
  --fqdn                Use the fully qualified domain name
  --hostname HOSTNAME   Use the provided hostname instead of guessing it.
  --loggly-token TOKEN  the loggly TOKEN.
  --tags TAG1 TAG2 [TAG1 TAG2 ...]
                        Tags for the event messageSending messages to py2logglyYou can either useSockerHandlerorDatagramHandlerfrom
python’slogging.handlersThe biggest advantage to useDatagramHandleris that logging won’t
slow down your application and if py2loggly is not running, it won’t
impact your application.So the recommended setup is to run py2loggly locally on each server and
use theDatadgramHandler.Exampleimport logging, logging.handlers

rootLogger = logging.getLogger('')
rootLogger.setLevel(logging.DEBUG)
socketHandler = logging.handlers.SocketHandler('localhost',
                    logging.handlers.DEFAULT_TCP_LOGGING_PORT)
# don't bother with a formatter, since a socket handler sends the event as
# an unformatted pickle
rootLogger.addHandler(socketHandler)

# Now, we can log to the root logger, or any other logger. First the root...
logging.info('Jackdaws love my big sphinx of quartz.')LicenseMIT
Package: py2many
py2many: Python to many CLike languages transpilerWhyPython is popular, easy to program in, but has poor runtime
performance. We can fix that by transpiling a subset of the language
into a more performant, statically typed language.A second benefit is security. Writing security sensitive
code in a low level language like C is error prone and could
lead to privilege escalation. Specialized languages such aswuffsexist to address this use
case. py2many can be a more general purpose solution to the problem
where you can verify the source via unit tests before you transpile.A third potential use case is to accelerate python code by transpiling
it into anextensionSwift and Kotlin dominate the mobile app development workflow. However, there is
no one solution that works well for lower level libraries where there is desire
to share code between platforms. Kotlin Mobile Multiplatform (KMM) is a player
in this place, but it hasn't really caught on. py2many provides an alternative.Lastly, it's a great educational tool to learn a new language by implementing
a backend for your favorite language.StatusRust is the language where the focus of development has been.C++14 is historically the first language to be supported.
C++17 is now required for some features.Preliminary support exists for Julia, Kotlin, Nim, Go and Dart.py2many can also emit Python 3 code that includes inferred type annotations,
and revisions to the syntax intended to simplify parsing of the code.HistoryBased on Julian Konchunas' pyrshttp://github.com/konchunas/pyrsBased on Lukas Martinelli Py14
(https://github.com/lukasmartinelli/py14) and Py14/python-3
(https://github.com/ProgVal/py14/tree/python-3) branch by Valentin
Lorentz.ExampleOriginal Python version.deffib(i:int)->int:ifi==0ori==1:return1returnfib(i-1)+fib(i-2)Transpiled Rust code:fnfib(i:i32)->i32{ifi==0||i==1{return1;}return(fib((i-1))+fib((i-2)));}Transpiled code for other languages:https://github.com/adsharma/py2many/tree/main/tests/expected(fib*)Trying it outRequirements:Python 3.8+Local installation:./setup.py install --user  # installs to $HOME/.localORsudo ./setup.py install  # installs systemwideAdd the py2many script to your $PATH and run:Transpiling:py2many --cpp=1 tests/cases/fib.py
py2many --rust=1 tests/cases/fib.py
py2many --julia=1 tests/cases/fib.py
py2many --kotlin=1 tests/cases/fib.py
py2many --nim=1 tests/cases/fib.py
py2many --dart=1 tests/cases/fib.py
py2many --go=1 tests/cases/fib.pyCompiling:clang tests/cases/fib.cpp
rustc tests/cases/fib.rs
...Many of the transpilers rely on a language specific formatter to parse the output and reformat it.
Typically this is the most prominent formatter for the language, such asrustfmtfor Rust.Most of the transpilers also rely on external libraries to provide bridges from
Python constructs to the target language.The steps to install these external libraries can be found in.github/workflows/main.yml.ContributingSeeCONTRIBUTING.mdfor how to test your changes and contribute to this project.
Package: py2md
py2mdRun python code in Jupyter to generate markdown reports.Usage:py2md test_py2md.pyThis will then run Jupyter and generate a md file output with associated images.Debug Usage:py2md test_py2md.py -debugThis will also print out all Jupyter output to see if anything is missing from the output.No Code, No Cell Headers and inline images Usage:py2md test_py2md.py -nocode -nohead -inlineThis will hide the python code block as well as cell headers and all images will be part of the markdown file as html code.
Package: py2mojo
py2mojoAutomated Python to Mojo code translationA tool to automatically convert Python code to the newMojo programming language.Installationpipinstallpy2mojoUsageYou can read the usage by runningpy2mojo --help:❯py2mojo--help
usage:py2mojo[-h][--inplace][--extension{mojo,🔥}][--convert-def-to-fn|--no-convert-def-to-fn][--convert-class-to-struct|--no-convert-class-to-struct][--float-precision{32,64}]filenames[filenames...]positionalarguments:filenames

options:-h,--helpshowthishelpmessageandexit--inplaceRewritethefileinplace--extension{mojo,🔥}Fileextensionofthegeneratedfiles--convert-def-to-fn,--no-convert-def-to-fn--convert-class-to-struct,--no-convert-class-to-struct--float-precision{32,64}Examples:❯py2mojomyfile.py❯py2mojomypackage/*.py⚠ DisclaimerPlease be aware that the Mojo programming language is still in its nascent stages of development. As with any young language, there might be frequent updates, changes, and unforeseen quirks in its syntax and behavior. There will probably be instances where the conversion might not work and may require manual adjustments.So, consider this tool as experimental. Please do not trust the generated code and double-check it.Implementation detailsThis uses a similar approach to thepyupgradetool, using the AST parser to analyze the Python code and replace some parts of it with the equivalent Mojo code.As Mojo is a superset of Python, non-replaced logic should be also a valid Mojo code.ContributingHow to install it locallyFork the repositoryClone your fork:gitclonegit@github.com:youraccount/py2mojo.gitInstall it locally:cd py2mojo
pip install -e .
Package: py2n
Py2NAsynchronous library to control2N Telekomunikace® devicesThis library is under developmentRequirementsPython >= 3.9aiohttpInstallpipinstallpy2nExamplefrompy2nimportPy2NDevice,Py2NConnectionDataimportasyncioimportaiohttpasyncdefmain():"""Run with aiohttp ClientSession."""asyncwithaiohttp.ClientSession()assession:awaitrun(session)asyncdefrun(websession):"""Use library."""device=awaitPy2NDevice.create(websession,Py2NConnectionData(host="192.168.1.69",username="username",password="password",),)awaitdevice.restart()asyncio.run(main())
Package: py2nb
py2nb:convert python scripts to jupyter notebooksAuthor:Will HandleyVersion:1.0.0Homepage:https://github.com/williamjameshandley/py2nbDescriptionpy2nbis a python package for converting python scripts with minimal
markdown to jupyter notebooks.Markdown cells are rendered from comments beginning with#|, splits between
code cells are created by comment lines beginning with#-nb2pyconverts from jupyter notebooks to pythonInstallationUsers can install using pip:pipinstallpy2nbfrom source:gitclonehttps://github.com/williamjameshandley/py2nbcdpy2nbpythonsetup.pyinstallor for those onArch linuxit is
available on theAURExampleIf one has a script namedexample.pycontaining the code:#| # Testing ipython notebook#| This is designed to demonstrate a simple script that converts a script into#| a jupyter notebook with a simple additional markdown format.#|#| Code by default will be put into code cells#|#| * To make a markdown cell, prefix the comment line with with '#|' or '# |'#| * To split a code cell, add a line beginning with '#-' or '# -'importmatplotlib.pyplotaspltimportnumpy%matplotlibinline#| Here is a markdown cell.#| Maths is also possible: $A=B$#|#| There are code cells below, split by `'#-'`:# | Here is another markdown cellx=numpy.random.rand(5)#-------------------------------y=numpy.random.rand(4)z=numpy.random.rand(3)#| Here are some plotsx=numpy.linspace(-2,2,1000)y=x**3fig,ax=plt.subplots()ax.plot(x,y)# -------------------------------# | Here is another plotx=np.linspace(-np.pi,np.pi,201)fig,ax=plt.subplots()ax.plot(x,np.sin(x))then runningpy2nbexample.pyproduces the notebookexample.ipynbTo doevaluation option for script producedvim syntax highlighting for markdown code blocks
Package: py2neo
**Please now consider this project to be EOL. There will be no more updates. It is recommended to use the official Neo4j drivers instead.**The version history of py2neo on PyPI got lost.
If you need an older version, you can install [py2neo-history](https://pypi.org/project/py2neo-history/) instead.Py2neois a client library and toolkit for working withNeo4jfrom withinPythonapplications.
The library supports both Bolt and HTTP and provides a high level API, an OGM, admin tools, a Cypher lexer for Pygments, and many other bells and whistles.Command line tooling has been removed from the library in py2neo 2021.2.
This functionality now exists in the separateipy2neoproject.As of version 2021.1, py2neo contains full support for routing, as exposed by a Neo4j cluster.
This can be enabled using aneo4j://...URI or by passingrouting=Trueto aGraphconstructor.Installation & CompatibilityTo install the latest release of py2neo, simply use:$pipinstallpy2neoThe following versions of Python and Neo4j (all editions) are supported:Neo4jPython 3.5+Python 2.74.44.34.24.14.03.53.4Note that py2neo is developed and tested underLinuxusing standard CPython distributions.
While other operating systems and Python distributions may work, support for these is not available.Quick ExampleTo run a query against a local database is straightforward:>>> from py2neo import Graph
>>> graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"))
>>> graph.run("UNWIND range(1, 3) AS n RETURN n, n * n as n_sq")
   n | n_sq
-----|------
   1 |    1
   2 |    4
   3 |    9Releases & VersioningAs of 2020, py2neo has switched toCalendar Versioning, using a scheme ofYYYY.N.M.
Here,Nis an incrementing zero-based number for each year, andMis a revision within that version (also zero-based).No compatibility guarantees are given between versions, but as a general rule, a change inMshould require little-to-no work within client applications,
whereas a change inNmay require some work. A change to the year is likely to require a more significant amount of work to upgrade.Note that py2neo is developed on a rolling basis, so patches are not made to old versions.
Users will instead need to install the latest release to adopt bug fixes.MoreFor more information, read thehandbook.
Package: py2neo-archive
This is a copy of the py2neo package to restore the version history that got deleted.
It’s not possible to re-upload a deleted version of a package to PyPI.
So if you rely on, for example,py2neo ~= 4.1.0in your project, you can simply switch topy2neo-archive ~= 4.1.0.
If your project works with py2neo 2021.2.3 or above, you can keep usingpy2neoas usual.Note that this project will not get any updates past version 2021.2.3.Py2neoPy2neois a client library and toolkit for working withNeo4jfrom withinPythonapplications.
The library supports both Bolt and HTTP and provides a high level API, an OGM, admin tools, a Cypher lexer for Pygments, and many other bells and whistles.Command line tooling has been removed from the library in py2neo 2021.2.
This functionality now exists in the separateipy2neoproject.As of version 2021.1, py2neo contains full support for routing, as exposed by a Neo4j cluster.
This can be enabled using aneo4j://...URI or by passingrouting=Trueto aGraphconstructor.Installation & CompatibilityTo install the latest release of py2neo, simply use:$pipinstallpy2neoThe following versions of Python and Neo4j (all editions) are supported:Neo4jPython 3.5+Python 2.74.34.24.14.03.53.4Note that py2neo is developed and tested underLinuxusing standard CPython distributions.
While other operating systems and Python distributions may work, support for these is not available.Quick ExampleTo run a query against a local database is straightforward:>>> from py2neo import Graph
>>> graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"))
>>> graph.run("UNWIND range(1, 3) AS n RETURN n, n * n as n_sq")
   n | n_sq
-----|------
   1 |    1
   2 |    4
   3 |    9Releases & VersioningAs of 2020, py2neo has switched toCalendar Versioning, using a scheme ofYYYY.N.M.
Here,Nis an incrementing zero-based number for each year, andMis a revision within that version (also zero-based).No compatibility guarantees are given between versions, but as a general rule, a change inMshould require little-to-no work within client applications,
whereas a change inNmay require some work. A change to the year is likely to require a more significant amount of work to upgrade.Note that py2neo is developed on a rolling basis, so patches are not made to old versions.
Users will instead need to install the latest release to adopt bug fixes.MoreFor more information, read thehandbook.
Package: py2neoglo4035
Py2neois a client library and toolkit for working withNeo4jfrom withinPythonapplications.
The library supports both Bolt and HTTP and provides a high level API, an OGM, admin tools, a Cypher lexer for Pygments, and many other bells and whistles.Command line tooling has been removed from the library in py2neo 2021.2.
This functionality now exists in the separateipy2neoproject.As of version 2021.1, py2neo contains full support for routing, as exposed by a Neo4j cluster.
This can be enabled using aneo4j://...URI or by passingrouting=Trueto aGraphconstructor.Installation & CompatibilityTo install the latest release of py2neo, simply use:$pipinstallpy2neoThe following versions of Python and Neo4j (all editions) are supported:Neo4jPython 3.5+Python 2.74.44.34.24.14.03.53.4Note that py2neo is developed and tested underLinuxusing standard CPython distributions.
While other operating systems and Python distributions may work, support for these is not available.Quick ExampleTo run a query against a local database is straightforward:>>> from py2neo import Graph
>>> graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"))
>>> graph.run("UNWIND range(1, 3) AS n RETURN n, n * n as n_sq")
   n | n_sq
-----|------
   1 |    1
   2 |    4
   3 |    9Releases & VersioningAs of 2020, py2neo has switched toCalendar Versioning, using a scheme ofYYYY.N.M.
Here,Nis an incrementing zero-based number for each year, andMis a revision within that version (also zero-based).No compatibility guarantees are given between versions, but as a general rule, a change inMshould require little-to-no work within client applications,
whereas a change inNmay require some work. A change to the year is likely to require a more significant amount of work to upgrade.Note that py2neo is developed on a rolling basis, so patches are not made to old versions.
Users will instead need to install the latest release to adopt bug fixes.MoreFor more information, read thehandbook.
Package: py2neo-history
This is a copy of the py2neo package to restore the version history that got deleted.
It’s not possible to re-upload a deleted version of a package to PyPI.
So if you rely on, for example,py2neo ~= 4.1.0in your project, you can simply switch topy2neo-history ~= 4.1.0.
If your project works with py2neo 2021.2.3 or above, you can keep usingpy2neoas usual.Note that this project will not get any updates past version 2021.2.3.Py2neoPy2neois a client library and toolkit for working withNeo4jfrom withinPythonapplications.
The library supports both Bolt and HTTP and provides a high level API, an OGM, admin tools, a Cypher lexer for Pygments, and many other bells and whistles.Command line tooling has been removed from the library in py2neo 2021.2.
This functionality now exists in the separateipy2neoproject.As of version 2021.1, py2neo contains full support for routing, as exposed by a Neo4j cluster.
This can be enabled using aneo4j://...URI or by passingrouting=Trueto aGraphconstructor.Installation & CompatibilityTo install the latest release of py2neo, simply use:$pipinstallpy2neoThe following versions of Python and Neo4j (all editions) are supported:Neo4jPython 3.5+Python 2.74.34.24.14.03.53.4Note that py2neo is developed and tested underLinuxusing standard CPython distributions.
While other operating systems and Python distributions may work, support for these is not available.Quick ExampleTo run a query against a local database is straightforward:>>> from py2neo import Graph
>>> graph = Graph("bolt://localhost:7687", auth=("neo4j", "password"))
>>> graph.run("UNWIND range(1, 3) AS n RETURN n, n * n as n_sq")
   n | n_sq
-----|------
   1 |    1
   2 |    4
   3 |    9Releases & VersioningAs of 2020, py2neo has switched toCalendar Versioning, using a scheme ofYYYY.N.M.
Here,Nis an incrementing zero-based number for each year, andMis a revision within that version (also zero-based).No compatibility guarantees are given between versions, but as a general rule, a change inMshould require little-to-no work within client applications,
whereas a change inNmay require some work. A change to the year is likely to require a more significant amount of work to upgrade.Note that py2neo is developed on a rolling basis, so patches are not made to old versions.
Users will instead need to install the latest release to adopt bug fixes.MoreFor more information, read thehandbook.
Package: py2of
Ultimate PyFoamhttps://doc.cfd.direct/openfoam/user-guide-v8/basic-file-formatFeaturesTODORequirementsTODOInstallationYou can installUltimate PyFoamviapipfromPyPI:$pipinstallpy2ofUsagePlease see theCommand-line Referencefor details.ContributingContributions are very welcome.
To learn more, see theContributor Guide.LicenseDistributed under the terms of theMIT license,Ultimate PyFoamis free and open source software.IssuesIf you encounter any problems,
pleasefile an issuealong with a detailed description.CreditsThis project was generated from@cjolowicz'sHypermodern Python Cookiecuttertemplate.Python virtual environment cheatsheetWhichpython/pipam I using?which python
which pipList python packages installed usingpippip listUsevenvto create new virtual environment called for example test_env in the current working directorypython -m venv test_envStart using test_env virtual environmentsource test_env/bin/activatewhich pythonshould now show you the path to /something/test_env/bin/pythonIf you now do for examplepip install numpy,numpywill be installed only into the test_env virtual environment.pip listwill show that onlypip,setuptoolsandnumpyare installed.Stop working in the current virtual environmentdeactivateInstall another python version, for example 3.11.0pyenv install 3.11.0List installed python versionspyenv versionsStart using python 3.11.0pyenv local 3.11.0Commandpythonshould now open apython shellon version 3.11.0Now you should be able to create a virtual environment with this new python version :)Poetryis a tool for dependency management and packaging in Python. Moreover, it can create it's own virtual environments, which makes your life easier.
If you're in a folder of a project which usesPoetry(for example the Claudio's template we're using is such a project), you can find out
which virtual environment this project is using bypoetry env infoIf you want to start using this environment in your terminal, you don't have to do the wholesource /something/activatething anymore, you can just typepoetry shelland the environment will be activated.If you want to update a package, or a python version, you can do so manually in a filepyproject.toml. For example, you might rewrite python version from ^3.7 to ^3.8.
If you update thepyproject.tomllike this, you must updatepoetry.lockby doingpoetry lockInpoetry.lockyou can find all the packages and versions which your project is using. In order to add a new package, for examplenumpy, typepoetry add numpyIf you don't know which command to use, or what all the possibilities offered by the tool you are using are, there are multiple sources where to look.You can always try to run the tool with no arguments like this (not justpoetry):poetrywhich usually outputs some information about usage and a list of available commands.If that is not enough, there is usually some kind of official documentation which is only one google search away:https://python-poetry.org/docs/basic-usage/In case of desperation, you might want to try going to Stack Overflowhttps://stackoverflow.com/.
Package: py2opencl
=========py2OpenCL=========OpenCL is a powerful means of applying the same simple function (a "kernel") tolarge arrays of similar data.py2OpenCL uses Python's AST module to convert a Python function to an OpenCLkernel (written in a C-like language), then uses Andreas Klöckner's PyOpenCLmodule to submit the kernel to the GPU.  It is not meant to convert arbitraryPython code to OpenCL, as that would be impossible.  Instead, it is limited tosimple Python lambdas and functions containing only simple mathematical operationsand built-in OpenCL functions.Examples========The following code returns a new numpy array holding the results of the lambda function:import numpy as npfrom py2opencl import Py2OpenCL, Fpy2 = Py2OpenCL( lambda x: -x if x < 0.5 else F.sin(x) )a = py2.map( np.random.rand(10000000) )print py2.kernel>>  __kernel void sum( __global const float *x, __global float *res_g) {>>     int gid = get_global_id(0);>>     res_g[gid] = (((x[gid] < 0.5)) ? -x[gid] : sin( x[gid] ));>>  }More complex functions are supported, though there are many constraints.  The following functionaverages the pixels of an image:import numpy as npfrom py2opencl import Py2OpenCL, Fimport Imageimg_path = 'py2opencl/test/Lenna.png'img = np.array( Image.open( img_path ).convert('RGB') )def avg( x, y, z, dest, src ):# note that the C code produced will handle wrapping automaticallyright = src[ x+1, y, z ]left = src[ x-1, y, z ]up = src[ x, y-1, z ]down = src[ x, y+1, z ]dest[x,y,z] = (right / 4) + (left / 4) + (up / 4) + (down / 4)dest = Py2OpenCL( avg ).map( img )Image.fromarray( dest, 'RGB').save('foo.png')OpenCL Drivers==============Py2OpenCL should work out-of-the-box on Mac OS X.  If you're on Linux and don't have a fancy GPU,I'd suggest AMD's ICD, found `here http://developer.amd.com/tools-and-sdks/opencl-zone/opencl-tools-sdks/amd-accelerated-parallel-processing-app-sdk/`(as of 26 Jul 2014).  It supports modern Intel CPU's, no GPU required.  (Presumably it supports AMD CPUs as well.)As of this writing, Intel's beignet driver appears to be broken on Ubuntu 14.04.Tested Platforms================- NVIDIA CUDA / nvidia-opencl-icd-331 on Ubuntu 14.04- AMD Accelerated Parallel Processing (AMD-APP-SDK-v2.9) on Intel Core i7-3610QM, Ubuntu 14.04- Apple's OpenCL drivers for the Intel Core i5-4258U, OS X 10.9- Apple's OpenCL drivers for the Intel "Iris" (Intel HD 4000), OS X 10.9TODO====- support while loops and C-style for loops (ie, 'for i in range(n)')- performance writeup