Saravanan666/pypi-org huggingface dataset:
Package: pychroma
pychromaPython library for accessing the Razer Chroma SDKpychroma provides general-purpose access to theRazer Chroma SDK REST APIfor control over the LEDs of Razer devices.
The work environment is easy to set up and it features a sketch and (optionally) a controller. The sketch code structure is heavily inspired fromp5js.orgconventions. The controller allows having multiple sketches.FeaturesFull controll over the LEDs via Chroma SDKLow barrier to entry for educators and practitionersMade for everyoneSimply use the sketch! This library is accessible and inclusive for artists, designers, educators and beginnersGain more access by using the controller or handling the connection and devices all by yourselfIf you want to have full control then fork this repository and edit the source codeInstallationThis repo is tested on Python 3.8.3, requests 2.23.0 and pynput 1.6.8With pippychroma can be installed using pip as follows:pipinstallpychromaFrom sourceYou can install from source by cloning the repository and running:gitclonehttps://github.com/morswin22/pychromacdpychroma
pipinstall.When you update the repository, you should upgrade the pychroma installation and its dependencies as follows:gitpull
pipinstall--upgrade.Run the examplesYou can download the examples from theexamples repoLook at the README included with examples for more informationTestsA series of tests are included for the library. Library tests can be found in the tests folder.Here's the easiest way to run tests for the library:python-munittestdiscover-v-s./tests-ptest*.pyIf you are using Visual Studio Code then you can use it's built in testing with python add-onQuick TourCheck out thewikifor detailed documentation.Create a configuration file in JSON format.{"chroma":{"developerName":"Your name","developerContact":"Your email","category":"application","supportedDevices":["keyboard"],"description":"Basic hello world sketch","title":"Hello world!"}}Creating a sketchfrompychromaimportSketchclassMySketch(Sketch):config_path='path/to/config/file.json'Example animation codefrompychromaimportSketchclassMySketch(Sketch):config_path='path/to/config/file.json'defsetup(self):self.frame_rate=30self.keyboard.color_mode('hsv')self.hue=0defupdate(self):self.hue+=1ifself.hue==360:self.stop()defrender(self):self.keyboard.set_static((self.hue,100,100))
Package: pychrome
pychromeA Python Package for the Google Chrome Dev Protocol,more documentTable of ContentsInstallationSetup ChromeGetting StartedTab managementDebugExamplesRefInstallationTo install pychrome, simply:$ pip install -U pychromeor from GitHub:$ pip install -U git+https://github.com/fate0/pychrome.gitor from source:$ python setup.py installSetup Chromesimply:$ google-chrome --remote-debugging-port=9222or headless mode (chrome version >= 59):$ google-chrome --headless --disable-gpu --remote-debugging-port=9222or use docker:$ docker pull fate0/headless-chrome
$ docker run -it --rm --cap-add=SYS_ADMIN -p9222:9222 fate0/headless-chromeGetting Startedimportpychrome# create a browser instancebrowser=pychrome.Browser(url="http://127.0.0.1:9222")# create a tabtab=browser.new_tab()# register callback if you wantdefrequest_will_be_sent(**kwargs):print("loading:%s"%kwargs.get('request').get('url'))tab.Network.requestWillBeSent=request_will_be_sent# start the tabtab.start()# call methodtab.Network.enable()# call method with timeouttab.Page.navigate(url="https://github.com/fate0/pychrome",_timeout=5)# wait for loadingtab.wait(5)# stop the tab (stop handle events and stop recv message from chrome)tab.stop()# close tabbrowser.close_tab(tab)or (alternate syntax)importpychromebrowser=pychrome.Browser(url="http://127.0.0.1:9222")tab=browser.new_tab()defrequest_will_be_sent(**kwargs):print("loading:%s"%kwargs.get('request').get('url'))tab.set_listener("Network.requestWillBeSent",request_will_be_sent)tab.start()tab.call_method("Network.enable")tab.call_method("Page.navigate",url="https://github.com/fate0/pychrome",_timeout=5)tab.wait(5)tab.stop()browser.close_tab(tab)more methods or events could be found inChrome DevTools ProtocolDebugset DEBUG env variable:Tab managementrunpychrome -hfor more infoexample:Examplesplease see theexamplesdirectory for more examplesRefchrome-remote-interfaceChrome DevTools Protocol
Package: pychromepdf
PychromepdfPychromepdf is a Python package that lets you easily create PDFs by rendering HTML content using Chrome or Chromium as backend. It works without any external dependecies except a working installation of Chrome or Chromium that supports headless mode.InstallationpipinstallpychromepdfUsageRendering HTML bytestring to PDFfrompychromepdfimportChromePDF# change to your chrome executable pathPATH_TO_CHROME_EXE='/usr/bin/google-chrome-stable'# if you're on MacOS# PATH_TO_CHROME_EXE = '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'if__name__=='__main__':# initialize chromepdf objectcpdf=ChromePDF(PATH_TO_CHROME_EXE)# the html that need to be rendered into pdfhtml_bytestring='''<!doctype html><html><head><style>@media print {@page { margin: 0; }body { margin: 1.6cm; }}</style></head><body><h1>Hello, World</h1><h5> Generated using headless chrome </h5></body></html>'''# create a file and write the pdf to itwithopen('test.pdf','w')asoutput_file:ifcpdf.html_to_pdf(html_bytestring,output_file):print("Successfully generated the pdf:{}".format(output_file.name))else:print("Error generating pdf")Rendering a flask template into PDFfromflaskimportFlask,render_template,send_fileimporttempfilefrompychromepdfimportChromePDFapp=Flask(__name__)# change to your chrome executable pathPATH_TO_CHROME_EXE='/usr/bin/google-chrome-stable'# if you're on MacOS# PATH_TO_CHROME_EXE = '/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome'# initialize a chromepdf objectcpdf=ChromePDF(PATH_TO_CHROME_EXE)# home route@app.route('/')defindex():returnrender_template('index.html',username="John")# custom pdf route@app.route('/getpdf',defaults={'username':'John'})@app.route('/getpdf/<username>')defgetpdf(username):# get the rendered html as string using the templaterendered_html=render_template('index.html',username=username)# create a temporary output file which will be deleted when closedwithtempfile.NamedTemporaryFile(suffix='.pdf')asoutput_file:# create a pdf from the rendered html and write it to output_fileifcpdf.html_to_pdf(rendered_html,output_file):print("PDF generated successfully:{0}".format(output_file.name))try:# send the file to userreturnsend_file(output_file.name,attachment_filename='awesome.pdf')exceptExceptionase:returnstr(e)else:print("Error creating PDF")return"Error"if__name__=='__main__':app.run(debug=True)Template{# templates/index.html #}<!DOCTYPE html><html><head><metacharset="utf-8"/><metahttp-equiv="X-UA-Compatible"content="IE=edge"><title>Example</title><metaname="viewport"content="width=device-width, initial-scale=1"><style>@mediaprint{@page{margin:0;}body{margin:1.6cm;}}</style></head><body><h1>Hello {{ username }}!</h1><h4>Generated using ChromePDF</h4></body></html>ContributorsnvnmochibieggLicenseMIT License
Package: pychromvar
pychromVARpychromVAR is a python package for inferring transcription factor binding variability from scATAC-seq data by implmenting the algorithm proposed inchromVAR. It is built onanndataandmudatatherefore can work seamlessly withScanpyandMuonpipeline.For more methodological details, please refer to thepaper.InstallationThe quickest and easiest way to get pychromvar is to to use pip:pipinstallpychromvarTutorialYou can findherea tutorial how to use pychromVAR combined with Muon to analysis multimodal single-cell PBMC data.
Package: pychron-cm
pcmPychron Configuration ManagerThis is a simple "command line interface" akaclifor build pychron configuration
files.It can also be used to install the pychron source code, build the necessary python environment and install launcher
scriptsPrerequisitesInstallEnthought Deployment ManagerInstall gitfor windows download fromgit-scm.comfor mac use$xcode-select--installInstallationpipinstallpychron-cmUsagepcmwizardor for helppcm--helpManually build EDM environmentedmshell-epychronchaco,certifi,cython,envisage,future,gitpython,keyring,jinja2,lxml,numpy,pandas,patsy,pillow,pip,pyface,pyparsing,pyproj,pyqt5,pytables,pyyaml,pygments,qt,Reportlab,requests,scipy,sqlalchemy,traits,xlrd,xlsxwriter,xlwt,statsmodels
pipinstall--no-dependenciesuncertaintiesqimage2ndarraypymysql
Package: pychronic
pychronicIntroductionA natural language date parser in Python. Inspired from Ruby's chronic.Installationpip install pychronicUsage:Datetime To Natural Langaugefrom pychronic.utils import to_natural_time
 from datetime import datetime, timedelta, date

