Saravanan666/pypi-org huggingface dataset:
Package: py404
py404py404 is a CLI tool for finding deadlinks on a website. It checks for 404s on all kinds of links: hrefs, imgs, scripts in , etc. It was a fun way to learn some asyncio.InstallationUse the package managerpipto install py404. It requires Python >=3.9.$pipinstallpy404UsageTypepy404followed by the URL you want to check. Deadlinks and their location are saved to a CSV file.$py404https://example.comLicenseMade byWilland released under theMITLicense
Package: py416
py416What this package is and hopes to achieveThis is a collection of various functions, mostly for my own use in writing scripts for work and personal projects. I built this for the following reasons:Learn more advanced Python conceptsConvenience of installing through pipGreatly cut down on the amount copy-pasting of code between projectsProduce something that looks professional and can be used by othersI abhor Windows' backslashesThe bulk of this package deals with filesystem manipulation as that's what I need it for most. A lot of these functions are just wrappers for basic os and shutil functions with some extra safety, configurability, and normalization.This is built in Python 3.8 because it's the latest version available on Windows 8, which is required for my work. This is automatically tested on macOS, Ubuntu, and Windows with Python versions 3.8-3.12. I have no plans to test on older versions, nor to add new features that don't work in 3.8, such as dict union operators (3.9), match (3.10), or toml (3.11).
Package: py420chan
The Bibliotheca Anonoma’scomplete Python Wrapper for the 420chan API.Uses requests, respects if-modified-since headers on updating threads.
Caches thread objects. Fun stuff.An absolute must if you want to interface with or scrape from 4chan,
using a Python script.Hosted DocumentationGithub RepositoryYou can install this librarystraight from
PyPiwith:pip install py420chanGetting HelpIf you want help, or you have some trouble using this library, our primary IRC channel
is#bibanon on irc.rizon.net. Simply head
in there and talk to dan or antonizoon. Otherwise, you can put a issue on ourGithub
Issue Trackerand we’ll respond as soon as
we can!Usageimportpy420channom=py420chan.Board('nom')thread=nom.get_thread(423491034)print(thread)forfileinthread.file_objects():print(file.file_url)# In a while...print("I fetched",thread.update(),"new replies.")DocumentationThis library mostly extends the classes ofBASC-py4chan, but has some differences. See the py8chan documentation for more info.py420chan DocumentationNotice that some functions are not implemented in the 420chan API. These functions willraise an AttributeError when used.omitted_posts - The lack of this feature forces us to ditchexpand()and useupdate()instead.omitted_images - Because theomittedattributes are missing, thereprno longer reports them.filedeleted - The image will just 404 if it was deleted.spoilerimages - No total of all images in the thread.bumplimitLicenseDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                   Version 2, December 2004

Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>

Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.
Package: py4ai-core
py4ai coreA Python library defining data structures optimized for machine learning pipelinesWhat is it ?py4ai-coreis a Python package with modular design that provides powerful abstractions to build data
ingestion pipelines and run end to end machine learning pipelines.
The library offers lightweight object-oriented interface to MongoDB as well as Pandas based data structures.
The aim of the library is to provide extensive support for developing machine learning based applications
with a focus on practicing clean code and modular design.FeaturesSome cool features that we are proud to mention are:LoggingconfigFromFiles: utility function to configure loggers according to configuration files, giving options to capture warnings and to define which logger to use to capture errors.WithLogging: Base class setting up theloggerproperty defining a logger named according to the class to be used in descendant classes.ConfigurationsOffers a unified framework to parse and store yaml configuration files:get_confs_in_path: Retrieve all configuration files from system path, with given extension.merge_confs : merge given configuration files.BaseConfig : Basic configuration class. This class implements utility methods to retrieve configuration sub-levels and values. An instance of this class can be updated merging other instances of the same class.Some pre-implemented configuration classes for some common use cases like: FileSystemConfig, LoggingConfig, MongoConfig and many more.InstallationFrom pypi serverpip install py4ai-coreFrom sourcegit clone https://github.com/NicolaDonelli/py4ai-core
cd py4ai-core
make installTestsmake testsChecksTo run predefined checks (unit-tests, linting checks, formatting checks and static typing checks):make checksHow to contribute ?We are very much willing to welcome any kind of contribution whether it is bug report, bug fixes, contributions to the
existing codebase or improving the documentation.Where to start ?Please look at theGithub issues tabto start working on open
issuesContributing to py4ai-corePlease make sure the general guidelines for contributing to the code base are respectedForkthe py4ai-core repository.Create/choose an issue to work on in theGithub issues page.Create a new branchto work on the issue.Commit your changes and run the tests to make sure the changes do not break any test.Open a Pull Request on Github referencing the issue.Once the PR is approved, the maintainers will merge it on the main branch.
Package: py4byte
py4byteLibrary for using 4byte and blind-decoding of transactions and eventsFunctionssignatures(kwargs)Resolve signatures using the 4byte directory.ArgumentsThese are the same arguments for the4byte.directory REST APItext_signaturetext_signature__iexacttext_signature__containstext_signature__icontainstext_signature__startswithtext_signature__istartswithtext_signature__endswithtext_signature__iendswithhex_signaturereceipt_events(receipt)Given a Web3 or JSON-like transaction receipt, attempt to decode events to a text signature.transaction_call(transaction)Given a Web3 or JSON-like transaction, attempt to decode the function signature of a contract call.
Package: py4cytoscape
py4cytoscapeThis project recreates theR-basedRCy3Cytoscape Automation libraryas a Python package. The idea is to allow a Cytoscape workflow to be written in one language (R or Python) and translated to another language (Python or R) without having to learn different Cytoscape interfaces. The previous Cytoscape Python interface (Py2Cytoscape) has different features than the Cytoscape R library, and is therefore deprecated.Additionally, this project attempts to maintain the samefunction signatures, return values, function implementation and module structure as the RCy3, thereby enabling smooth maintenance and evolution of bothRCy3andpy4cytoscape.This project uses PyCharm because of its excellent code management and debugging features.Over time, py4cytoscape functionality should match RCy3 functionality. Once that occurs, novel Py2Cytoscape functions will be added to both as appropriate. The official Automation API definition met by both RCy3 and py4cytoscape ishere. The API is versioned, and you can see which API version RCy3 or py4cytoscape implements by executing the cytoscape_version_info() or cytoscapeVersionInfo() function.An overall scorecard comparing Py2Cytoscape,RCy3andpy4cytoscapecan be foundhere. Pay close attention to columns E and F, which show how much of RCy3 is reflected in py4cytoscape.DocumentationTo understand the API structure and see calling examples, see thepy4cytoscapedocumentation.Quick StartThe quickest way to seepy4cytoscapein action is via theOverview of py4cytoscapeJupyter-based workflow.You can avoid installing Python orpy4cytoscapeby clicking on theOpen in Colabbutton, and running the Python workflow in the Google Cloud, though you will still have to install Cytoscape on your workstation.You can follow the notes in the Jupyter Notebook as the workflow automates Cytoscape execution.How to install and testFor an explanation ofpy4cytoscapeinstallation and testing, see theINSTALL.rstfile.How to learn more aboutpy4cytoscapeA broad set of Cytoscape Automation samples and tutorials is available on theCytoscape Automation Wiki.How to configure loggingpy4cytoscapelogging is based on the Pythonloggingpackage, which is based on the Javaloggingframework.For an explanation of log configuration and use, see theLOGGING.rstfile.How to build and releasepy4cytoscapemaintainers can build a new release using the process inBUILDING.rst.How to testpy4cytoscapehas extensive test suites. Maintainers can learn more about testing in theTESTING.rstfile.Licensepy4cytoscapeis released under the MIT License (seeLICENSE.rstfile):Copyright (c) 2018-2022 The Cytoscape Consortium
    Barry Demchak <bdemchak@ucsd.edu>
