latz


Namelatz JSON
Version 0.2.1 PyPI version JSON
download
home_page
SummaryCLI Program for downloading images. Maybe by location too...
upload_time2023-04-09 09:04:44
maintainer
docs_urlNone
authorTravis Hathaway
requires_python>=3.8.1,<4.0.0
licenseGNU v3
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Overview

[pluggy]: https://pluggy.readthedocs.io/en/stable/
[click]: https://click.palletsprojects.com/
[pydantic]: https://docs.pydantic.dev/
[rich]: https://rich.readthedocs.io/
[anaconda.org]: https://anaconda.org
[latz-imgur]: https://github.com/travishathaway/latz-imgur
[creating-plugins]: creating-plugins

This is a command line tool used for retrieving images from various image
search backends (e.g. Unsplash, Google). This tool is primarily developed for educational purposes
to show people how to develop plugin friendly Python applications. Furthermore,
it is an example project that shows how to effectively pair a handful of
popular Python libraries to write command line applications.

To facilitate our plugin architecture, the [pluggy][pluggy] library is used.
Other libraries used include the following:

- [click][click]: used for structuring the command line application 🖱 💻
- [pydantic][pydantic]: used for handling configuration file validation 🗃
- [rich][rich]: used for UX/UI elements and generally making the application more pretty 🌈

### Why "latz"

"latz" is short and easy to type! This is super important when writing CLI programs.
I also might add a geolocation search feature, so it is a reference  to the word "latitude".

## Quick Start

### Installation

latz is available for install either on PyPI:

```bash
# Run from a new virtual environment
$ pip install latz
```

or my own [anaconda.org][anaconda.org] channel:

```bash
$ conda create -n latz 'thath::latz'
```

If you are interested in tinkering around with the code yourself, you can also
run it locally:

```bash
$ git clone git@github.com:/travishathaway/latz.git
$ cd latz
# Create a virtual environment however you like..
$ pip install -e .
```

### Usage

Latz comes initially configured with the "unsplash" image search backend. To use this,
you will need to create an Unsplash account and create a test application. After getting
your "access_key", you can set this value by running this command:

```bash
$ latz config set search_backend_settings.unsplash.access_key=<YOUR_ACCESS_KEY>
```

Once this is configured, you can search Unsplash for bunny pictures:

```bash
$ latz search "bunny"
[
    ImageSearchResultSet(
        results=(
            ImageSearchResult(
                url='https://unsplash.com/photos/u_kMWN-BWyU/download?ixid=MnwzOTMwOTR8MHwxfHNlYXJjaHwxfHxidW5ueXxlbnwwfHx8fDE2Nzk0MTA2NzQ',
                width=3456,
                height=5184
            ),
            # ... results truncated
        ),
        total_number_results=10,
        search_backend='unsplash'
    )
]
```

### Configuring

The configuration for latz is stored in your home direct and is in the JSON format.
Below is a what a default version of this configuration looks like:

```json
{
  "search_backends": [
    "unsplash"
  ],
  "search_backend_settings": {
    "placeholder": {
      "type": "kitten"
    },
    "unsplash": {
      "access_key": "your-access-key"
    }
  }
}
```

_Latz will also search in your current working directory for a `.latz.json` file and use this in your configuration.
Files in the current working directory will be prioritized over your home directory location._