>>> to_natural_time(datetime.now())
{'day': 'today', 'time': '10:56 PM', 'month': 'September', 'year': 2019, 'day_of_week': 'Friday'}

>>> to_natural_time(datetime.now() - timedelta(days=1))
{'day': 'yesterday', 'time': '10:56 PM', 'month': 'September', 'year': 2019, 'day_of_week': 'Thursday'}

>>> to_natural_time(datetime.now() + timedelta(days=1))            
{'day': 'tomorrow', 'time': '10:57 PM', 'month': 'September', 'year': 2019, 'day_of_week': 'Saturday'}

>>> to_natural_time(datetime(year=2019, month=1, day=1, hour=1, minute=0, second=0))
{'day': '1st', 'time': '01:00 AM', 'month': 'January', 'year': 2019, 'day_of_week': 'Tuesday'}Highlight datetime in textfrom pychronic.utils import highlight_from_text

>>> highlight_from_text("Tournament will commence on 12:30 PM on 23rd May and end on 25th aug")
{'input': ['Tournament', 'will', 'commence', 'on', '12:30', 'PM', 'on', '23rd', 'May', 'and', 'end', 'on', '25th', 'aug'], 'matched_pattern': [{'from_index': 4, 'to_index': 8, 'parsed_value': datetime.datetime(2019, 5, 23, 12, 30)}, {'fro
m_index': 12, 'to_index': 13, 'parsed_value': datetime.date(2019, 8, 25)}]}

>>> highlight_from_text("Tournament will commence on 11:30 PM on 23rd May and end on 25th aug")
{'input': ['Tournament', 'will', 'commence', 'on', '11:30', 'PM', 'on', '23rd', 'May', 'and', 'end', 'on', '25th', 'aug'], 'matched_pattern': [{'from_index': 4, 'to_index': 8, 'parsed_value': datetime.datetime(2019, 5, 23, 23, 30)}, {'fro
m_index': 12, 'to_index': 13, 'parsed_value': datetime.date(2019, 8, 25)}]}

>>> highlight_from_text("Today is 25th of december")
{'input': ['Today', 'is', '25th', 'of', 'december'], 'matched_pattern': [{'from_index': 2, 'to_index': 4, 'parsed_value': datetime.date(2019, 12, 25)}]}

>>> highlight_from_text("Results are on 23-may-2019 or 24-may-2019")
{'input': ['Results', 'are', 'on', '23-may-2019', 'or', '24-may-2019'], 'matched_pattern': [{'from_index': 3, 'to_index': 3, 'parsed_value': datetime.date(2019, 5, 23)}, {'from_index': 5, 'to_index': 5, 'parsed_value': datetime.date(2019,
 5, 24)}]}ContributingFork and pull request.ContributorsJayesh
Package: py-chronicler
ChroniclerChronicler is an innovative Python tool designed to streamline and automate the documentation process for development projects. Leveraging the power of Git and various language processing technologies, it provides an intuitive interface for tracking changes, generating comprehensive documentation, and ensuring seamless integration with existing version control workflows. Ideal for developers and teams looking to enhance their productivity and maintain clear, up-to-date documentation, Chronicler simplifies the complexities of project management and documentation.Getting StartedPrerequisitesPython 3.6 or higherGitInstallationClone the repository:gitclonehttps://github.com/jasuca/chronicler.gitcdchroniclerSet up a virtual environment:python-mvenvvenvsourcevenv/bin/activate# On Windows use 'venv\Scripts\activate'Install the package in editable mode:pipinstall--editable.This command will install the package and its dependencies, allowing you to make changes to the code and see them reflected immediately.Running LocallyWith the virtual environment activated and the package installed in editable mode, you can run Chronicler directly from the command line:chroniclerContributingWe welcome contributions to the Chronicler project! If you have suggestions for improvements or want to contribute code, please follow these steps:Fork the repository.Create a new branch (git checkout -b feature-branch).Make your changes and commit them (git commit -am 'Add some feature').Push to the branch (git push origin feature-branch).Create a new Pull Request.LicenseThis project is licensed under the MIT License - see the LICENSE file for details.
Package: pycht
Street art by clustering.Pics by@alys.cheshireBut, said Alice, if the world has absolutely no sense, who's stopping us from inventing one ?L. Caroll⚡️ Quick startTake a nice picture :Generate a 4 colors stencil model :>>frompychtimportPycht>>Pycht().stencil('cat.jpg','stencil_cat.jpg',4)Stencil 1stencil 2stencil 3stencil 4Final result rendering with all stencils :Cut it, paint it, stare at it, leave it.
Enjoy !🛠 Installation:snake: You need to installPython 3.6or above.Installation can be done by usingpip.
There arewheels availableforLinux,MacOS, andWindows.pipinstallpychtYou can also install the latest development version as so:pipinstallgit+https://github.com/tlentali/pycht# Or, through SSH:pipinstallgit+ssh://git@github.com/tlentali/pycht.git🥄 How ?Behind this script, you will find algos used for marketing, financial prediction and client targeting.
The pics is tranlated into a matrice, each value indicate a pixel color in three dimension.
Then, a clustering algorithm is used to reshape the picture by colors. The number of colors desired is a parameter and is chosen directly by the user.
As an output you have the picture with the number of color you choose and a picture by color to elaborate each stencils one by one.🖖 ContributingFeel free to contribute in any way you like, we're always open to new ideas and approaches. If you want to contribute to the code base please check out theCONTRIBUTING.mdfile. Also take a look at theissue trackerand see if anything takes your fancy.This project follows theall-contributorsspecification. Again, contributions of any kind are welcome!📜 Licensepychtis free and open-source software licensed under theMIT license.
Package: pychu
pychuLayered configuration loading built onPydantic.With Pychu, you can define your program's configuration as a Pydantic model, then load it from multiple providers.
Providers are ordered as levels of layers, thus allowing upper layers to override values from lower layers.At the moment, the following providers are implemented :Program argumentsEnvironment variablesJSONTOML (with thepychu[toml]extension)YAML (with thepychu[yaml]extension)RequirementsPychu requires Python 3.6+ and Pydantic 1.7.3+.InstallingPychu can be installed through pip.$ pip3 install pychu        # Install the basic version
$ pip3 install pychu[yaml]  # Install the YAML extensionExampleThe following example loads configuration from a JSON file, but also allows overriding using program arguments.frompydanticimportBaseModelfrompychu.argsimportargsfrompychu.jsonimportjsonfrompychuimportloadclassRabbitMQ(BaseModel):host:strusername:strpassword:strport:int=5671rabbitmq=load(target=RabbitMQ,providers=[args(),json("./config.json")])print(rabbitmq)$ cat config.json
{"host": "localhost", "port": 5671, "username": "user", "password": "pass"}
$ ./example.py
host='localhost' username='user' password='pass' port=5671
$ ./example.py --port 5672
host='localhost' username='user' password='pass' port=5672
Package: pychuck
PyChucKInstallationpipinstallpychuckQuickstart# demo.pyfrompychuckimport*# custom unitclassNoise(UGen):# generatordef_tick(self,samples:int)->np.ndarray:returnnp.random.uniform(-1,1,samples)# unitn=Noise(gain=0.5)# graphn>>dac# main loopwhileTrue:# parametern.gain=np.random.uniform(0,1)# time200*ms>>now# pychuck --helppychuckdemo.py
Package: pychunk
PyChunkA Python library to chunk list based on number of items or number of chunksWhy?Two Reasons!Python doesn't come with out of box chunking functionality for lists. Hence I thought of writing a library instead of referring stackoverflow everytimeI always wanted to publish a library in pypiInstallationpip install pychunkUsagefrompychunkimportchunkchunk([1,2,3,4,5],num_chunks=2)chunk([1,2,3,4,5],num_items=3)Tech UsedPeotry for package managementPytest for testingMypy for static code checkingThis is my first time using python types in my projectAhaa moments!I'm deeply suprised by how Poetry makes it so simple to publish a library. I always got list in setuptools and disttoolsBut, I don't think poetry supportspip install -e .equivalent commandLooks like it's been added toPoetry 1.2. Need to figure out how it works.
Package: pychunkbuffers
pychunkbuffersAn open-source python library for writing large amounts of data to buffers via chunks.DescriptionThis repositiory contains the source code for thepychunkbufferslibrary. I came up with the idea for this library while making my other projectAdityaIyer2k7/image-file-hider. In that project, I often had to write large amounts of data (hundreds of megabytes) to lists and buffers. Doing this byte-by-byte took a lot of time, so instead I came up with the solution of chunking.Basically, let us say we have aforloop that has to run 10^8 times, and each time it adds a value to a list. In a chunked implementation, you would pre-define this list like this:[0]*10**8and then create a function that goes from index a to b and updates that value of the list like this:deffunc(startidx,endidx):foriinrange(startidx,endidx):LIST[i]=SOMEVALUEHowever, if we runfunc(0, 10**8), we are still running 10^8 iterations in sequence. Instead, we can run parts likefunc(0, 10000),func(10000, 20000)and so on simultaneously on threads. With this library, we can simply use the linerun_chunked(func,10000,0,10**8)# Where 10000 is our chunk size, while 0 and 10**8 are our boundsNow, we would like to check when all chunks have completed their tasks. The library implements this using a completion status list. Therun_chunkedfunction returns a list of boolean values which are allFalsewhen the chunks start. Whenever a chunk finishes its task, that specific chunk's status is set toTruein the list. If we want to wait for all the chunks to finish, we can use a line like this:whilenotall(STATUS):passExample implementation:# Task: To write the squares values for numbers 1 to 10**8 (inclusive)squares=[0]*10**8CHUNKSIZE=10**5deffunc(startidx,endidx):foriinrange(startidx,endidx):squares[i]=(i+1)**2status=run_chunked(func,CHUNKSIZE,0,len(squares))whilenotall(status):passprint("Done")print(squares[:100])
Package: pychunker
ChunkerDescriptionModule for reading/writing chunk files.Installationpip install pychunkerUsingexample.py:importpychunkerwithpychunker.open("chunkfile.bin","w")ascf:# The chunk can be used via `with'.withcf.chunk("DDAT")asddat:ddat.write(b'1234567890')# Or by contacting the key (name of the chunk).cf["SDAT"].write(b'Hello World!')# !!! Attention !!!# Both types of treatment use the same methods,# namely that if you open a chunk file in read-only mode,# and if the chunk is not in the chunk file,# he will try to create a chunk,# but he will not be able to do this and will give a `IONotWritableError`.withpychunker.open("chunkfile.bin")ascf:print(cf.chunks)Output:[Chunk(name='DDAT',mode='r',size=10),Chunk(name='SDAT',mode='r',size=12)]
Package: pychurn
Installationpip install -U pychurnpychurn will use thepygit2bindings forlibgit2if available, which significantly improves performance. To install, see thelibgit2 docs.UsageRead the docs:pychurn --helpExample usage:pychurn report
pychurn report --path /path/to/repo --since 2016-01-01 --exclude '**test**'Example output:$ pychurn --debug report --path . --sort churn --count 5

code                                    churn    complexity
------------------------------------  -------  ------------
pychurn/version.py:get_churn                4            11
pychurn/cli.py:churn                        3             2
pychurn/complexity.py:get_complexity        3             8
pychurn/cli.py:cli                          2             2
pychurn/cli.py:report                       1             4
Package: pyCHX
pyCHX -- CHX XPCS Data Analysis PackagesRepository for data collection and analysis scripts that are useful at the
CHX beamline at NSLS-II (11-ID) developed by Dr. Yugang Zhang (yuzhang@bnl.gov).Installation instructions on Linux:Install miniconda fromhttps://conda.io/miniconda.html. Then create the environment for pyCHX:conda create --name pyCHX python=3.6 numpy scipy matplotlib
source activate pyCHX
pip install -r https://raw.githubusercontent.com/NSLS-II-CHX/pyCHX/master/requirements.txt
pip install git+https://github.com/NSLS-II-CHX/pyCHX
Package: pyci
Generic continuous integration server for interfacing with github and
publishing results to a Media Wiki. The basic idea is that continuous
integration just requires three things:A repo to monitor for changes.Unit tests to run.A place to publish the results of the tests.Py-CIinterfaces with github using thepygithubAPI wrapper for
interfacing with github’s API. It monitors the pull requests for a set
of repos. When a new or untested pull request is found:Create a local copy of the repo; merge the proposed changes from the
pull request into a working branch.Run all the unit tests specified in therepo.xmlconfiguration
file.Post the results of running the unit tets to a media wiki.QuickstartIf you already have avirtualenvinstalled as well
asvirtualenvwrapper,
skip this next code block. However, be sure to add theVENVvariable
to theglobal configuration
file.pip install virtualenv
pip install virtualenvwrapper
mkvirtualenv ciNext, copy the`global.xml<https://github.com/rosenbrockc/ci/wiki>`__ file and put
it somewhere on you local disk (say~/.ci.global.xml). Be sure toedit the values. Then:export PYCI_XML="~/.ci.global.xml"
workon ci
pip install py-ci
sudo ci.py -setupIf you don’t see any errors, your server is ready to have repositories
installed. This configures the server cron to runevery minute. Use-cronfreq[int minutes]to change that frequency (seecron
settingsfor details). You don’t need to usesudofor anythingexceptsetting the server up initially (or uninstalling it later with the-rollbackswitch). Next, create a`repo.xml<https://github.com/rosenbrockc/ci/wiki/Repository-Level-Settings>`__
file for repository you want to monitor. Suppose it exists at~/repos/myrepo/ci.xml, then:ci.py -install ~/repos/myrepo/ci.xmlYour repository will now be monitored for new pull requests forever
untill you either-uninstalltherepo.xmlfileoryou-disablethe CI server to temporarily suspend all requests. To
understand the behavior of the CI server, read through therepository
level
settingspage.IMPORTANT:if your unit tests require environment variables to be
set, they need to be added to a file called~/.cron_profilethat
will be loaded by the CI server whenever the cron is run. Seecron
environment
variablesfor more details.
Package: pyciaaw
IntroductionPython wrapper around theFortran ciaaw library.
The Fortran library does not need to be installed, the python wrapper embeds all needed fortran dependencies.
On linux, you might have to installlibgfortranif it is not distributed by default with your linux distribution.InstallationSeeINSTALL.txt.DependenciesSeerequirements.txt.License informationSeeLICENSE.txt.
Package: pyciactions
Python CI Workflow DocumentationThis documentation provides an overview of the Python CI workflow implemented using GitHub Actions.Workflow OverviewThe Python CI workflow is triggered by two events: pushes to themainbranch and pull requests targeting themainbranch. It consists of a single job namedbuild, which runs on anubuntu-latestenvironment.StepsThe following steps are executed as part of the workflow:Checkout codeName: Checkout codeUses:actions/checkout@v2Description: This step checks out the repository code onto the runner.Setup PythonName: Setup PythonUses:actions/setup-python@v2Description: This step sets up the Python environment for subsequent steps. The Python version used is3.8.Install dependenciesName: Install dependenciesRun:pip install -r requirements.txtDescription: This step installs the project dependencies by runningpip installwith the requirements specified in therequirements.txtfile.Run testsName: Run testsRun:pytest testsDescription: This step executes the test suite by running thepytestcommand with thetestsdirectory.