Package: py4d
py4d is a little wrapper using ctypes around 4dopen.dll that allow python
communicate with 4th Dimension ACI database server (http://www.4d.com). Actually
it has been make for 4d 6.5.4 server using 4dopen.dll 6.0.6 Maybe it can work
with other 4dopen version. It requires the 4dopen.dll and work only on Windowsit also has a builtin xmlrpc server to expose function to the rest of the world
(so you can call it from linux ;) ) and a sample code to use the xmlrpc server
as windows service.
Package: py4D-browser
Thepy4DSTEMGUIThis repository hosts thepyqtbased graphical 4D--STEM data browser that was originally part ofpy4DSTEMuntil version 0.13.11.InstallationThe GUI is available on PyPI and conda-forge:pip install py4D-browserconda install -c conda-forge py4d-browserUsageRunpy4DGUIin your terminal to open the GUI. Then just drag and drop a 4D-STEM dataset into the window!ControlsMove the virtual detector and the real-space selector using the mouse or using the keyboard shortcuts: WASD moves the detector and IJKL moves the selector, and holding down shift moves 5 pixels at a time.Auto scaling of both views is on by default. Press the "Autoscale" buttons in the bottom right to disable. Press either button to apply automatic scaling once, or Shift + click to lock autoscaling back on.Different shapes of virtual detector are available in the "Detector Shape" menu, and different detector responses are available in the "Detector Response" menu.The information in the bottom bar contains the details of the virtual detector used to generate the images, and can be entered into py4DSTEM to generate the same image.The FFT pane can be switched between displaying the FFT of the virtual image and displaying theexit wave power cepstrum.Virtual images can be exported either as the scaled and clipped displays shown in the GUI or as raw data. The exact datatype stored in the raw TIFF image depends on both the datatype of the dataset and the type of virtual image being displayed (in particular, integer datatypes are converted internally to floating point to prevent overflows when generating any synthesized virtual images).If theEMPAD-G2 Raw Readeris installed in the same environment, an extra menu will appear that allows the concatenated binary format data to be background subtracted and calibrated in the GUI. You can also save the calibrated data as an HDF5 file for later analysis.The keyboard map in the Help menu was made usingthis tooland the map file is in the top level of this repo.Aboutpy4DSTEMis an open source set of python tools for processing and analysis of four-dimensional scanning transmission electron microscopy (4D-STEM) data. Additional information:Our open access py4DSTEM publication in Microscopy and Microanalysisdescribing this project and demonstrating a variety of applications.The py4DSTEM documentation pages.Our open access 4D-STEM review in Microscopy and Microanalysisdescribing this project and demonstrating a variety of applications.LicenseGNU GPLv3py4DSTEMis open source software distributed under a GPLv3 license.
It is free to use, alter, or build on, provided that any work derived frompy4DSTEMis also kept free and open.
Package: py4etrics
What Is This Module ForThis module is forTruncated RegressionTobit ModelHeckit ModelPythonで学ぶ入門計量経済学explains how to use it in Japanese.
Or click itsGoogle translated version in English.How to Useimport py4etricsHow to Installpip install py4etricsorpip install git+https://github.com/spring-haru/py4etrics.gitorgit clone https://github.com/spring-haru/py4etrics.git
cd py4etrics
pip install .ThanksThe code is heavily inspired bystatsmodels.
Package: py4geo
Py4GeoIs still experimental...DescriptionThis module implements aDALdatabase model
inspired to the OpenstreetMap database, optimized for storing informations, with
a very flexible json structure able to host and model any kind of data.It supports OpenstreetMap and geojson as main data structures for import.System requirementsPostgreSQLPostGISOptional requirementsH3Pgh3Install notesInstallpipinstallpy4geoUse Py4geo in custompy4webapplicationsPy4web applications are nothing more than nativepython modules,
Py4geo tools can be imported from them and for integration you just need to
overwrite few basic setting variables.SetupDefine in your application settings subsequent variables with values adapted to your needs:# db settings# WARNING! Commented out variables are optional.# DB_FOLDER =DB_URI="postgres://<PG user>:<password>@<host name>/<db name>"# DB_POOL_SIZE = 10# DB_MIGRATE = True # Actually True is the default if not specified.# MATERIALIZED_VIEWS = []Create your own setup script (setup.py) in therootof your application:from.importsettingsfrompy4geoimportsettingsaspy4geo_settingspy4geo_settings.DB_URI=settings.DB_URIpy4geo_settings.DB_FOLDER=settings.DB_FOLDERpy4geo_settings.MATERIALIZED_VIEWS=settings.MATERIALIZED_VIEWSfrompy4geo.setupimportinitdbinitdb()# WARNING! These imports must follow the call of the previous initdb function.frompy4geo.setup.setupimportmodelsetup# Importing the model defined tables are automatically createdfrompy4geo.modelsimportdb# This will create necessary geometry views.modelsetup()Go to yourappsfolder and run:cdpath/to/apps
python-m<yourAppName>.setupWARNINGthe script will ask for necessary PostgreSQL power user credentials that you
must know.Share your py4web/web2py application database with Py4geoYou have two optionsOverwrite the settings variableDB_URIwith avalid PostgreSQL connection stringto a PostGIS dtabase.Overwrite thedbvariable in thecommonmodule with a DAL object connected
to a PostGIS database.ResourcesHomeProjectWikiDev notesPackaging Python Projects
Package: py4hy
Python interface to Helsingin yliopistoCollection of tools to collect information from various University of Helsinki data sources via their public (unofficial) APIs.People searchThis pulls data from thePeople Finder.from pyhy import people
matti = people.search('Matti Nelimarkka')
print( "Call Matti", matti['mobileNumber'] )
print( "Matti works at", matti['researchOrganization'][-1]['name'])