To see other available image search backends, see [Available image search backends](#available-image-search-backends) below.

### Available image search backends

Here are a list of the available search backends:

#### Built-in

- "unsplash"
- "placeholder"

#### Third-party

- [latz-imgur][latz-imgur]

### How to extend and write your own image search backend

Please see the [creating plugins][creating-plugins] guide in the documentation.

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "latz",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8.1,<4.0.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Travis Hathaway",
    "author_email": "travis.j.hathaway@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/09/6c/47a9cf224117f09bf17b62d6b4fb262534601ee449d39fc1e5fae9631c40/latz-0.2.1.tar.gz",
    "platform": null,
    "description": "# Overview\n\n[pluggy]: https://pluggy.readthedocs.io/en/stable/\n[click]: https://click.palletsprojects.com/\n[pydantic]: https://docs.pydantic.dev/\n[rich]: https://rich.readthedocs.io/\n[anaconda.org]: https://anaconda.org\n[latz-imgur]: https://github.com/travishathaway/latz-imgur\n[creating-plugins]: creating-plugins\n\nThis is a command line tool used for retrieving images from various image\nsearch backends (e.g. Unsplash, Google). This tool is primarily developed for educational purposes\nto show people how to develop plugin friendly Python applications. Furthermore,\nit is an example project that shows how to effectively pair a handful of\npopular Python libraries to write command line applications.\n\nTo facilitate our plugin architecture, the [pluggy][pluggy] library is used.\nOther libraries used include the following:\n\n- [click][click]: used for structuring the command line application \ud83d\uddb1 \ud83d\udcbb\n- [pydantic][pydantic]: used for handling configuration file validation \ud83d\uddc3\n- [rich][rich]: used for UX/UI elements and generally making the application more pretty \ud83c\udf08\n\n### Why \"latz\"\n\n\"latz\" is short and easy to type! This is super important when writing CLI programs.\nI also might add a geolocation search feature, so it is a reference  to the word \"latitude\".\n\n## Quick Start\n\n### Installation\n\nlatz is available for install either on PyPI:\n\n```bash\n# Run from a new virtual environment\n$ pip install latz\n```\n\nor my own [anaconda.org][anaconda.org] channel:\n\n```bash\n$ conda create -n latz 'thath::latz'\n```\n\nIf you are interested in tinkering around with the code yourself, you can also\nrun it locally:\n\n```bash\n$ git clone git@github.com:/travishathaway/latz.git\n$ cd latz\n# Create a virtual environment however you like..\n$ pip install -e .\n```\n\n### Usage\n\nLatz comes initially configured with the \"unsplash\" image search backend. To use this,\nyou will need to create an Unsplash account and create a test application. After getting\nyour \"access_key\", you can set this value by running this command:\n\n```bash\n$ latz config set search_backend_settings.unsplash.access_key=<YOUR_ACCESS_KEY>\n```\n\nOnce this is configured, you can search Unsplash for bunny pictures:\n\n```bash\n$ latz search \"bunny\"\n[\n    ImageSearchResultSet(\n        results=(\n            ImageSearchResult(\n                url='https://unsplash.com/photos/u_kMWN-BWyU/download?ixid=MnwzOTMwOTR8MHwxfHNlYXJjaHwxfHxidW5ueXxlbnwwfHx8fDE2Nzk0MTA2NzQ',\n                width=3456,\n                height=5184\n            ),\n            # ... results truncated\n        ),\n        total_number_results=10,\n        search_backend='unsplash'\n    )\n]\n```\n\n### Configuring\n\nThe configuration for latz is stored in your home direct and is in the JSON format.\nBelow is a what a default version of this configuration looks like:\n\n```json\n{\n  \"search_backends\": [\n    \"unsplash\"\n  ],\n  \"search_backend_settings\": {\n    \"placeholder\": {\n      \"type\": \"kitten\"\n    },\n    \"unsplash\": {\n      \"access_key\": \"your-access-key\"\n    }\n  }\n}\n```\n\n_Latz will also search in your current working directory for a `.latz.json` file and use this in your configuration.\nFiles in the current working directory will be prioritized over your home directory location._\n\nTo see other available image search backends, see [Available image search backends](#available-image-search-backends) below.\n\n### Available image search backends\n\nHere are a list of the available search backends:\n\n#### Built-in\n\n- \"unsplash\"\n- \"placeholder\"\n\n#### Third-party\n\n- [latz-imgur][latz-imgur]\n\n### How to extend and write your own image search backend\n\nPlease see the [creating plugins][creating-plugins] guide in the documentation.\n",
    "bugtrack_url": null,
    "license": "GNU v3",
    "summary": "CLI Program for downloading images. Maybe by location too...",
    "version": "0.2.1",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0298daf7998377a053f17c171160609dc93260b9d07626b1030fd17bac5d876",
                "md5": "5747bc4804c2132f400b563f1710d2b2",
                "sha256": "013dcf2aaaebf1b9c923c65a195b74301c424acce0ac2d9322d10fded66b813a"
            },
            "downloads": -1,
            "filename": "latz-0.2.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5747bc4804c2132f400b563f1710d2b2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 31837,
            "upload_time": "2023-04-09T09:04:42",
            "upload_time_iso_8601": "2023-04-09T09:04:42.467599Z",
            "url": "https://files.pythonhosted.org/packages/b0/29/8daf7998377a053f17c171160609dc93260b9d07626b1030fd17bac5d876/latz-0.2.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "096c47a9cf224117f09bf17b62d6b4fb262534601ee449d39fc1e5fae9631c40",
                "md5": "8ddb2a51207cd3fb254cae336f6d1bbd",
                "sha256": "f2064d9589c8554cd3c35ab48ffa71bd3005b541227358c42b6531fa5dc573c0"
            },
            "downloads": -1,
            "filename": "latz-0.2.1.tar.gz",
            "has_sig": false,
            "md5_digest": "8ddb2a51207cd3fb254cae336f6d1bbd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8.1,<4.0.0",
            "size": 28021,
            "upload_time": "2023-04-09T09:04:44",
            "upload_time_iso_8601": "2023-04-09T09:04:44.258589Z",
            "url": "https://files.pythonhosted.org/packages/09/6c/47a9cf224117f09bf17b62d6b4fb262534601ee449d39fc1e5fae9631c40/latz-0.2.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-09 09:04:44",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "latz"
}
        
Elapsed time: 0.10974s