Saravanan666/pypi-org huggingface dataset:
Package: datasette-short-links
datasette-short-linksA URL link shortener for Datasette. Work in progress!InstallationThis plugin requires an alpha version of Datasette 1.0, because it usesDatasette's internal databaseintroduced in1.0a5.pip install datasette==1.0a5After than, you can install this plugin in the same environment as Datasette.datasette install datasette-short-linksUsageOnce installed, the bottom of each page with have a "Copy URL" button at the bottom of that page. That URL will link directly back to the same page.A short URL will look something like:http://localhost:8001/-/l/01h973jcqspxrhzy00zebhx748To take full advantage of this plugin, use a persistent internal database to store links even after your Datasette instance exits. This can be done with the--internalflag:datasette --internal internal.db my_data.dbDevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-short-links
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-simple-html
datasette-simple-htmlDatasette SQL functions for very simple HTML operationsInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-simple-htmlUsageThis plugin provides the following SQL functions:html_strip_tags(text)Returns the text with any<...>tags removed.html_escape(text)Escapes any HTML special characters in the text, e.g.>becomes&gt;. Useshtml.escape(text, quote=True)from the Python standard library.html_unescape(text)Unescapes any HTML special characters, so&gt;becomes>. Also handles numeric entities, so&#x27;becomes'. Useshtml.unescape(text)from the Python standard library.DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-simple-html
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-socrata
datasette-socrataImport data from Socrata into DatasetteInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-socrataUsageMake sure you haveenabled WAL modeon your database files before using this plugin.Once installed, an interface for importing data from Socrata will become available at this URL:/-/import-socrataUsers will be able to paste in a URL to a dataset on Socrata in order to initialize an import.You can also pre-fill the form by passing a?url=parameter, for example:/-/import-socrata?url=https://data.sfgov.org/City-Infrastructure/Street-Tree-List/tkzw-k3nqAny database that is attached to Datasette, is NOT loaded as immutable (with the-ioption) and that has WAL mode enabled will be available for users to import data into.Theimport-socratapermission governs access. By default therootactor (accessible usingdatasette --rootto start Datasette) is granted that permission.You can use permission plugins such asdatasette-permissions-sqlto grant additional access to other users.ConfigurationIf you only want Socrata imports to be allowed to a specific database, you can configure that using plugin configration inmetadata.yml:plugins:datasette-socrata:database:socrataDevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-socrata
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-spotify-embed
datasette-spotify-embedTurn Spotify track URIs into iframe embeds in the Datasette interfaceInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-spotify-embedUsageUsage instructions go here.DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-spotify-embed
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-sqlite-authorizer
datasette-sqlite-authorizerConfigure Datasette to block operations using the SQLite set_authorizer mechanismInstallationInstall this plugin in the same environment as Datasette.datasetteinstalldatasette-sqlite-authorizerUsageThis plugin currently offers a single configuration option:read_only_tables. You can use this to specify a list of tables that should be read-only.If a table is read-only, any attempt to write to it -insert,update,delete,drop table,alter table- will be denied with an error message.To configure read-only tables, add the following to yourmetadata.yamlfile:plugins:datasette-sqlite-authorizer:read_only_tables:-table:my_tabledatabase:my_databaseYou can omit thedatabasekey if you want to apply the same rule to all databases.Here's how to use this plugin to make all tables relating toLitestreamsynchronization read-only, across all attached databases:plugins:datasette-sqlite-authorizer:read_only_tables:-table:_litestream_lock-table:_litestream_seqDevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-sqlite-authorizer
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-sqlite-debug-authorizer
datasette-sqlite-debug-authorizerDebug SQLite authorizer callsInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-sqlite-debug-authorizerUsageOnce installed, every SQLite permission check using theconn.set_authorizer()API will be logged to standard error.This is useful for if you want to use that authorizer API to implement your own custom permissions, and need to see what calls are being made to the authorizer.Example output (it's generally a lot noisier than this) forselect * from sqlite_master:SQLITE_SELECT: 
SQLITE_READ:  table="sqlite_master" column="type" db_name=main
SQLITE_READ:  table="sqlite_master" column="name" db_name=main
SQLITE_READ:  table="sqlite_master" column="tbl_name" db_name=main
SQLITE_READ:  table="sqlite_master" column="rootpage" db_name=main
SQLITE_READ:  table="sqlite_master" column="sql" db_name=mainDevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-sqlite-debug-authorizer
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-sqlite-fts4
datasette-sqlite-fts4Datasette plugin that exposes the custom SQL functions fromsqlite-fts4.Interactive demo. ReadExploring search relevance algorithms with SQLitefor further details on this project.Installationpip install datasette-sqlite-fts4If you are deploying a database usingdatasette publishyou can include this plugin using the--installoption:datasette publish now mydb.db --install=datasette-sqlite-fts4
Package: datasette-sqlite-url-lite
datasette-sqlite-url-liteA pure Python alternative tosqlite-urlready to be used inDatasette LiteInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-sqlite-url-liteOr add it to Datasette Lite withhttps://lite.datasette.io/?install=datasette-sqlite-url-lite.UsageThis plugin adds the following SQL functions:selecturl_valid('https://sqlite.org');-- 1selecturl_scheme('https://www.sqlite.org/vtab.html#usage');-- 'https'selecturl_host('https://www.sqlite.org/vtab.html#usage');-- 'www.sqlite.org'selecturl_path('https://www.sqlite.org/vtab.html#usage');-- '/vtab.html'selecturl_fragment('https://www.sqlite.org/vtab.html#usage');-- 'usage'DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-sqlite-url-lite
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-statistics
datasette-statisticsSQL statistics functions for DatasetteInstallationInstall this plugin in the same environment as Datasette.datasetteinstalldatasette-statisticsUsageThis plugin adds new SQL aggregate functions for use within Datasette:statistics_mean()for calculating themeanstatistics_geometric_mean()for calculating thegeometric mean(requires Python 3.8+)statistics_median()for calculating themedianstatistics_median_low()for calculating thelow medianstatistics_median_high()for calculating thehigh medianstatistics_mode()for calculating themodestatistics_stdev()for calculating thesample standard deviationstatistics_pstdev()for calculating thepopulation standard deviationstatistics_variance()for calculating thesample variancestatistics_pvariance()for calculating thepopulation varianceThese all use the implementations from thePython statistics library.Use them like this:selectstatistics_mean(numeric_column)frommytableDevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cddatasette-statistics
python3-mvenvvenvsourcevenv/bin/activateOr if you are usingpipenv:pipenvshellNow install the dependencies and test dependencies:pipinstall-e'.[test]'To run the tests:pytest
Package: datasette-studio
datasette-studioDatasette pre-configured with useful plugins.Experimental alpha release. This is an early experiment at the moment.InstallationThis tool makes Datasette (currently the 1.0 alpha series) available asdatasette-studiowith a set of useful plugins pre-installed.It isstronglyrecommended to install this usingpipx, since doing so will ensure that this version of Datasette has its own isolated environment.pipxinstalldatasette-studioUsageFor help, run:datasette-studio--helpTo list available plugins run:datasette-studiopluginsTo install additional plugins use:datasette-studioinstalldatasette-graphqlThedatasette-studiocommand is an alias for regulardatasette, soconsult the Datasette documentationfor more information on how to use it.
Package: datasette-surveys
datasette-surveysConstruct and gather responses to surveys all within Datasette!This plugin is based heavily on the officially amazing but unsupportedAlpaca form builder.Installationpython setup.py installUsageThe plugin adds an interface at/-/surveysand a "Surveys" link in the menu.Configuration & PermissionsThis plugin uses the permission plugin looking for responses to the following actions (they all start withsurveys-):surveys-list: allows actors to view the list of previously created surveys.surveys-create: allows actors to create surveys. Won't allow overwriting by itself.surveys-update: allows actors to update surveys,resource: id of the survey if being updated. This permission doesn't stop actors from updating with blank surveys or otherwise removing fields.surveys-delete: allows actors to delete surveys.resource: id of the survey being deleted.surveys-view-form: allows actors to view and respond to individual forms.resource: id of the survey.One configuration option is available, which controls which directory the surveys folder will be placed.# in your metadata.yml...
plugins:
  datasette-surveys:
    db_dir: /path/to/dataBy default, the current working directory for the Datasette process will be used (assumed to be the same as the other DBs).DevelopmentThe form builder borrows heavily fromAlpaca's form builderand the front end build also comes from the Alpaca repo.To pull the dependencies for the plugin, use bower:bower installAnd if you don't have bower, run this first:npm install -g bowerThe form builder is found indatasette_surveys/static/form-builder.js. It's a modified version of the Alpaca one.Runningpython setup.py installwill reinstall the plugin.
Package: datasette-tailwindcss
datasette-tailwindcssReplace default template with tailwindcssInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-tailwindcssUsageUsage instructions go here.DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-tailwindcss
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-template-request
datasette-template-requestExpose the Datasette request object to custom templatesInstallationInstall this plugin in the same environment as Datasette.$ datasette install datasette-template-requestUsageOnce this plugin is installed, Datasettecustom templatescan use{{ request }}to access the currentrequest object. For example, to access?name=Cleoin the query string a template could use this:Name: {{ request.args.name }}DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-template-request
python3 -mvenv venv
source venv/bin/activateOr if you are usingpipenv:pipenv shellNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-template-sql
datasette-template-sqlDatasette plugin for executing SQL queries from templates.Exampleswww.niche-museums.comuses this plugin to run a custom themed website on top of Datasette. The full source code for the siteis here- see alsoniche-museums.com, powered by Datasette.simonw/tilis another simple example, described inUsing a self-rewriting README powered by GitHub Actions to track TILs.InstallationRun this command to install the plugin in the same environment as Datasette:$ pip install datasette-template-sqlUsageThis plugin makes a new function,sql(sql_query), available to your Datasette templates.You can use it like this:{%forrowinsql("select 1 + 1 as two, 2 * 4 as eight")%}{%forkeyinrow.keys()%}{{key}}:{{row[key]}}<br>{%endfor%}{%endfor%}The plugin will execute SQL against the current database for the page indatabase.html,table.htmlandrow.htmltemplates. If a template does not have a current database (index.htmlfor example) the query will execute against the first attached database.Queries with argumentsYou can construct a SQL query using?or:nameparameter syntax by passing a list or dictionary as a second argument:{%forrowinsql("select distinct topic from til order by topic")%}<h2>{{row.topic}}</h2><ul>{%fortilinsql("select * from til where topic = ?",[row.topic])%}<li><ahref="{{til.url}}">{{til.title}}</a>-{{til.created[:10]}}</li>{%endfor%}</ul>{%endfor%}Here's the same example using the:topicstyle of parameters:{%forrowinsql("select distinct topic from til order by topic")%}<h2>{{row.topic}}</h2><ul>{%fortilinsql("select * from til where topic = :topic",{"topic":row.topic})%}<li><ahref="{{til.url}}">{{til.title}}</a>-{{til.created[:10]}}</li>{%endfor%}</ul>{%endfor%}Querying a different databaseYou can pass an optionaldatabase=argument to specify a named database to use for the query. For example, if you have attached anews.dbdatabase you could use this:{%forarticleinsql("select headline, date, summary from articles order by date desc limit 5",database="news")%}<h3>{{article.headline}}</h2><pclass="date">{{article.date}}</p><p>{{article.summary}}</p>{%endfor%}
Package: datasette-test
datasette-testUtilities to help write tests for Datasette plugins and applicationsInstallationInstall this library usingpip:pipinstalldatasette-testTests that use plugin configurationDatasette 1.0a8 enforced a configuration change where plugins are no longer configured in metadata, but instead use a configuration file.This can result in test failures in projects that use theDatasette(metadata={"plugins": {"...": "..."}})pattern to test out plugin configuration.You can solve this usingdatasette_test.Datasette, a subclass that works with Datasette versions both before and after this breaking change:fromdatasette_testimportDatasetteimportpytest@pytest.mark.asyncioasyncdeftest_datasette():ds=Datasette(plugin_config={"my-plugin":{"config":"goes here"})This subclass detects if the underlying plugin needs configuration in metadata or config and instantiates the class correctly either way.You can also use this class while continuing to passmetadata={"plugins": ...}- the class will move that configuration to config when necessary.wait_until_responds(url, timeout=5.0)Some Datasette plugin test suites launch a Datasette server and then need to wait for that server to become available before continuing.Call this function to wait until the server becomes available, or raise an error if it takes longer than the timeout:fromdatasette_testimportwait_until_respondsdeftest_server():# ... start server ...wait_until_responds("http://localhost:8001")# Now run testsDevelopmentTo contribute to this library, first checkout the code. Then create a new virtual environment:cddatasette-test
python-mvenvvenvsourcevenv/bin/activateNow install the dependencies and test dependencies:pipinstall-e'.[test]'To run the tests:pytest
Package: datasette-tiddlywiki
datasette-tiddlywikiRunTiddlyWikiin Datasette and save Tiddlers to a SQLite databaseInstallationInstall this plugin in the same environment as Datasette.$ datasette install datasette-tiddlywikiUsageStart Datasette with atiddlywiki.dbdatabase. You can create it if it does not yet exist using--create.You need to be signed in as therootuser to write to the wiki, so use the--rootoption and click on the link it provides:% datasette tiddlywiki.db --create --root
http://127.0.0.1:8001/-/auth-token?token=456670f1e8d01a8a33b71e17653130de17387336e29afcdfb4ab3d18261e6630
# ...Navigate to/-/tiddlywikion your instance to interact with TiddlyWiki.Authentication and permissionsBy default, the wiki can be read by anyone who has permission to read thetiddlywiki.dbdatabase. Only the signed inrootuser can write to it.You can sign in using the--rootoption described above, or you can set a password for that user using thedatasette-auth-passwordsplugin and sign in using the/-/loginpage.You can use theedit-tiddlywikipermission to grant edit permisions to other users, using another plugin such asdatasette-permissions-sql.You can use theview-databasepermission against thetiddlywikidatabase to control who can view the wiki.Datasette's permissions mechanism is described in full inthe Datasette documentation.DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-tiddlywiki
python3 -mvenv venv
source venv/bin/activateOr if you are usingpipenv:pipenv shellNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-total-page-time
datasette-total-page-timeAdd a note to the Datasette footer measuring the total page load timeInstallationInstall this plugin in the same environment as Datasette.datasette install datasette-total-page-timeUsageOnce this plugin is installed, a note will appear in the footer of every page showing how long the page took to generate.Queries took 326.74ms · Page took 386.310msHow it worksMeasuring how long a page takes to load and then injecting that note into the page is tricky, because you need to finish generating the page before you know how long it took to load it!This plugin uses theasgi_wrapperplugin hook to measure the time taken by Datasette and then inject the following JavaScript at the bottom of the response, after the closing</html>tag but with the correct measured value:<script>letfooter=document.querySelector("footer");if(footer){letms=37.224;lets=` &middot; Page took${ms.toFixed(3)}ms`;footer.innerHTML+=s;}</script>This script is injected only on pages with thetext/htmlcontent type - so it should not affect JSON or CSV returned by Datasette.DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-total-page-time
python3 -mvenv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-ui-extras
datasette-ui-extrasThis plugin aims to be a batteries-included theme that makes Datasette more like a self-hosted Airtable or Notion.You can share read-only access, while still allowing authenticated users to edit data.DemoYou can see a demo athttps://dux.fly.dev/User documentationSee our documentation site athttps://dux.cldellow.comDevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-ui-extras
python3 -m venv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest
Package: datasette-unsafe-actor-debug
datasette-unsafe-actor-debugDebug plugin that lets you imitate any actor.Only use this for debugging purposes.InstallationInstall this plugin in the same environment as Datasette.datasetteinstalldatasette-unsafe-actor-debugConfigurationYou need to set the following plugin configuration to enable this tool:plugins:datasette-unsafe-actor-debug:enabled:trueWith Datasette 1.0 alpha you can enable it like this:datasette-splugins.datasette-unsafe-actor-debug.enabled1UsageThis plugin adds a public page at/-/unsafe-actorthat lets you sign into Datasette asanyactor.This option will also be available through the Datasette global navigation menu.Do not enable this tool in production!DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cddatasette-unsafe-actor-debug
python3-mvenvvenvsourcevenv/bin/activateNow install the dependencies and test dependencies:pipinstall-e'.[test]'To run the tests:pytest
Package: datasette-unsafe-expose-env
datasette-unsafe-expose-envDatasette plugin to expose some environment variables at/-/env- for debugging:warning:This plugin is no longer maintained.datasette-expose-envis recommended as a safe replacement that only exposes environment variables that you have explicitly configured.InstallationInstall this plugin in the same environment as Datasette.$ datasette install datasette-unsafe-expose-envUsageOnce installed, the plugin will show a list of environment variables at/-/envIt will redact the following variables by default:DATABASE_URLGPG_KEYDATASETTE_SECRETYou can configure an alternative set of redacted secrets in yourmetadata.ymlconfiguration:plugins:datasette-unsafe-expose-env:redact:-DATASETTE_SECRET-GPG_KEY-MY_OTHER_SECRETOnce again though: only use this plugin if you need it for debugging purposes and are absolutely certain it won't expose any valuable information. If in doubt, do not use this at all.DevelopmentTo set up this plugin locally, first checkout the code. Then create a new virtual environment:cd datasette-unsafe-expose-env
python3 -mvenv venv
source venv/bin/activateNow install the dependencies and test dependencies:pip install -e '.[test]'To run the tests:pytest