csds_org_id = matti['researchOrganization'][-1]['id']
csds = people.by_organisation( csds_org_id  )

for member in csds:
  print('Also working at CSCS:', member['firstnames'] + ' ' + member['lastname'])
Package: py4jdbc
Py4jdbc is a (mostly)dbapi 2.0compliant interface to JDBC.
It’s similar toJayDeBeAPI, but uses a much more efficient JVM
backend process implemented with Py4j instead of JPype.Install with pippip install py4jdbcInstall from source tarballtar -zxf py4jdbc-V.X.Y.Z.tar.gz
cd py4jdbc-V.X.Y.Z
python setup.py installExampleA simple example that starts a JVM subprocess:from py4jdbc import connect

conn = connect("jdbc:postgresql://localhost/postgres, user="cow", password="moo")
cur = conn.cursor()
cur.execute("select 1 as cow;")
Package: py4j-example
Py4J - A walkthroughThis project is a simple implementation ofPy4J, a Python library that enables Python programs to dynamically access Java objects and methods. The goal of this project is to provide users with a guardrail to implement Py4J in their workflow.Getting StartedTo get started with Py4J, you will need to have the below in your machine.Java (Java 11 or above) - This project was tested withJava 11AddJAVA_HOMEto your environment variablesPython (Python 3.x) - This project was tested withPython 3.10.11Optional - Maven (only if you want to build from source) - This project's build was tested withMaven 3.9.4You can find the installation instructions on their respective official websites.Once you have Java and Python installed, you can proceed with the following steps:Install the package using pippip install py4j-exampleUsageFrom your terminal, open pythonpythonRun the below code which will let you use the underlying Java subtract method in pythonfrompy4j_example.appimportApplicationWrapperwrapper=ApplicationWrapper()result=wrapper.subtract(2,1)print(result)# will output 1In addition to the subtract method, you can access other Java objects and methods (native and custom) from Python.
For example, to call a Java method namedgetArrayLengththat takes a list of integers as a parameter, you can do the following:frompy4j_example.appimportApplicationWrapperwrapper=ApplicationWrapper()result=wrapper.getArrayLength([1,2,3])print(result)# will output 3Note: Python doesn't have an equivalent data type for Java'sint[], so I've constructed a Java array from Python using Py4J. Refer tothiscode.Extending the applicationYou can extend the application by adding your own Java classes and methods.Create a new Java class in thesrc/main/java/org/example/directory or modify the existingApplication.javaclassAdd your custom methods to the classAdd unit test cases for the Java methods in thesrc/test/java/org/example/directoryBuild the project usingmvn clean packageModify thepyhton/app.pyfile to add your custom methodsAdd unit tests for your Python methods in thepython/tests/directoryRun the tests usingpython -m pytestfrom the project root directoryContributingContributions to this project are welcome.
If you have any suggestions, bug reports, or feature requests, please open an issue on the GitHub repository.
Package: py4js
py4jspy4js is a fast and simple micro-framework for small web applications. Its goal is to enable you to develop
web applications in a simple and understandable way.With it, you don't need to know the HTTP protocol, or how Python communicates with JavaScript. You can use Python functions in JavaScript just like native JavaScript functions.Usage stepsStep 1Install py4js package:pip install py4jsorpip3 install py4jsStep 2First, create a package, named service, and then create a Python file in the package, such ashello.py:defsay_hello(name):"""say hello test:param name::return:"""return'Hello%s!'%nameStep 3Create a Python file that is at the same level as the service package, such asmain.py:frompy4jsimportServerServer().run()Then run it(By default, the server will launch wsgiref server at port5000. You can also use other port and wsgi server).Step 4Create a HTML file, anywhere, such asindex.html:<!DOCTYPE html><htmllang="en"><head><metacharset="UTF-8"><title>hello</title><scriptsrc="http://localhost:5000/service.js"></script></head><body><script>service.hello.say_hello('World',function(data){alert(data);});</script></body></html>Open theindex.htmlin browser and you will see the alert message:It's so easy, yes?ServerServer parametersThe server has several startup parameters that can be specified, for example:NameDescriptionhostServer address to bind to(default:0.0.0.0). Pass0.0.0.0to listens on  all services including the external one.portServer port to bind to(default: 5000). Values below 1024 require root privileges. if port is None, server will use a random port.serverSpecify the server adapter to use. For more details:Server adapter. (default:wsgiref, others:paste/waitress/gevent/cherrypy/gunicorn.etc).service_packageA package that will be scanned by the server. All modules and public functions in the package will be loaded as service for JavaScript. Default package name isservice, also you can change it to another name if you like.js_routethe path of JavaScript for browser to load.access_control_allow_origindefault:*, all cross domain requests are allowed.Server adapterAs the py4js server is based on Bottle, the built-in default server is based on wsgiref WSGIServer. This non-threading HTTP server may become a performance bottleneck when server load increases.
So it's better to use a different server that is either multi-threaded or supports asynchronous IO.Bottle ships with a lot of ready-to-use adapters for the most common WSGI servers, such as:cherrypy,paste,waitress,gevent,eventlet,tornado,twisted.etc.
Usage:waitressfrompy4jsimportServerServer(server='waitress').run()If you haven't installed thewaitresspackage, please install it first bypip install waitressorpip3 install waitress.geventfromgeventimportmonkeyfrompy4jsimportServermonkey.patch_all()Server(server='gevent').run()If you haven't installed thegeventpackage, please install it first bypip install geventorpip3 install gevent.Asgeventis Asynchronous, the server can be very fast, can handle a virtually unlimited number of concurrent connections and are easy to manage.
Package: py4k-means
py4k-meansK-Means Python LibraryGetting StartedThis project is simply implementation of K-Means clustering algorithm in python programming language.PrerequisitesNumpy & PandasInstallingThe easiest way to install py4k-means is using pippip install py4k-meansUsageThere is only 1 public method of k_means class. It is cluster. cluster method takes 3 argument namely x, k, and max_iter. x is the data its self, k is the number of cluster we are aiming to, while max_iter is maximum iteration. By default max_iter is 10. The return of this method is pandas DataFrame with 1 column addition, it is the label column obtained by K-Means algorithmfrom py4k_means.cluster import k_means
import numpy as np
import matplotlib.pyplot as plt
x = [np.random.uniform(-5,5 ,2) for i in range(500)]
km = k_means()
y = km.cluster(x,4,20)
plt.scatter(y['x0'],y['x1'],c=y['label'],cmap='rainbow')
plt.show()
Package: py4knn
py4knnK-Nearest Neighbors Python LibraryGetting StartedThis project is simply an implementation of K-Nearest Neighbors algorithm in python programming language.PrerequisitesThis Project Has No PrerequisitesInstallingThe easiest way to install py4knn is by using pippip install py4knnUsageThere is only 1 public method of knn class. It is predict method, it takes 5 argument namelyx_train,t_train,x_test,k, anddistancecalculation method. We provide 6 distances namely euclidean, squared_euclidean, manhattan, canberra, chebyshev, and bray_curtis.from py4knn.k_nearest_neighbors import knn
classifier = knn()
x_train = [[0.23,0.54],[0.45,1.23],[1.54,0.23],[0.93,0.535]]
t_train = [0,1,0,1]
x_test = [[0.34,0.65],[0.90,0.50]]
y = classifier.predict(x_train,t_train,x_test,1,'euclidean')