deviousq


Namedeviousq JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryDeviantArt RSS API querying utility
upload_time2024-08-09 20:05:20
maintainerNone
docs_urlNone
authorNone
requires_python>=3.6
licenseMIT
keywords deviantart cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            `deviousq` is a command-line utility for querying the RSS API endpoint of the
online art sharing community DeviantArt.

It supports a variety of filters, asynchronous bulk downloading, and multiple
metadata output formats including JSON and CSV.

## Installation
To install from PyPI, run:

```
pip install deviousq
```

To clone the source repository, run:

```
git clone git@gitlab.com:afeder/deviousq.git
```

## Usage
```
usage: deviousq [-h] [-v] [-e ENDPOINT] [-q] [-l LIMIT] [-r ORDER] [-i OFFSET] [-p PAGE] [-P PAGES]
                [--start-date START_DATE] [--end-date END_DATE] [--rating RATING] [--medium MEDIUM]
                [--author AUTHOR] [--gallery GALLERY] [--min-width MIN_WIDTH] [--max-width MAX_WIDTH]
                [--min-height MIN_HEIGHT] [--max-height MAX_HEIGHT] [--no-blurred-content] [--no-query-author]
                [-o OUTPUT_TO] [-t {flat,json,csv}] [-k RETURN_FIELD] [-d DOWNLOAD_TO]
                [--skip-download-exists]
                [search_terms ...]
```

By default, the utility queries the official DeviantArt endpoint for a list of
items ("deviations") related to zero or more search terms.

If the value of the `--order` option is 9 or "popularity", the list is ordered
by most popular first (this is the server-side default); if the value of
`--order` is 5 or "time", the list is ordered by newest first (this is forced
for queries on author or gallery).

An offset into the list may be specified with the `--offset` option, and an
upper limit on the number of items to return from the list per query (up to a
maximum of 60) may be specified with the `--limit` option.

If a page number is specified with the `--page` option, the effective offset is
increased by the page number multiplied by the limit. If a number of pages to
return is specified with the `--pages` option, the endpoint is queried up to
that number of times to return all items contained in that number of consecutive
pages.

The list of items to return may be reduced by applying any number of filters on
publication date (`--start-date` and `--end-date`), maturity rating
(`--rating`), content medium (`--medium`), author username (`--author`), gallery
name (`--gallery`), and content width (`--min-width` and `--max-width`) and
height (`--min-height` and `--max-height`).

In default operation, a flat list with one URL representing each resulting
item, separated by newline characters, is output to `stdout`; if a field name
is specified with the `--return-field` option, then the value of the given
field is output for each result in flat mode. If a different output format
is specified with `--output-format`, a wider range of metadata is output for
each result in the given serialization format. If a download directory is
specified with the `--download-to` option, then the content URL of each result
is downloaded to that directory, and only the relative path to each
downloaded file is output. Finally if the `--return-query` flag is specified,
no queries are executed at all; instead only the URLs of the queries
corresponding to the input options are output.

If an output file is specified with `--output-to`, the generated output is
written to that file instead of `stdout`.

Run the command with the option `--help` for a list of descriptions of all
supported command-line options.

## Examples
Get a list of URLs of deviations related to the search term `ocean`, sorted
according to the server-side default (most popular first):

```
deviousq ocean
```

Get a list of URLs of deviations related to the search term `forest`, sorted by
newest first:

```
deviousq forest --order time
```

Get 5 pages of up to 30 results each with the URLs of deviations related to the
search term `landscapes`:

```
deviousq --pages 5 --limit 30 landscapes
```

Get a list of URLs of deviations posted by the user `spyed`, sorted according to
the only order supported by the server (newest first):

```
deviousq --author spyed
```

Get a list of URLs of deviations posted by the user `spyed` to their "Featured"
gallery (the gallery identifier was obtained manually by visiting the user's
web page on DeviantArt and looking at the address of the link to the gallery),
sorted according to the only order supported by the server (newest first):

```
deviousq --gallery spyed/4788
```

Get a list of URLs of the content media of deviations related to the search term
`portrait`:

```
deviousq --return-field content_url portrait
```

Download the content media of deviations related to the search term
`magicalrealms` to the directory `/tmp/downloads`:

```
deviousq --download-to /tmp/downloads magicalrealms
```

Get a list of deviations related to the search term `painting` and output their
metadata in JSON format to the file `/tmp/results.json`:

```
deviousq --output-format json --output-to /tmp/results.json painting
```

## Supported item fields
`deviousq` exposes the following RSS metadata fields for each query result item,
where available:

