Saravanan666/pypi-org huggingface dataset:
Package: craftier
Craftier___  ____   __   ____  ____  __  ____  ____ (pre-α)
 / __)(  _ \ / _\ (  __)(_  _)(  )(  __)(  _ \
( (__  )   //    \ ) _)   )(   )(  ) _)  )   /
 \___)(__\_)\_/\_/(__)   (__) (__)(____)(__\_)

      Your personal Python code reviewerWhat is it?Craftier is a framework to easily writing Python code refactors. In the near
future it will also come with a set of predefined refactoring rules.It is based onlibcstand simplifies the use of its API by letting you write
refactors just by writing Python code.It also preserves relevant comments and ensures the modified code is correct, by
adding required parentheses.Getting startedAfter installing withpip install craftier, you can run the default rules withcraftier refactor <python files>.ConfigurationBy default we look for a.craftier.ini, if none is found a default
configuration will be used.You can also specify the config file with--config CONFIG_PATHConfig format[craftier]packages=craftier.refactors,excluded=A,BWriting your own rulesAs simple as:importcraftierclassSquareTransformer(craftier.CraftierTransformer):defsquare_before(self,x):x*xdefsquare_after(self,x):x**2classIfTrueTransformer(craftier.CraftierTransformer):defif_true_before(self,x,y):xifTrueelseydefif_true_after(self,x):xTODO: write about custom matchers and type declarationsRoadmap and TODOsSupport multiple expressions in a transformerAdd support for statementsComplete set of refactoringsAdd support for typing metadataGenerate RE2 filtering based on expressions. This could be used to prefilter
the list of files and to test the patterns either in codebase search tools
likehttps://grep.appExtensive validation testingLimitationsThis is a work in progress, and some edges are rough.Given that we match code based on actual Python code, some refactorings are not
easily expressed or may not even be expressible at all.HistoryTODO: write how I came up with the idea.NameOriginally I wanted to name this packagepythonista, but unfortunately someone
squatted the name (along with several others) and the name was not released
according to procedure. Furthermore, the issue was locked.That gave me a chance of rethinking the name, so I started with anagrams of the
wordrefactor, which was of course unsuccessful. So after some
experimentation I replaced the letterowith ani, givingrefactir, which
is an anagram of the wordcraftier.I like that name, because is like a "refactoring" of the wordrefactor, andcraftierconveys the actual use case of the tool.Bonus: the name sounds somewhat like my surname.
Package: craftpainting
CraftpaintingCreate Minecraft-like paintings in the terminal🚀 UsageInstall it by runningpipinstallcraftpainting# on on mac,pip3installcraftpaintingCLIcraftpaintinginput_path.png-sSIZE-rREPETITIONS-ooutput_path.pngsizeEnter a string ofWxH, such as2x1. Units are Minecraft blocks, so a width of2x1translates to an image of32x16.repetitionsThe number of times enlarge the image. By default, an image32x16or48x32is too small and doesn't look good.The value of-rdictates how many times each pixel should be multiplied. It's15by default, so an image of size2x1in blocks looks like it's32x16pixels, but is actually480x240.Set to0to get the minimum possible size.grayAppend-g(or--gray) to the command to make the painting black and white.outputpathIf no output path is specified, the image will be shown, but won't be saved.Pythonfromcraftpaintingimportcreate_painting,enlarge_imagefromPILimportImageimage=Image.open('images/sunset_dense.jpg')p=create_painting(image)# create the (super tiny) imagep=enlarge_image(p,repetitions=15)# enlarge it so it looks betterp.show()To use in Python, Pillow is required. Install it:pipinstallpillow# or on mac,pip3installpillowWebVisitcraftpainting.herokuapp.com.Note: the website is hosted on Heroku on the free plan, so it will take around 10 seconds to load.🏳️‍🌈 ExamplesSunset densecraftpaintingsunset_dense.jpg-opainting_sunset_dense.jpgOriginalBeachcraftpaintingbeach.png-s3x2-opainting_beach.pngOriginalCodecraftpaintingcode.jpg-s2x2-opainting_code.jpgOriginalLandscapecraftpaintinglandscape.jpg-g-r5-opainting_landscape.jpgSmaller values ofrepetitionsproduce images of smaller sizes.Original🛠 Build setup# install all packagescdsrc/
pipenvshell
pipenvinstall# run test.pypythontest.pyWebcdweb/
pipenvshell
pipenvinstall# run the site on the dev serverpythonapp.py# host on herokugitadd.
gitcommit-m"update site"cd..# go to the route directorygitsubtreepush--prefixwebherokumaster📜 LicenseMITSunset Dense taken fromMinecraft GamepediaOther images taken fromPexels
Package: craft-parts
# Craft Parts[![Documentation Status](https://readthedocs.com/projects/canonical-craft-parts/badge/?version=latest)](https://canonical-craft-parts.readthedocs-hosted.com/en/latest/?badge=latest)Craft-parts provides a mechanism to obtain data from different sources,
process it in various ways, and prepare a filesystem subtree suitable for
deployment. The components used in its project specification are calledparts, which can be independently downloaded, built and installed, and
also depend on each other in order to assemble the subtree containing the
final artifacts.# LicenseFree software: GNU Lesser General Public License v3# Documentationhttps://canonical-craft-parts.readthedocs-hosted.com/en/latest/# ContributingAMakefileis provided for easy interaction with the project. To see
all available options run:` make help `## Development EnvironmentIn order to develop anyaptrelated items, thepython-aptpackage is needed.
Theaptextra will require this package in general.Apt package prerequisites for this development environment on an Ubuntu system can be installed with:`bash sudo apt installlibapt-pkg-devintltoolfuse-overlayfs`On a Debian or Ubuntu system, the appropriate package can be installed by running`bash apt sourcepython-aptpip install./python-apt_*`or by downloading and installing the appropriate source tarball. On Ubuntu these are:focal (20.04):https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.0.1ubuntu0.20.04.1/python-apt_2.0.1ubuntu0.20.04.1.tar.xzjammy (22.04):https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu1/python-apt_2.4.0ubuntu1.tar.xzlunar (23.04):https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.5.3ubuntu1/python-apt_2.5.3ubuntu1.tar.xz## Running testsTo run all tests in the suite run:` make tests `## Adding new requirementsIf a new dependency is added to the project run:` makefreeze-requirements`## Verifying documentation changesTo locally verify documentation changes run:` make docs `After running, newly generated documentation shall be available at./docs/_build/html/.## Committing codePlease follow these guidelines when committing code for this project:Use a topic with a colon to start the subjectSeparate subject from body with a blank lineLimit the subject line to 50 charactersDo not capitalize the subject lineDo not end the subject line with a periodUse the imperative mood in the subject lineWrap the body at 72 charactersUse the body to explain what and why (instead of how)
Package: craft-providers
DescriptionThis project provides Python interfaces for instantiating and executing
builds for a variety of target environments.Initial providers include:LXD containersMultipass VMsHost support is targeted for:LinuxMac OS XWindowsLicenseFree software: GNU Lesser General Public License v3Documentationhttps://canonical-craft-providers.readthedocs-hosted.com/en/latest/ContributingSee the HACKING.rst document for details on how to contribute.
Package: craftr-core
craftr-coreThecraftr-corepackage provides the core build system functions for the Craftr build system.ConceptsProjectsA project is the main unit that is used to represent a collection of tasks. A project has a collection
of tasks and possibly other sub-projects. Every project has a name and unique ID (aka. path) inside the
current build context.TasksTasks encapsulate the configuration and logic of an operation in a build. Examples include the compilation
or generation of source files, copying or compressing files. Such operations are usually described using a
sequence of Actions, see below. Dependencies between individual tasks describe a directed acyclic graph used
for determining the order in which tasks need to be executed.A task has a set of input and output files. If an input files changes or an output file does not exist, a
task is considered outdated and will be executed again. There are also tasks that are not executed by
default unless depended on by another tasks that is executed or explicitly specified as to be executed in
a given execution of the build graph.ActionsAn action is a concrete unit of work that can be executed as part of a build. A task is usually described
by one or more actions. Dependencies between actions express the order in which they are to be executed
relative to the other actions produced by the same task.PluginsPlugins are reusable pieces of build logic that can be applied to projects. A plugin usually registers
a new task or task factory in the project which is subsequently accessible via theproject.extobject
or from the namespace object returned byProject.apply().SettingsCraftr settings are files in a line-basedkey=valueformat. There are a bunch of settings that control
the behaviour of the Craftr core components. No settings file is loaded implicitly by theContextclass.OptionDefault valuecore.build_directory.buildcore.executorcraftr.core.executor.default.DefaultExecutorcore.plugin.loadercraftr.core.plugin.default.DefaultPluginLoadercore.plugin.loader.delegatescraftr.core.project.loader.default.DefaultProjectLoader,craftr.build.loader.DslProjectLoader?core.plugin.entrypointcraftr.pluginscore.project.loadercraftr.core.project.loader.delegate.DelegateProjectLoadercore.verboseFalsecore.task_selectorcraftr.core.task.selector.default.DefaultTaskSelectorCopyright © 2021 Niklas Rosenstein
Package: craftr-dsl
craftr-dslA domain specific language purpose-built for the Craftr build system.The Craftr DSL is an "almost superset" of Python 3; adding a lot of syntactical features that make it more
convenient to describe build configurations at the cost of some other syntax features of the native Python
language (like set literals).Installation$ pip install craftr-dslThecraftr-dslpackage requires at least Python 3.8.Projects using Craftr DSLNovella
Package: craft-reconstruct
CRAFT: Constraining and Restoring iterative Algorithm for Faraday TomographyA python 3 implementation of the CRAFT technique described inCooray et al. 2020. The techniques takes in an observed complex linear polarization spectrum that is limited in frequency to produce a reconstructed spectrum. If you make use of this code, please cite the above mentioned paper.InstallationInstall using pip:pip install git+https://github.com/suchethac/craftOr, clone this directory and install locally:git clone https://github.com/suchethac/craft
cd craft/
pip install .
# - OR -
python setup.py installUsageUse as a module byimport craft.For learning how to use this code, I have uploaded a demo python notebook. Additional documentation will be available in due time.If you have any questions, please contact Suchetha Cooray at cooray{at}nagoya-u.jpReferenceSuchetha Cooray, Tsutomu T Takeuchi, Takuya Akahori, Yoshimitsu Miyashita, Shinsuke Ideguchi, Keitaro Takahashi, Kiyotomo Ichiki,An Iterative Reconstruction Algorithm for Faraday Tomography, Monthly Notices of the Royal Astronomical Society, Volume 500, Issue 4, February 2021, Pages 5129–5141,https://doi.org/10.1093/mnras/staa3580
Package: craft-text-detector
CRAFT: Character-Region Awareness For Text detectionPackaged, Pytorch-based, easy to use, cross-platform version of the CRAFT text detector |Paper|OverviewPyTorch implementation for CRAFT text detector that effectively detect text area by exploring each character region and affinity between characters. The bounding box of texts are obtained by simply finding minimum bounding rectangles on binary map after thresholding character region and affinity scores.Getting startedInstallationInstall using pip:pip install craft-text-detectorBasic Usage# import Craft classfromcraft_text_detectorimportCraft# set image path and export folder directoryimage='figures/idcard.png'# can be filepath, PIL image or numpy arrayoutput_dir='outputs/'# create a craft instancecraft=Craft(output_dir=output_dir,crop_type="poly",cuda=False)# apply craft text detection and export detected regions to output directoryprediction_result=craft.detect_text(image)# unload models from ram/gpucraft.unload_craftnet_model()craft.unload_refinenet_model()Advanced Usage# import craft functionsfromcraft_text_detectorimport(read_image,load_craftnet_model,load_refinenet_model,get_prediction,export_detected_regions,export_extra_results,empty_cuda_cache)# set image path and export folder directoryimage='figures/idcard.png'# can be filepath, PIL image or numpy arrayoutput_dir='outputs/'# read imageimage=read_image(image)# load modelsrefine_net=load_refinenet_model(cuda=True)craft_net=load_craftnet_model(cuda=True)# perform predictionprediction_result=get_prediction(image=image,craft_net=craft_net,refine_net=refine_net,text_threshold=0.7,link_threshold=0.4,low_text=0.4,cuda=True,long_size=1280)# export detected text regionsexported_file_paths=export_detected_regions(image=image,regions=prediction_result["boxes"],output_dir=output_dir,rectify=True)# export heatmap, detection points, box visualizationexport_extra_results(image=image,regions=prediction_result["boxes"],heatmaps=prediction_result["heatmaps"],output_dir=output_dir)# unload models from gpuempty_cuda_cache()
Package: craft-text-detector-jsl
CRAFT: Character-Region Awareness For Text detectionPackaged, Pytorch-based, easy to use, cross-platform version of the CRAFT text detector |Paper|OverviewPyTorch implementation for CRAFT text detector that effectively detect text area by exploring each character region and affinity between characters. The bounding box of texts are obtained by simply finding minimum bounding rectangles on binary map after thresholding character region and affinity scores.Getting startedInstallationInstall using pip:pip install craft-text-detectorBasic Usage# import Craft classfromcraft_text_detectorimportCraft# set image path and export folder directoryimage='figures/idcard.png'# can be filepath, PIL image or numpy arrayoutput_dir='outputs/'# create a craft instancecraft=Craft(output_dir=output_dir,crop_type="poly",cuda=False)# apply craft text detection and export detected regions to output directoryprediction_result=craft.detect_text(image)# unload models from ram/gpucraft.unload_craftnet_model()craft.unload_refinenet_model()Advanced Usage# import craft functionsfromcraft_text_detectorimport(read_image,load_craftnet_model,load_refinenet_model,get_prediction,export_detected_regions,export_extra_results,empty_cuda_cache)# set image path and export folder directoryimage='figures/idcard.png'# can be filepath, PIL image or numpy arrayoutput_dir='outputs/'# read imageimage=read_image(image)# load modelsrefine_net=load_refinenet_model(cuda=True)craft_net=load_craftnet_model(cuda=True)# perform predictionprediction_result=get_prediction(image=image,craft_net=craft_net,refine_net=refine_net,text_threshold=0.7,link_threshold=0.4,low_text=0.4,cuda=True,long_size=1280)# export detected text regionsexported_file_paths=export_detected_regions(image=image,regions=prediction_result["boxes"],output_dir=output_dir,rectify=True)# export heatmap, detection points, box visualizationexport_extra_results(image=image,regions=prediction_result["boxes"],heatmaps=prediction_result["heatmaps"],output_dir=output_dir)# unload models from gpuempty_cuda_cache()
Package: craft-text-detector-updated
CRAFT: Character-Region Awareness For Text detectionPackaged, Pytorch-based, easy to use, cross-platform version of the CRAFT text detector |Paper|OverviewPyTorch implementation for CRAFT text detector that effectively detect text area by exploring each character region and affinity between characters. The bounding box of texts are obtained by simply finding minimum bounding rectangles on binary map after thresholding character region and affinity scores.Getting startedInstallationInstall using pip:pip install craft-text-detector-updatedBasic Usage# import Craft classfromcraft_text_detectorimportCraft# set image path and export folder directoryimage='figures/idcard.png'# can be filepath, PIL image or numpy arrayoutput_dir='outputs/'# create a craft instancecraft=Craft(output_dir=output_dir,crop_type="poly",cuda=False)# apply craft text detection and export detected regions to output directoryprediction_result=craft.detect_text(image)# unload models from ram/gpucraft.unload_craftnet_model()craft.unload_refinenet_model()Advanced Usage# import craft functionsfromcraft_text_detectorimport(read_image,load_craftnet_model,load_refinenet_model,get_prediction,export_detected_regions,export_extra_results,empty_cuda_cache)# set image path and export folder directoryimage='figures/idcard.png'# can be filepath, PIL image or numpy arrayoutput_dir='outputs/'# read imageimage=read_image(image)# load modelsrefine_net=load_refinenet_model(cuda=True)craft_net=load_craftnet_model(cuda=True)# perform predictionprediction_result=get_prediction(image=image,craft_net=craft_net,refine_net=refine_net,text_threshold=0.7,link_threshold=0.4,low_text=0.4,cuda=True,long_size=1280)# export detected text regionsexported_file_paths=export_detected_regions(image=image,regions=prediction_result["boxes"],output_dir=output_dir,rectify=True)# export heatmap, detection points, box visualizationexport_extra_results(image=image,regions=prediction_result["boxes"],heatmaps=prediction_result["heatmaps"],output_dir=output_dir)# unload models from gpuempty_cuda_cache()
Package: crafty-client
Crafty-ClientAboutCrafty Client is a pypi (pip) package for interfacing with theCrafty server control panel.InstallMake sure you have python3 installed on your system with the pip package manager.For Windows environmentspipinstallcrafty-clientFor linux (apt/yum/rpm/etc.) environmentspip3installcrafty-clientUsageExample:fromcrafty_clientimportCrafty4URL="https://127.0.0.1:8443"# The location of the crafty-web webserverAPI_TOKEN="<place token here>"# Your crafty Web API token, printed in the console at installation.crafty=Crafty4(URL,API_TOKEN)print(crafty.list_mc_servers())
Package: crag
What canCRAGdo for you?Survival analysis is the study of "time-to-event" (TTE) outcomes, taking the focus offifan event will occur and instead looking atwhenan event will occur. Often, the when question is answered by a combination of factors, such as age or sex, survival analysis tests whether these associations are clear from data collected. So, if I'm askingwhen will I respond to a medication?, survival analysis can help to answer this question. Further information can be found on this great page by Cam Davidson-Pilon (author of lifelines)here.A genome-wide association study (GWAS), is a study of a genetic variants across the genome. Whether we are faced with awhenorif, GWAS allows us to consider whether genetic factors are part of the combination of factors that answer these questions.CRAGis a novel software that performs survival analysis genome-wide and goes one step further: handling a particular type of TTE outcomes that occur for different reasons, such as drug withdrawal occuring due to either the drug not working or causing a bad reaction, appropriately modelling via “competing risks”.CRAGis an easy to use software implemented using Python, and is compatible with Linux, Mac OS X & Windows operating systems.CRAGcan handle large-scale genome-wide data including imputed genotypes. Analyses can be undertaken with a cause-specific or sub-distribution model. The software can adjust for multiple covariates and incorporate SNP-covariate interaction effects.The main use of CRAG is expected to be in pharmacogenetic studies to identify genetic biomarkers of patient response to treatment, with the ultimate goal of personalising therapeutic intervention for an array of diseases.Installation:Dependencies:Please install the following  Python packages prior to use ofCRAG(some may be installed with Python): subprocess, sys, math, lifelines, csv, numpy, pandas, gzip, time, argparse and warnings.InstallingType the following command in the terminal/command line to intallCRAGpip install --upgrade --no-deps git+https://github.com/brfrancis/CompetingRisksAnalysisGW.gitfrom the command line.Testing CRAGCRAG guideIf you are new to survival analysis, wondering why it is useful, or are interested inlifelinesexamples and syntax,
please check out theDocumentation and Tutorials pageContactingPlease chat with author Ben Francis @Gitter. Email is also possible but likely to not be as timely!CRAG citationIf you find CRAG useful, the best way to show your appreciation is through citing, click the badge below to generate a DOI that can be put into most citation managers. A manuscript for CRAG is currently in production...
Package: craigapts
craigaptsPython package for scraping apartment data from Craigslist.InstallStable version from PyPI:pipinstallcraigaptsDev version from GitLab:pipinstallgit+https://gitlab.com/everetr/craigapts.gitExamplesfromcraigaptsimportCLSearchGEO="newjersey"QUERY='"no section 8"'# exact phrases must be within "double quotes"# get basic data available on search result pagesc1=CLSearch(GEO,QUERY)print(c1.data)# get details by navigating to each individual adc2=CLSearch(GEO,QUERY,deep=True)print(c2.data)CHANGELOGSeeNEWS.md.TODOSeeTODO.md.
Package: craiglist-scraper-api
Craigslist ScraperCraigslist
Scraperis
a scraping tool that overcomes advanced anti-bot systems and helps you
gather public data from Craigslist on any scale you need. This guide
will show you how to scrape Craigslist using Oxylabs’Scraper
API.How it worksYou can get Craigslist data by sending a request to our API with the
URLs you want to access and scrape. The API will return the HTML of any
public Craigslist page.Python code exampleThe below code sample sends a request to our service, which uses a
headless browser to execute JavaScript and sends back the HTML of a
Craigslist page:importrequestsfrompprintimportpprint# Structure payload.payload={'source':'universal','url':'https://berlin.craigslist.org/search/ela#search=1~gallery~0~0','geo_location':'Germany','render':'html'}# Get a response.response=requests.request('POST','https://realtime.oxylabs.io/v1/queries',auth=('USERNAME','PASSWORD'),#Your credentials go herejson=payload)# Instead of response with job status and results URL, this will return the# JSON response with results.pprint(response.json())Visit thedocumentationto find more payload parameters and other details.Output sample{"results":[{"content":"<!doctype html><html lang="en"><head>...</script></body></html>","created_at":"2023-09-21 14:26:52","updated_at":"2023-09-21 14:27:10","page":1,"url":"https://berlin.craigslist.org/search/ela#search=1~gallery~0~0","job_id":"7110630468831163393","status_code":200}]}Oxylabs Craigslist Scraper API will ease your scraping processes
significantly. Use it to gather public data, such as jobs, items,
services, and ads. If you have any questions, feel free to get in touch
with us vialive chatoremail.
Package: craigsgenerator
Read listings Pythonically.ExamplesGenerate listings.fromcraigsgeneratorimportcraigsgeneratorforlistingincraigsgenerator(sites=['austin.craigslist.org'],sections=['sub']):print(listing)Downloaded files are cached by default and refreshed
if they’re older than a day. Change the directory by
specifying thecachedir.fromcraigsgeneratorimportSectionforlistinginSection('austin','sub',cachedir='downloads'):print(listing)