Saravanan666/pypi-org huggingface dataset:
Package: duc
Duc (transducer) is a data transformation tool for Python.>>>d=Duc({'name':{'validator':{'type':'string'},'transform':{'name':'number_name','type':'integer'}})>>>v.validate({'name':'518'})True>>>v.transform()True>>>v.result{'number_name': 518}AboutSometimes your application receives data from one place and then (after some
transformation) sends it to other place. Often you cannot change the format of
data you receive because source dictates its own requirements. But with Duc you
can validate input (usingCerberus)
and make transformations on it (using similar syntax).
Particular example is when you get data from a client and save it to database.
You want to validate it or leave itas-is(if you trust client) but select
specific fields or transform data to other format is required. Slightly like
forms in web-application.
It was tested under Python 3.4. Compatibility with other versions is not
guaranteed.DocumentationComplete documentation is missed by you can checkexamples.pyfor code snippets
and usage illustrationInstallationDuc is on PyPI so all you need is:$pipinstallducAlso you can install it from Github directly (to use latest version)$pipinstallgit+https://github.com/bmwant21/duc.gitTestingJust run (withPytest):$py.testtestsCopyrightDuc is an open source project byMost Wanted.
Package: duckadmin
# Duck AdminA Django reusable app for show and operate custom forms in admin.## PurposeThe Django Admin is great!But it is highly depends on it's orm.Data source not supported by Django's orm (e.g, redis, mongodb) can not showin Django's admin site.This app help you make your data (in redis, mongodb, file...) show in Django's Admin site.Even you can operate with your data. (Add, Modify, Delete)## Install```pip install duckadmin```## Usage1.  add `'duckadmin'` in `INSTALLED_APPS`2.  define your form. (you can place it in `forms.py`, `models.py`, anywhere you like)Demonstration ( more details see [example](/example/redisapp/forms.py) )```pythonfrom duckadmin import DuckForm# We define form (not model)class MyRedisForm(DuckForm):app_label = 'redisapp'              # your app namemodel_name = 'Person'               # link urlverbose_name = 'Person'             # name displayed in admin sitepk_name = 'id'GENDER = ((1, 'male'),(2, 'female'),)# fields defined below will show in admin siteid = forms.IntegerField()name = forms.CharField(max_length=32)gender = forms.ChoiceField(choices=GENDER)age = forms.IntegerField()# you should implement the api below:# `request` is django request instance@classmethoddef get_count(cls, request):# get count of datasets# return integer@classmethoddef get_data(cls, request, start, stop):# get all data to display in change list page# return list of data.# data is dict format, key is fields defined above@classmethoddef get_data_by_pk(cls, request, pk):# change form view@classmethoddef create_data(cls, request, data):# create new data@classmethoddef update_data(cls, request, data):# update an exist data```3.  define admin. (in file `admin.py`)```pythonfrom django.contrib import adminfrom duckadmin import DuckAdminfrom redisapp.forms import MyRedisForm@admin.register(MyRedisForm)class MyRedisAdmin(DuckAdmin):duck_form = MyRedisForm```After this settings. you will see `Person` in admin site.![admin](/images/admin.png)And the change list page![change_list](/images/change_list.png)You can add, modify record![change_form](/images/change_form.png)
Package: duckcli
duckcliA command-line client for DuckDB databases that has auto-completion and syntax highlighting.InstallationYou can install it via pip:$ pip install -U duckcliUsage$ duckcli --help

Usage: duckcli [OPTIONS] [DATABASE]

Examples:
  - duckcli duckdb_filenameA config file is automatically created at~/.config/duckcli/configat first launch. For Windows machines a config file is created at~\AppData\Local\dbcli\duckcli\configat first launch. See the file itself for a description of all available options.
Package: duckdb-cursor
DuckDB-CursorDuckDB-Cursor is simpleDuckDBwrapper.InstallFirst install library,pip install duckdb-cursorUsageCreate an DB object and initialise it with the application,fromduckdbimportconnectfromduckdb_cursorimportCURSORcur=CURSOR(connect("db.duckdb"))cur.set("INSERT INTO users VALUES(1, ?);",('Wendys',))delcurcan select one row,cur=CURSOR(connect("db.duckdb"))row=cur.get("SELECT name FROM users WHERE id=1;",as_dict=True,one=True)delcurprint(row['name'])can select all rows,cur=CURSOR(connect("db.duckdb"))rows=cur.get("SELECT name FROM users;")delcurprint(rows)ContributingDuckDB-Cursor is developed onGitLab. You are very welcome to
openissuesor
proposemerge requests.HelpThis README is the best place to start, after that try opening anissue.
Package: duckdb-kernel
A duckdb kernel for Jupyter. Using SQL for data analysis in  Jupyter with DuckDB.在Jupyter中使用SQL和duckdb进行数据分析。===========================Prerequisites-------------Install `JupyterLab <https://github.com/jupyterlab/jupyterlab-desktop>`_ and the`duckdb packages for Python <https://github.com/duckdb/duckdb>`_.Installation------------Install using::$ pip install duckdb_kernelor ``pip install git+https://github.com/suyin1203/duckdb_kernel`` for the dev version.To use the kernel, run one of::To remove from kernel listings::$ jupyter kernelspec remove duckdbDevelopment~~~~~~~~~~~Install the package locally::$ pip install -e .$ python -m duckdb_kernel installAs you make changes, test them in a notebook (restart the kernel between changes).
Package: duckdb-server
Mosaic DuckDB ServerA Python-based server that runs a local DuckDB instance and support queries over Web Sockets or HTTP, returning data in eitherApache Arrowor JSON format.Note:This package provides a local DuckDB server. To instead use DuckDB-WASM in the browser, use thewasmConnectorin themosaic-corepackage.Installation and usageWe recommend running the server in an isolated environment withpipx. For example, to directly run the server, use:pipxrunduckdb-serverAlternatively, you can install the server withpip install duckdb-server. Then you can start the server withduckdb_server.Developer SetupWe usehatchto manage our development setup.Start the server in development withhatch run serve. The server restarts when you change the code.To activate the environment, runhatch shell.To set up a local certificate for SSL, usehttps://github.com/FiloSottile/mkcert.The server support queries via HTTP GET and POST, and WebSockets. The GET endpoint is useful for debugging. For example, you can query it with atthis url.PublishingRun the build withhatch build. Then publish withhatch publish. We publish using tokens so when asked, set the username to__token__and then use your token as the password.
Package: duckdns-updater
## DuckDNS IP UpdaterThis is a simple Python tool based on Tkinter, designed to periodically update the DNS for a dynamic IP address using the www.duckdns.org API. It is user-friendly and aimed at Windows users seeking a GUI to do that.For the same result, the easiest method is to use a cron job that merely calls duckdns.org, which avoids having to create tasks in Windows and is appropriate for inexperienced users.You need Python ~3.11, the code should be portable. However, some Linux distributions may require that you install a separate package for python3-Tkinter (even though it is part of the standard library).### Why?I stumbled upon several websites with Java or C# tools, some of which did not even possess a valid SSL certificate, and thus I elected to release this straightforward solution instead of having to rely on random code I have no intention of reading.### How to install?You have several options, assuming you are on Windows but the same goes for Linux or any other OS that supports Python:First option, runpython3 setup.py install.Second alternative, install the tarball from GitHub i.e.pip install https://github.com/jmporcelg/duckdnsupdater/raw/main/dist/duckdns-updater-1.0.0.tar.gz.You may opt to create a virtual environment first. After installation, you will have access to theduckdns-updater.exeandduckdns-updater-script.pywbinaries. You can add them to your PATH to make them accessible from any location.
Package: duckdown
duckdownDuckdown is atornadoapplication.
It uses python-markdown to convert pages to html dynamically and then
presents those pages though tornado templates. This provides an easy syntax for users to
edit their content and developers the ability to style the presentation.The templates, static files and pages can be hosted on Amazon S3. The
published site is static and can make use of CDN resources.  The
cost of hosting a site in this way would ¢ ranther than $ per month.In order to make the site secure you would still need to host the site
in Route53 and provide Amazon hosted certificate and we're writing a
tool to automate that. The editing service can be provided by heroku
on a hobby server - the one I'm looking at now uses 38mb of the memory and
idles at 0 load!Tools:Duckdown installed is an invoke tool that you call from the command line.% duckdown -l
Subcommands:

  create    create a duckdown app at path
  publish   generate public site
  run       run appcreate% duckdown create siteThis will create a folder in the current directory called site which
contains three folders: templates, static, pages.tempates: contains the site_tmpl.html used to render markdown pagesstatic: contains resouces used by templatespages: contains markdown pages stating with index.mdTo usepython3 -m venv venv
source venv/bin/activate
pip install duckdown
duckdown create site
duckdown run siteYou view the site on:http://localhost:8080You can edit the site athttp://localhost:8080/editthe defaut username/password:username: admin
password: adminDevpython3 -m venv venv
source venv/bin/activate
pip install -r dev-requirements.txt
inv serverNow using:https://prismjs.com
Package: duckduckgo
A Python library for querying the Duck Duck Go API.Copyright Michael Stephens <me@mikej.st>, released under a BSD-style license.Source:http://github.com/mikejs/python-duckduckgoInstallationTo install runpython setup.py installUsage>>> import duckduckgo
>>> r = duckduckgo.query('Duck Duck Go')
>>> r.type
'answer'
>>> r.results[0].text
'Official site'
>>> r.results[0].url
'http://duckduckgo.com/'
>>> r.abstract.url
'http://en.wikipedia.org/wiki/Duck_Duck_Go'
>>> r.abstract.source
'Wikipedia'>>> r = duckduckgo.query('Python')
>>> r.type
'disambiguation'
>>> r.related[6].text
'Python (programming language), a computer programming language'
>>> r.related[6].url
'http://duckduckgo.com/Python_(programming_language)'>>> r = duckduckgo.query('1 + 1')
>>> r.type
'nothing'
>>> r.answer.text
'1 + 1 = 2'
>>> r.answer.type
'calc'
Package: duckduckgo2
A Python library for querying the DuckDuckGo API.Copyright Michael Stephens <me@mikej.st>, released under a BSD-style license.Source:http://github.com/crazedpsyc/python-duckduckgoOriginal source:http://github.com/mikejs/python-duckduckgo(outdated)This version has been forked from the original to handle some new features of the API, and switch from XML to JSON.InstallationTo install runpython setup.py installUsage>>> import duckduckgo
>>> r = duckduckgo.query('DuckDuckGo')
>>> r.type
u'answer'
>>> r.results[0].text
u'Official site'
>>> r.results[0].url
u'http://duckduckgo.com/'
>>> r.abstract.url
u'http://en.wikipedia.org/wiki/Duck_Duck_Go'
>>> r.abstract.source
u'Wikipedia'>>> r = duckduckgo.query('Python')
>>> r.type
u'disambiguation'
>>> r.related[1].text
u'Python (programming language), a computer programming language'
>>> r.related[1].url
u'http://duckduckgo.com/Python_(programming_language)'
>>> r.related[7].topics[0].text # weird, but this is how the DDG API is currently organized
u'Armstrong Siddeley Python, an early turboprop engine'>>> r = duckduckgo.query('1 + 1')
>>> r.type
u'nothing'
>>> r.answer.text
u'1 + 1 = 2'
>>> r.answer.type
u'calc'>>> print duckduckgo.query('19301', kad='es_ES').answer.text
19301 es un código postal de Paoli, PA
>>> print duckduckgo.query('how to spell test', html=True).answer.text
<b>Test</b> appears to be spelled right!<br/><i>Suggestions: </i>test, testy, teat, tests, rest, yest.The easiest method of quickly grabbing the best (hopefully) API result is to use duckduckgo.get_zci::>>> print duckduckgo.get_zci('foo')
The terms foobar /ˈfʊːbɑːr/, fubar, or foo, bar, baz and qux are sometimes used as placeholder names in computer programming or computer-related documentation. (https://en.wikipedia.org/wiki/Foobar)
>>> print ddg.get_zci('foo fighters site')
http://www.foofighters.com/us/homeSpecial keyword args for query():useragent   - string, The useragent used to make API calls. This is somewhat irrelevant, as they are not logged or used on DuckDuckGo, but it is retained for backwards compatibility.safesearch  - boolean, enable or disable safesearch.html        - boolean, Allow HTML in responses?
Package: duckduckgo3
A Python library for querying the DuckDuckGo API.Copyright Michael Stephens <me@mikej.st>, released under a BSD-style license.Source:http://github.com/crazedpsyc/python-duckduckgoOriginal source:http://github.com/mikejs/python-duckduckgo(outdated)This version has been forked from the original to handle some new features of the API, and switch from XML to JSON.InstallationTo install runpython setup.py installUsage>>> import duckduckgo
>>> r = duckduckgo.query('DuckDuckGo')
>>> r.type
u'answer'
>>> r.results[0].text
u'Official site'
>>> r.results[0].url
u'http://duckduckgo.com/'
>>> r.abstract.url
u'http://en.wikipedia.org/wiki/Duck_Duck_Go'
>>> r.abstract.source
u'Wikipedia'>>> r = duckduckgo.query('Python')
>>> r.type
u'disambiguation'
>>> r.related[1].text
u'Python (programming language), a computer programming language'
>>> r.related[1].url
u'http://duckduckgo.com/Python_(programming_language)'
>>> r.related[7].topics[0].text # weird, but this is how the DDG API is currently organized
u'Armstrong Siddeley Python, an early turboprop engine'>>> r = duckduckgo.query('1 + 1')
>>> r.type
u'nothing'
>>> r.answer.text
u'1 + 1 = 2'
>>> r.answer.type
u'calc'>>> print duckduckgo.query('19301', kad='es_ES').answer.text
19301 es un código postal de Paoli, PA
>>> print duckduckgo.query('how to spell test', html=True).answer.text
<b>Test</b> appears to be spelled right!<br/><i>Suggestions: </i>test, testy, teat, tests, rest, yest.The easiest method of quickly grabbing the best (hopefully) API result is to use duckduckgo.get_zci::>>> print duckduckgo.get_zci('foo')
The terms foobar /ˈfʊːbɑːr/, fubar, or foo, bar, baz and qux are sometimes used as placeholder names in computer programming or computer-related documentation. (https://en.wikipedia.org/wiki/Foobar)
>>> print ddg.get_zci('foo fighters site')
http://www.foofighters.com/us/homeSpecial keyword args for query():useragent   - string, The useragent used to make API calls. This is somewhat irrelevant, as they are not logged or used on DuckDuckGo, but it is retained for backwards compatibility.safesearch  - boolean, enable or disable safesearch.html        - boolean, Allow HTML in responses?
Package: duckduckgo-images-api
DuckDuckGo Image Search APIDuckDuckGo Image Search API is a python application for programmatically downloading DuckDuckGo Image Search Results. This is for educational purposes only !
Forked fromhttps://github.com/deepanprabhu/duckduckgo-images-api, I just updated it so it works with Python 3+Installationpipinstallduckduckgo-images-apiUsagefromduckduckgo_images_apiimportsearchresults=search("nike")Andresultswill have the following keysads, query, queryEncoded, response_type, results, vqd.To get the the image urls, runprint([r["url"]forrinresults["results"]])LicenseMITDeveloper ConnectIf you are a passionate developer looking to collaborate on interesting projects, feel free to connect through a PR in this project.
Package: duckduckgo-search-api
DuckDuckGoSearchApiDuckDuckGoSearchApi is a Python library that provides a simple and direct interface for interacting with the DuckDuckGo API. This library is designed to simplify searches and the analysis of results from DuckDuckGo.InstalationTo install run the following:pipinstallduckduckgo_search_apiAvailable MethodsTheDuckduckgoclass offers the following main methods:search(query): Accepts a query string and returns search results.UsageHere's an example of how to use the DuckDuckGoSearchApi:fromddgimportDuckduckgoddg_api=Duckduckgo()results=ddg_api.search("Google")Success requestSearch results are returned as a Python dictionary. Each result contains the page title, URL, and a description{"success":true,"data":[{"title":"Page Title","url":"https://www.example.com","description":"Short description of the page"},]}Error requestIn case of an error the returned object will contain thesuccessfield set tofalse{"success":false,"statusCode":404,"message":"Failed to fetch data"}
Package: duckduckpy
DuckDuckPyis a Python
library for queryingDuckDuckGo APIand
render results either to Python dictionary or namedtuple.FeaturesUses standard library onlyWorks on Python 2.6+ and 3.3+Unit test coverage 100%SSL and unicode supportLicensed under MIT licenseInstallationYou can install DuckDuckPy either via thePython Package Index (PyPI)or
from source.To install usingpip:$pipinstallduckduckpyTo install usingeasy_install:$easy_installduckduckpyTo install from sources you can download the latest version of DuckDuckPy
either fromPyPIorGitHub, extract archive contents and
run following command from the source directory:$pythonsetup.pyinstallLatest upstream version can be installed directly from the git repository:$pipinstallgit+https://github.com/ivankliuk/duckduckpy.gitAPI descriptionquery(query_string,secure=False,container=u'namedtuple',verbose=False,user_agent=u'duckduckpy 0.2',no_redirect=False,no_html=False,skip_disambig=False)Generates and sends a query to DuckDuckGo API.Arguments:query_stringQuery to be passed to DuckDuckGo API.secureUse secure SSL/TLS connection. Default - False.
Syntactic sugar is secure_query function which is passed
the same parameters.containerIndicates how dict-like objects are serialized. There are
two possible options: namedtuple and dict. If ‘namedtuple’
is passed the objects will be serialized to namedtuple
instance of certain class. If ‘dict’ is passed the objects
won’t be deserialized. Default value: ‘namedtuple’.verboseDon’t raise any exception if error occurs.
Default value: False.user_agentUser-Agent header of HTTP requests to DuckDuckGo API.
Default value: ‘duckduckpy 0.2’no_redirectSkip HTTP redirects (for !bang commands).
Default value: False.no_htmlRemove HTML from text, e.g. bold and italics.
Default value: False.skip_disambigSkip disambiguation (D) Type. Default value: False.Raises:DuckDuckDeserializeErrorJSON serialization failed.DuckDuckConnectionErrorSomething went wrong with httplib operation.DuckDuckArgumentErrorPassed argument is wrong.Returns:Container depends on container parameter. Each field in the response is
converted to the so-called snake case.Usage>>>fromduckduckpyimportquery>>>response=query('Python')# namedtuple is used as a container>>>responseResponse(redirect=u'',definition=u'',image_width=0,...}>>>type(response)<class'duckduckpy.api.Response'>>>>response.related_topics[0]Result(first_url=u'https://duckduckgo.com/Python',text=...)>>>type(response.related_topics[0])<class'duckduckpy.api.Result'>>>>response=query('Python',container='dict')# dict as the container>>>type(response)<type'dict'>>>>response{u'abstract':u'',u'results':[],u'image_is_logo':0,...}>>>type(response['related_topics'][0])<type'dict'>>>>response['related_topics'][0]{u'first_url':u'https://duckduckgo.com/Python',u'text':...}TODOSSL certificate checking
Package: ducker
What the duck is Ducker?Ducker is a lightweight program that makes internet searches with DuckDuckGo
from the command line. It can display the search results in your terminal or
directly in DuckDuckGo’s website with your browser.UsageJust execute it in your shell with keywords you want to use. The following
example searchs for classical music by opening the search results in your
default browser.$duckclassicalmusicThere are options to search specifically for images, videos or websites.There is also an interactive mode, which lets you make use of more advanced
options. Open the interactive mode by calling Ducker without arguments.When you make a search in the interactive mode, the search results
are displayed in your terminal. Each result consist of a number, a title,
a URL and an abstract. After making the search you can open the URL of the
first result by entering1. Your default browser will open that URL
(opening a new tab if it’s already running) and the program will prompt you
again until you decide to exit. You can quit the program enteringq.To check out every option execute the program with the–helpor-harguments.InstallationYou don’t have to install Ducker to run it. Just install Python 3.3 or later
(if you don’t have it installed) and execute therun_ducker.pyfile.However, you can install Ducker if you want with pip:$pipinstallduckerCustomizationYou can always use your favourite command-line options of Ducker using Bash
aliases or other utilities available for your shell. Let’s say we want to
add an option to search for articles in Wikipedia; we could create a Bash
alias for that.$aliaswikipedia='ducker \!w'Callingwikipediain the shell would open the main page of wikipedia, and
callingwikipedia free softwarewould open the“Free software” article
from wikipedia. Note that we’re usingDuckDuckGo bangsand that the
exclamation mark (!) must be escaped in Bash.Similarly, you can create an alias to never use JavaScript when using Ducker.$aliasduck='ducker --no-javascript'Related projectsddgr: Power tool to use DuckDuckGo from the command-line.DuckDuckGo: Search engine which doesn’t track its users.googler: Power tool to Google (Web & News) and Google Site Search from the command-line.
Package: duckgoose
duckgooseUtility scripts for the onlinefast.aicourse. There are two main parts: one to download and organise arbitrary image classes, and one to highlight what parts of an image is activating the decision for a classification.Utility for Lesson 1 experimentation with external image classes. The script:Downloads images from google images for specific classesSanity checks that images can be opened and have three channelsOrganises the images into separate folders (train/valid/test + classes) as expected by the fast.ai libraryUtility for creating Class Activation Maps for both classifications.Prerequisiteschromedriveris required. On ubuntu/debian:sudo apt-get chromium-chromedriverInstallationpipinstallduckgooseUsageFetching, sanity checking and organising imagesfromduckgooseimportfetchImagesAndPrepForClassification# dictionary structure `class_name => search term`image_classes={'ducks':'ducks -rubber','geese':'geese'}download_path='/home/myuser/data/downloaded_from_google'output_path='/home/myuser/data/ducksgeese/'number_of_images=100fetchImagesAndPrepForClassification(image_classes,download_path,output_path,number_of_images)Create Class Activation Maps (CAM)Note: This was implemented for fastai v2 part 1.
Here is a full example of creating a class activation maps for ducks and geese using fast ai.fromfastai.importsimport*fromfastai.transformsimport*fromfastai.conv_learnerimport*fromfastai.modelimport*fromfastai.datasetimport*fromfastai.sgdrimport*fromfastai.plotsimport*fromduckgoose.camimportcalculateAndChartHeatZoneForPATH="data/ducksgeese/"sz=224arch=resnet34bs=64m=arch(True)m=nn.Sequential(*children(m)[:-2],nn.Conv2d(512,2,3,padding=1),nn.AdaptiveAvgPool2d(1),Flatten(),nn.LogSoftmax())tfms=tfms_from_model(arch,sz,aug_tfms=transforms_side_on,max_zoom=1.1)data=ImageClassifierData.from_paths(PATH,tfms=tfms,bs=bs)learn=ConvLearner.from_model_data(m,data)learn.freeze_to(-4)_,val_tfms=tfms_from_model(learn.model,sz)learn.fit(0.01,2)calculateAndChartHeatZoneFor('./data/ducksgeese/test/ducks/ducks_427.jpg',val_tfms,learn)LicenseThe MIT License (MIT)