| Field key          | RSS field                                    | Description                       |
|--------------------|----------------------------------------------|-----------------------------------|
| `title`            | `/channel/item/title`                        | Title                             |
| `link`             | `/channel/item/link`                         | Item information page URL         |
| `pub_date`         | `/channel/item/pubDate`                      | Publication date                  |
| `rating`           | `/channel/item/media:rating`                 | Maturity rating                   |
| `authors`          | `/channel/item/media:credit[@role='author']` | Author information                |
| `author`           | (first author credit value)                  | Author username                   |
| `avatar`           | (second author credit value)                 | Author avatar URL                 |
| `copyright`        | `/channel/item/media:copyright`              | Copyright notice                  |
| `content`          | `/channel/item/media:content`                | Content attributes                |
| `content_url`      | `/channel/item/media:content/@url`           | Content media URL                 |
| `content_filename` | (filename component of content URL)          | Content media filename            |
| `content_blurred`  | (whether content URL contains `blur_`)       | Content blurred (for-pay content) |
| `content_width`    | `/channel/item/media:content/@width`         | Content media width               |
| `content_height`   | `/channel/item/media:content/@height`        | Content media height              |
| `content_medium`   | `/channel/item/media:content/@medium`        | Content media medium              |
| `thumbnails`       | `/channel/item/media:thumbnail`              | Attributes of each thumbnail      |
| `thumbnail_urls`   | `/channel/item/media:thumbnail/@url`         | URLs of thumbnails                |
| `thumbnail_url`    | (first thumbnail URL)                        | URL of first thumbnail            |
| `description`      | `/channel/item/description`                  | Description                       |

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "deviousq",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": null,
    "keywords": "DeviantArt, cli",
    "author": null,
    "author_email": "Anders Feder <anders.feder.83@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/d7/32/56a11362b61b51f64fb1c98d307a8a3be33915e0f87257abcfa7faa38e1a/deviousq-0.0.3.tar.gz",
    "platform": null,
    "description": "`deviousq` is a command-line utility for querying the RSS API endpoint of the\nonline art sharing community DeviantArt.\n\nIt supports a variety of filters, asynchronous bulk downloading, and multiple\nmetadata output formats including JSON and CSV.\n\n## Installation\nTo install from PyPI, run:\n\n```\npip install deviousq\n```\n\nTo clone the source repository, run:\n\n```\ngit clone git@gitlab.com:afeder/deviousq.git\n```\n\n## Usage\n```\nusage: deviousq [-h] [-v] [-e ENDPOINT] [-q] [-l LIMIT] [-r ORDER] [-i OFFSET] [-p PAGE] [-P PAGES]\n                [--start-date START_DATE] [--end-date END_DATE] [--rating RATING] [--medium MEDIUM]\n                [--author AUTHOR] [--gallery GALLERY] [--min-width MIN_WIDTH] [--max-width MAX_WIDTH]\n                [--min-height MIN_HEIGHT] [--max-height MAX_HEIGHT] [--no-blurred-content] [--no-query-author]\n                [-o OUTPUT_TO] [-t {flat,json,csv}] [-k RETURN_FIELD] [-d DOWNLOAD_TO]\n                [--skip-download-exists]\n                [search_terms ...]\n```\n\nBy default, the utility queries the official DeviantArt endpoint for a list of\nitems (\"deviations\") related to zero or more search terms.\n\nIf the value of the `--order` option is 9 or \"popularity\", the list is ordered\nby most popular first (this is the server-side default); if the value of\n`--order` is 5 or \"time\", the list is ordered by newest first (this is forced\nfor queries on author or gallery).\n\nAn offset into the list may be specified with the `--offset` option, and an\nupper limit on the number of items to return from the list per query (up to a\nmaximum of 60) may be specified with the `--limit` option.\n\nIf a page number is specified with the `--page` option, the effective offset is\nincreased by the page number multiplied by the limit. If a number of pages to\nreturn is specified with the `--pages` option, the endpoint is queried up to\nthat number of times to return all items contained in that number of consecutive\npages.\n\nThe list of items to return may be reduced by applying any number of filters on\npublication date (`--start-date` and `--end-date`), maturity rating\n(`--rating`), content medium (`--medium`), author username (`--author`), gallery\nname (`--gallery`), and content width (`--min-width` and `--max-width`) and\nheight (`--min-height` and `--max-height`).\n\nIn default operation, a flat list with one URL representing each resulting\nitem, separated by newline characters, is output to `stdout`; if a field name\nis specified with the `--return-field` option, then the value of the given\nfield is output for each result in flat mode. If a different output format\nis specified with `--output-format`, a wider range of metadata is output for\neach result in the given serialization format. If a download directory is\nspecified with the `--download-to` option, then the content URL of each result\nis downloaded to that directory, and only the relative path to each\ndownloaded file is output. Finally if the `--return-query` flag is specified,\nno queries are executed at all; instead only the URLs of the queries\ncorresponding to the input options are output.\n\nIf an output file is specified with `--output-to`, the generated output is\nwritten to that file instead of `stdout`.\n\nRun the command with the option `--help` for a list of descriptions of all\nsupported command-line options.\n\n## Examples\nGet a list of URLs of deviations related to the search term `ocean`, sorted\naccording to the server-side default (most popular first):\n\n```\ndeviousq ocean\n```\n\nGet a list of URLs of deviations related to the search term `forest`, sorted by\nnewest first:\n\n```\ndeviousq forest --order time\n```\n\nGet 5 pages of up to 30 results each with the URLs of deviations related to the\nsearch term `landscapes`:\n\n```\ndeviousq --pages 5 --limit 30 landscapes\n```\n\nGet a list of URLs of deviations posted by the user `spyed`, sorted according to\nthe only order supported by the server (newest first):\n\n```\ndeviousq --author spyed\n```\n\nGet a list of URLs of deviations posted by the user `spyed` to their \"Featured\"\ngallery (the gallery identifier was obtained manually by visiting the user's\nweb page on DeviantArt and looking at the address of the link to the gallery),\nsorted according to the only order supported by the server (newest first):\n\n```\ndeviousq --gallery spyed/4788\n```\n\nGet a list of URLs of the content media of deviations related to the search term\n`portrait`:\n\n```\ndeviousq --return-field content_url portrait\n```\n\nDownload the content media of deviations related to the search term\n`magicalrealms` to the directory `/tmp/downloads`:\n\n```\ndeviousq --download-to /tmp/downloads magicalrealms\n```\n\nGet a list of deviations related to the search term `painting` and output their\nmetadata in JSON format to the file `/tmp/results.json`:\n\n```\ndeviousq --output-format json --output-to /tmp/results.json painting\n```\n\n## Supported item fields\n`deviousq` exposes the following RSS metadata fields for each query result item,\nwhere available:\n\n| Field key          | RSS field                                    | Description                       |\n|--------------------|----------------------------------------------|-----------------------------------|\n| `title`            | `/channel/item/title`                        | Title                             |\n| `link`             | `/channel/item/link`                         | Item information page URL         |\n| `pub_date`         | `/channel/item/pubDate`                      | Publication date                  |\n| `rating`           | `/channel/item/media:rating`                 | Maturity rating                   |\n| `authors`          | `/channel/item/media:credit[@role='author']` | Author information                |\n| `author`           | (first author credit value)                  | Author username                   |\n| `avatar`           | (second author credit value)                 | Author avatar URL                 |\n| `copyright`        | `/channel/item/media:copyright`              | Copyright notice                  |\n| `content`          | `/channel/item/media:content`                | Content attributes                |\n| `content_url`      | `/channel/item/media:content/@url`           | Content media URL                 |\n| `content_filename` | (filename component of content URL)          | Content media filename            |\n| `content_blurred`  | (whether content URL contains `blur_`)       | Content blurred (for-pay content) |\n| `content_width`    | `/channel/item/media:content/@width`         | Content media width               |\n| `content_height`   | `/channel/item/media:content/@height`        | Content media height              |\n| `content_medium`   | `/channel/item/media:content/@medium`        | Content media medium              |\n| `thumbnails`       | `/channel/item/media:thumbnail`              | Attributes of each thumbnail      |\n| `thumbnail_urls`   | `/channel/item/media:thumbnail/@url`         | URLs of thumbnails                |\n| `thumbnail_url`    | (first thumbnail URL)                        | URL of first thumbnail            |\n| `description`      | `/channel/item/description`                  | Description                       |\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "DeviantArt RSS API querying utility",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://gitlab.com/afeder/deviousq",
        "Repository": "https://gitlab.com/afeder/deviousq.git"
    },
    "split_keywords": [
        "deviantart",
        " cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "30801d84c40110ff14ba703751c13f949f66636d3560b3a98c1c2cdbf43efb83",
                "md5": "0ebdbdbee5f43c5419b1e6c14bd3a4ca",
                "sha256": "ebfc75d4609af184c9a2ee507396cc57721e90775ed4a56347d3dd880522202e"
            },
            "downloads": -1,
            "filename": "deviousq-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0ebdbdbee5f43c5419b1e6c14bd3a4ca",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 13527,
            "upload_time": "2024-08-09T20:05:19",
            "upload_time_iso_8601": "2024-08-09T20:05:19.537865Z",
            "url": "https://files.pythonhosted.org/packages/30/80/1d84c40110ff14ba703751c13f949f66636d3560b3a98c1c2cdbf43efb83/deviousq-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d73256a11362b61b51f64fb1c98d307a8a3be33915e0f87257abcfa7faa38e1a",
                "md5": "e7b4e2299d47a47c8e83c0077ea94ee9",
                "sha256": "10db8551b109bf46ca939c10e9419ec66259c810a857b4a26a9295701018e182"
            },
            "downloads": -1,
            "filename": "deviousq-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "e7b4e2299d47a47c8e83c0077ea94ee9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 15332,
            "upload_time": "2024-08-09T20:05:20",
            "upload_time_iso_8601": "2024-08-09T20:05:20.872163Z",
            "url": "https://files.pythonhosted.org/packages/d7/32/56a11362b61b51f64fb1c98d307a8a3be33915e0f87257abcfa7faa38e1a/deviousq-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-09 20:05:20",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "afeder",
    "gitlab_project": "deviousq",
    "lcname": "deviousq"
}
        
Elapsed time: 0.27884s