actionsheets


Nameactionsheets JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://actionsheets.streamlit.app/
SummaryProvides a large collection of searchable quick-reference code-snippet sheets defined in terms of a desired action and corresponding code snippet.
upload_time2024-08-19 22:30:09
maintainerNone
docs_urlNone
authorNiek Den Teuling
requires_python<4.0,>=3.11
licenseMIT
keywords cheatsheets code snippets quick reference
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # actionsheets

**Actionsheets** is an open-source (hobby) project with a different take on cheatsheets. 
Standard cheatsheets are great for getting started, but don't get into the details for advanced or complex use cases. 
This is where actionsheets come in.

This Python package provides a large collection of code snippets, and can render them in the form of _actionsheets_. Actionsheets are grouped look-up tables by action/intended outcome, and a code snippet to achieve it.
The package is intended for (new) developers to quickly look-up how to perform common actions for the given topic, but also contains some more advanced actions.

The package can print actionsheets in the console with coloring and syntax highlighting, but ideally, the package is used by other (better) front-end implementations. See the [streamlit dashboard](https://github.com/niekdt/actionsheets-streamlit) implementation, for example.


## How do actionsheets differ from cheatsheets?
- Actionsheets are expressed in terms of a desired *action* or result, and the code snippet(s) to achieve it.
  - This is a more natural way to look up code snippets. Especially useful for beginners.
- Actions may be complex or comprise multiple steps.
  - Actions are not limited to the direct functionality provided by the package API. 
  - Cheatsheets typically lack more advanced compound use cases.
- Code snippets are data; enabling dynamic generation of sheets depending on user queries
  - Sheets can therefore be more feature-complete, as they do not need fit on a single page.
    
This way of organizing sheets is especially useful for packages or functions with powerful versatile functionality, where merely listing the API does not cover the full capabilities. 

## Install
To install the latest release:
```shell
pip install actionsheets
```

To install according to the latest commit:
```shell
pip install git+https://github.com/niekdt/actionsheets.git
```

```shell
poetry add git+https://github.com/niekdt/actionsheets.git
```

## Contributing
Actionsheets are defined using [TOML](https://toml.io/) files. 
This makes it very easy to define a hierarchy of code snippets in a readable way.

Defining a code snippet belonging to the _Create_ section of the respective actionsheet file is as simple as:
```toml
[create.list]
action = "Define a list"
code = "x = ['apple', 'pear', 'banana']"
details = "You can define as many items as you like"
```

For submitting code snippets or complete actionsheets, submit a PR to [actionsheets on Github](https://github.com/niekdt/actionsheets).


## Actionsheet structure
Sheets are hierarchically structured using sections. The main sections are:

1. **Create**  
How to define, instantiate or create the data type, possibly from other types.  
_Examples: define a date, parse date from string, create set from a list of values._
2. **Test**  
Check or assess something about the object.  
_Examples: is it empty? does it contain a given value?_
3. **Extract** 
Get properties, attributes, or other information about the object _of a different type than the object_ (typically scalars).  
_Examples: length of a list, element value at a given index, max value among elements._
4. **Derive / Update**
Create a derived or altered object from the given object, preserving the object type, or _update_ the object in-place / by-reference.  
_Examples: head of a list, slicing a string, selecting conditional rows from a data frame._
5. **Convert**
Export / represent the object as a different data type.  
_Examples: datetime as string, dictionary as list of key-value pairs, data frame as matrix._

### Extract
Get properties, attributes, or other information about the object _of a different type than the object_ (typically scalars). 

| Subcategory    | Description                                                                              | Examples                                                                  |
|----------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|
| **Properties** | Retrieve properties or attributes of the object.                                         | Length of a list, number of columns of a data frame.                      |
| **Find**       | Attempt to find a value or index of an object, typically with index output.              | Find max value, find index of min value, find key of most frequent value. |
| **Aggregate**  | Aggregate the object in a way that involves a computation, typically with scalar output. | Sum all elements of a list, number of occurrences per value               |


### Derive / update
| Subcategory   | Description                                                                                                                                                         | Examples                                                                                                         |
|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|
| **Transform** | Apply a [transformation](https://en.wikipedia.org/wiki/Data_transformation_(statistics)) to the object or each of its elements, preserving the shape of the object. | Element-wise operations such as adding a constant to a vector, or computing the cumulative sum over the elements |
| **Order**     | Change the order of elements, but not their values.                                                                                                                 | Reversing the elements of a list, sorting a data frame by column values                                          |
| **Reshape**   | Change the shape of the object, but preserves all elements.                                                                                                         | Transposing a matrix, converting a data frame to narrow format.                                                  |
| **Grow**      | Possibly increase the number of elements of the object.                                                                                                             | Appending elements to a list, replicating elements.                                                              |
| **Shrink**    | Possibly reduce the number of elements of the object.                                                                                                               | Removing elements from a list, removing duplicates.                                                              |
| **Combine**   | Combine, merge or join two or more objects.                                                                                                                         | Stacking lists, set union, joining two data frames.                                                              |


## Motivation
My motivation for building this curated database of code snippet is out of frustration of the worsening state of the internet in quickly finding short answers to straightforward queries.

- Many website have the code snippet(s) buried between tons of irrelevant text just for SEO optimization.
- The quality of (accepted) answers on Stackoverflow is severely lacking for some programming languages:
  - Answers are out of date
  - Answers are overly complicated, inefficient, or nonfunctional (contributions by beginners)
  - For the future, this also means that the answers by any LLM are going to have the same issues. 
- The answer on the site was for a different question
- The answer on the site was for a more narrow question
- With the increasing usage of LLMs, the problem of bloated low-quality answer results will only get worse.
     

            

Raw data

            {
    "_id": null,
    "home_page": "https://actionsheets.streamlit.app/",
    "name": "actionsheets",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.11",
    "maintainer_email": null,
    "keywords": "cheatsheets, code snippets, quick reference",
    "author": "Niek Den Teuling",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/d1/18/8954e80b41f72e969adaee1401828425ccf1415587166f68fcc0be34e534/actionsheets-0.3.0.tar.gz",
    "platform": null,
    "description": "# actionsheets\n\n**Actionsheets** is an open-source (hobby) project with a different take on cheatsheets. \nStandard cheatsheets are great for getting started, but don't get into the details for advanced or complex use cases. \nThis is where actionsheets come in.\n\nThis Python package provides a large collection of code snippets, and can render them in the form of _actionsheets_. Actionsheets are grouped look-up tables by action/intended outcome, and a code snippet to achieve it.\nThe package is intended for (new) developers to quickly look-up how to perform common actions for the given topic, but also contains some more advanced actions.\n\nThe package can print actionsheets in the console with coloring and syntax highlighting, but ideally, the package is used by other (better) front-end implementations. See the [streamlit dashboard](https://github.com/niekdt/actionsheets-streamlit) implementation, for example.\n\n\n## How do actionsheets differ from cheatsheets?\n- Actionsheets are expressed in terms of a desired *action* or result, and the code snippet(s) to achieve it.\n  - This is a more natural way to look up code snippets. Especially useful for beginners.\n- Actions may be complex or comprise multiple steps.\n  - Actions are not limited to the direct functionality provided by the package API. \n  - Cheatsheets typically lack more advanced compound use cases.\n- Code snippets are data; enabling dynamic generation of sheets depending on user queries\n  - Sheets can therefore be more feature-complete, as they do not need fit on a single page.\n    \nThis way of organizing sheets is especially useful for packages or functions with powerful versatile functionality, where merely listing the API does not cover the full capabilities. \n\n## Install\nTo install the latest release:\n```shell\npip install actionsheets\n```\n\nTo install according to the latest commit:\n```shell\npip install git+https://github.com/niekdt/actionsheets.git\n```\n\n```shell\npoetry add git+https://github.com/niekdt/actionsheets.git\n```\n\n## Contributing\nActionsheets are defined using [TOML](https://toml.io/) files. \nThis makes it very easy to define a hierarchy of code snippets in a readable way.\n\nDefining a code snippet belonging to the _Create_ section of the respective actionsheet file is as simple as:\n```toml\n[create.list]\naction = \"Define a list\"\ncode = \"x = ['apple', 'pear', 'banana']\"\ndetails = \"You can define as many items as you like\"\n```\n\nFor submitting code snippets or complete actionsheets, submit a PR to [actionsheets on Github](https://github.com/niekdt/actionsheets).\n\n\n## Actionsheet structure\nSheets are hierarchically structured using sections. The main sections are:\n\n1. **Create**  \nHow to define, instantiate or create the data type, possibly from other types.  \n_Examples: define a date, parse date from string, create set from a list of values._\n2. **Test**  \nCheck or assess something about the object.  \n_Examples: is it empty? does it contain a given value?_\n3. **Extract** \nGet properties, attributes, or other information about the object _of a different type than the object_ (typically scalars).  \n_Examples: length of a list, element value at a given index, max value among elements._\n4. **Derive / Update**\nCreate a derived or altered object from the given object, preserving the object type, or _update_ the object in-place / by-reference.  \n_Examples: head of a list, slicing a string, selecting conditional rows from a data frame._\n5. **Convert**\nExport / represent the object as a different data type.  \n_Examples: datetime as string, dictionary as list of key-value pairs, data frame as matrix._\n\n### Extract\nGet properties, attributes, or other information about the object _of a different type than the object_ (typically scalars). \n\n| Subcategory    | Description                                                                              | Examples                                                                  |\n|----------------|------------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| **Properties** | Retrieve properties or attributes of the object.                                         | Length of a list, number of columns of a data frame.                      |\n| **Find**       | Attempt to find a value or index of an object, typically with index output.              | Find max value, find index of min value, find key of most frequent value. |\n| **Aggregate**  | Aggregate the object in a way that involves a computation, typically with scalar output. | Sum all elements of a list, number of occurrences per value               |\n\n\n### Derive / update\n| Subcategory   | Description                                                                                                                                                         | Examples                                                                                                         |\n|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------|\n| **Transform** | Apply a [transformation](https://en.wikipedia.org/wiki/Data_transformation_(statistics)) to the object or each of its elements, preserving the shape of the object. | Element-wise operations such as adding a constant to a vector, or computing the cumulative sum over the elements |\n| **Order**     | Change the order of elements, but not their values.                                                                                                                 | Reversing the elements of a list, sorting a data frame by column values                                          |\n| **Reshape**   | Change the shape of the object, but preserves all elements.                                                                                                         | Transposing a matrix, converting a data frame to narrow format.                                                  |\n| **Grow**      | Possibly increase the number of elements of the object.                                                                                                             | Appending elements to a list, replicating elements.                                                              |\n| **Shrink**    | Possibly reduce the number of elements of the object.                                                                                                               | Removing elements from a list, removing duplicates.                                                              |\n| **Combine**   | Combine, merge or join two or more objects.                                                                                                                         | Stacking lists, set union, joining two data frames.                                                              |\n\n\n## Motivation\nMy motivation for building this curated database of code snippet is out of frustration of the worsening state of the internet in quickly finding short answers to straightforward queries.\n\n- Many website have the code snippet(s) buried between tons of irrelevant text just for SEO optimization.\n- The quality of (accepted) answers on Stackoverflow is severely lacking for some programming languages:\n  - Answers are out of date\n  - Answers are overly complicated, inefficient, or nonfunctional (contributions by beginners)\n  - For the future, this also means that the answers by any LLM are going to have the same issues. \n- The answer on the site was for a different question\n- The answer on the site was for a more narrow question\n- With the increasing usage of LLMs, the problem of bloated low-quality answer results will only get worse.\n     \n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Provides a large collection of searchable quick-reference code-snippet sheets defined in terms of a desired action and corresponding code snippet.",
    "version": "0.3.0",
    "project_urls": {
        "Homepage": "https://actionsheets.streamlit.app/",
        "Issue tracker": "https://github.com/niekdt/actionsheets/issues",
        "Repository": "https://github.com/niekdt/actionsheets"
    },
    "split_keywords": [
        "cheatsheets",
        " code snippets",
        " quick reference"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6527372ad46ce69eb252019f2a8582fdc0e750dac30e8189a62fd05b68ccc52e",
                "md5": "6c70d427d3679ef62a269a8ec4299356",
                "sha256": "8f2582fc33f5bdd6c3f6c083733d667fff56be57b195ff26a0a82303aa81002a"
            },
            "downloads": -1,
            "filename": "actionsheets-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6c70d427d3679ef62a269a8ec4299356",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.11",
            "size": 100167,
            "upload_time": "2024-08-19T22:30:08",
            "upload_time_iso_8601": "2024-08-19T22:30:08.083102Z",
            "url": "https://files.pythonhosted.org/packages/65/27/372ad46ce69eb252019f2a8582fdc0e750dac30e8189a62fd05b68ccc52e/actionsheets-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d1188954e80b41f72e969adaee1401828425ccf1415587166f68fcc0be34e534",
                "md5": "2f4d268c037613914becda5f5a138c8d",
                "sha256": "86b4ef714d71e6a2745da5e82d9e81828363eca58677e5f0ff6abf23bba5b8a5"
            },
            "downloads": -1,
            "filename": "actionsheets-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "2f4d268c037613914becda5f5a138c8d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.11",
            "size": 78883,
            "upload_time": "2024-08-19T22:30:09",
            "upload_time_iso_8601": "2024-08-19T22:30:09.453901Z",
            "url": "https://files.pythonhosted.org/packages/d1/18/8954e80b41f72e969adaee1401828425ccf1415587166f68fcc0be34e534/actionsheets-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-19 22:30:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "niekdt",
    "github_project": "actionsheets",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "actionsheets"
}
        
Elapsed time: 0.29889s