getdat


Namegetdat JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://audiosutras.github.io/getdat/
SummaryA command line utility for getting resources available online
upload_time2023-12-04 17:14:51
maintainer
docs_urlNone
authorChristopher Dixon
requires_python>=3.11,<4.0
license
keywords cli books movies episodes anna's archive movie-web web scraper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # *ATTENTION* - Anna's Archive enforces web scraping blocks through Cloudflare. The site is also subject to change. The `ebook` command may return `No Search Results` found. A fix is in the works that may involve a new project and archiving this one. A long term solution is [hosting an instance of Anna's Archive](https://annas-software.org/AnnaArchivist/annas-archive) with [community support](https://chrisdixononcode.dev/support) or possibly creating a cli by forking the main repo and building an api.


<div align="center">
    <h1>GetDat</h1>
    <p><i>A command line utility for getting resources available online</i></p>
    <img
        src="{{ 'assets/images/getdat-logo.png' }}"
        alt="GetDat Package Logo"
        height="400"
    />
    <p align="center">
        <a href="https://iv.ggtyler.dev/watch?v=4b8P8cqc-UQ" target="_blank">
            GetDat Theme Music
        </a>
    </p>
</div>

<div class="flex flex-row justify-between flex-wrap">
  <a href="https://pypi.org/project/getdat/" alt="Link to PyPi package homepage">
    <img class="p-2" alt="PyPI - Downloads" src="https://img.shields.io/pypi/dw/getdat?logo=pypi">
  </a>
  <a href="https://github.com/Audiosutras/getdat/actions/workflows/ci.yml?query=branch=master" alt="Link to CI jobs for master branch">
    <img class="p-2" alt="CI" src="https://github.com/Audiosutras/getdat/actions/workflows/ci.yml/badge.svg?branch=master">
  </a>
  <a href="https://github.com/Audiosutras/getdat" alt="Link to Github Issues">
    <img alt="GitHub issues" src="https://img.shields.io/github/issues/Audiosutras/getdat">
  </a>
</div>

Table of Contents

- [Installation Methods](#installation-methods)
- [Commands](#commands)
- [Local Development](#local-development)
- [Deployment](#deployment)
  - [Publishing Getdat](#publishing-getdat)
  - [Publishing Docs](#publishing-docs)
- [Contributors](#contributors)

## Installation Methods

PYPI - Stable Release:
```bash
-> pipx install getdat
```

From Head commit of Repository:
```bash
-> pipx install git+https://github.com/Audiosutras/getdat.git
```

## Commands

### Job
Launches [Braintrust](https://bit.ly/braintrust-gigs-talent-search), the job board powered by blockchain, in your default browser

### Sport
Launches [Totalsportk](https://www.totalsportk.org/) in your default browser

### Cinema
Launches [movie-web.app](https://movie-web.app/search/movie) in your default browser

<div align="center" class="gif-image">
    <img
        src="{{ 'assets/images/getdat-cinema.gif' | relative_url }}"
        alt="Gif of GetDat Cinema Command In Action"
    />
</div>

```bash
-> getdat cinema
```

### Ebook
Search and download an ebook available through [Anna's Archive](https://annas-archive.org/). You can think of this command as "headless" Anna's Archive

<div align="center" class="gif-image">
    <img
        src="{{ 'assets/images/getdat-ebook.gif' | relative_url }}"
        alt="Gif of GetDat Ebook Command In Action"
        style="border: red"
    />
</div>

* The demo for this command downloaded an epub format of Robert Louis Stevenson's and N.C. Wyeth's book *Treasure Island*. This book is in the public domain.
* The demo for this command opens the downloaded ebook using [epr](https://github.com/wustho/epr), a terminal epub reader to show the contents of the downloaded book. You can expect higher ebook quality by using a desktop e-reader like [librum](https://librumreader.com/)
* Anna's Archive `SciDB` search is not yet supported.


```bash
-> getdat ebook [OPTIONS] [Q]
```

#### ARGUMENTS

| Name | Help |
|------|------|
| Q    | Search |

Example:
```bash
-> getdat ebook "Treasure Island Stevenson"
```
or
```bash
-> getdat ebook Treasure Island Stevenson
```

#### OPTIONS

```bash
-> getdat ebook --help
Usage: getdat ebook [OPTIONS] [Q]...

  Search and download an ebook available through Anna's Archive

  ex: getdat ebook <Search>

Options:
  -o, --output_dir TEXT           Path to ebook's output directory from home
                                  directory. Path must be prefixed by '~' on
                                  Unix or '~user' on Windows. This argument
                                  overrides GETDAT_BOOK_DIR env var if set.
                                  Outputs book to working directory if neither
                                  are set.
  -e, --ext [pdf|epub|mobi|cbr|cbz|fb2|fb2.zip|azw3|djvu]
                                  Preferred ebook extension for ebooks in
                                  search results.
  -l, --lang TEXT                 Preferred language of ebooks in search
                                  results. Provided Language must be ISO 639-1
                                  format. Language region extension supported.
                                  Filtering by multiple languages supported.
                                  Examples: English - en, Spanish - es,
                                  Traditional Chinese - zh-Hant, Multiple
                                  Langauges - en,es,zh-Hant
  -i, --instance [org|gs|se]      The instance of Anna's Archive you would
                                  like to use for your search:  https://annas-
                                  archive.org, https://annas-archive.gs,
                                  https://annas-archive.se - Default: org
  --help                          Show this message and exit.

```

Example:
```bash
-> getdat ebook Treasure Island Stevenson --ext=epub --output_dir=~/books/epub/ --instance=gs --lang=en,es,zh-Hant
```
or
```bash
-> getdat ebook "Treasure Island Stevenson" -e epub -o ~/books/epub -i gs -l es
```
or
```bash
-> getdat ebook "Treasure Island Stevenson"
```

#### Environment Variable

- `GETDAT_BOOK_DIR` - Path from home directory to destination directory. Ignored if `--output_dir` is specified as an [option](#options)

## Local Development

Python Version: `3.11`. To install python on MacOS & Debian-based systems
```bash
-> sudo apt install software-properties-common
-> sudo add-apt-repository ppa:deadsnakes/ppa
-> sudo apt update
-> sudo apt install python3.11
```

This python package uses [poetry](https://python-poetry.org/docs/) for dependency management. To install:
```bash
# install pipx if you have not already
-> python3 -m pip install --user pipx
-> python3 -m pipx ensurepath
# install poetry
-> pipx install poetry
```

Assuming that you have *forked the repository* and have a copy on your local machine. Within the `getdat` directory, install dependencies and open a `virtualenv` shell managed by poetry.
```bash
-> poetry install
-> poetry shell
(getdat-py3.11) ->
```

To run/develop the cli program.
```bash
(getdat-py3.11) -> getdat
Usage: getdat [OPTIONS] COMMAND [ARGS]...

  A command line utility for getting resources available online

Options:
  --help  Show this message and exit.

Commands:
  cinema  Launches movie-web.app in your default browser
  ebook   Search and download an ebook available through Anna's Archive...

  Check out our docs at https://github.com/Audiosutras/getdat/docs for more
  details

```

Project uses [pytest](https://docs.pytest.org/en/7.4.x/) for unit testing. Test run quickly with the help of [pytest-mock](https://pytest-mock.readthedocs.io/en/latest/usage.html)
```bash
(getdat-py3.11) -> pytest -v --cov=. tests/
```

Style guide and code check enforced with [pre-commit](https://pre-commit.com/)
```bash
(getdat-py3.11) -> pre-commit install
```

Running `docs` site locally for making changes to `github-pages` requires [ruby](https://jekyllrb.com/docs/installation/ubuntu/) to be installed. After installation make sure to install *bundler* with `gem install jekyll bundler` as well:
```bash
-> cd docs
-> bundler install
-> bundler exec jekyll build
-> bundler exec jekyll serve
```

## Deployment

### Publishing Getdat

Workflow: `master` branch

- In `pyproject.toml` *bump* the version number `*.*.*`

- Create a [git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) with the new version number `*.*.*` you specified in `pyproject.toml`.

- Push the newly created tag `git push origin *.*.*` to the repository. This will trigger the `pre-release.yml` github workflow to publish our package to `test.pypi`. The pre-release can be seen [here](https://test.pypi.org/project/getdat/) for testing. Install with:
```bash
-> python3.11 -m pip install --index-url https://test.pypi.org/simple/ getdat --extra-index-url https://pypi.org/simple beautifulsoup4 requests click
```
    - *Note*: `--extra-index-url` option is pulling dependencies from `pypi.org` and not `test.pypi.org` though our package is coming in from `test.pypi.org`. Make sure to add all dependencies from `[tool.poetry.dependencies]` in `pyproject.toml` (except python) before running this command.

- *Create* a [release](https://www.toolsqa.com/git/github-releases/) on github. Make sure to select `Tags` from the toggle menu. Select the latest tag (highest version number). Name the release `Release *.*.*`. Make sure the version number in `pyproject.toml` syncs up with the release version. *Click* `Publish release`. This will kick off our `release.yml` workflow to publish our package to `pypi`. The release can be seen [here and installed](https://pypi.org/project/getdat/) for production use. Install with:
```bash
-> pipx install getdat
```

### Publishing Docs
Docs are published to the [site](https://getdat.chrisdixononcode.dev) when a release is created for the python package to pypi.org. This is *automated*, but can be triggered manually by running the github workflow *Deploy Jekyll with GitHub Pages dependencies preinstalled*.

---
## Contributors

![GitHub Contributors Image](https://contrib.rocks/image?repo=Audiosutras/getdat)

            

Raw data

            {
    "_id": null,
    "home_page": "https://audiosutras.github.io/getdat/",
    "name": "getdat",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "cli,books,movies,episodes,anna's archive,movie-web,web scraper",
    "author": "Christopher Dixon",
    "author_email": "chrisdixononcode@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cd/10/6de48800d08f83e879006f6e114d03e21286489786e6c43d4040fe38c37e/getdat-0.2.2.tar.gz",
    "platform": null,
    "description": "# *ATTENTION* - Anna's Archive enforces web scraping blocks through Cloudflare. The site is also subject to change. The `ebook` command may return `No Search Results` found. A fix is in the works that may involve a new project and archiving this one. A long term solution is [hosting an instance of Anna's Archive](https://annas-software.org/AnnaArchivist/annas-archive) with [community support](https://chrisdixononcode.dev/support) or possibly creating a cli by forking the main repo and building an api.\n\n\n<div align=\"center\">\n    <h1>GetDat</h1>\n    <p><i>A command line utility for getting resources available online</i></p>\n    <img\n        src=\"{{ 'assets/images/getdat-logo.png' }}\"\n        alt=\"GetDat Package Logo\"\n        height=\"400\"\n    />\n    <p align=\"center\">\n        <a href=\"https://iv.ggtyler.dev/watch?v=4b8P8cqc-UQ\" target=\"_blank\">\n            GetDat Theme Music\n        </a>\n    </p>\n</div>\n\n<div class=\"flex flex-row justify-between flex-wrap\">\n  <a href=\"https://pypi.org/project/getdat/\" alt=\"Link to PyPi package homepage\">\n    <img class=\"p-2\" alt=\"PyPI - Downloads\" src=\"https://img.shields.io/pypi/dw/getdat?logo=pypi\">\n  </a>\n  <a href=\"https://github.com/Audiosutras/getdat/actions/workflows/ci.yml?query=branch=master\" alt=\"Link to CI jobs for master branch\">\n    <img class=\"p-2\" alt=\"CI\" src=\"https://github.com/Audiosutras/getdat/actions/workflows/ci.yml/badge.svg?branch=master\">\n  </a>\n  <a href=\"https://github.com/Audiosutras/getdat\" alt=\"Link to Github Issues\">\n    <img alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/Audiosutras/getdat\">\n  </a>\n</div>\n\nTable of Contents\n\n- [Installation Methods](#installation-methods)\n- [Commands](#commands)\n- [Local Development](#local-development)\n- [Deployment](#deployment)\n  - [Publishing Getdat](#publishing-getdat)\n  - [Publishing Docs](#publishing-docs)\n- [Contributors](#contributors)\n\n## Installation Methods\n\nPYPI - Stable Release:\n```bash\n-> pipx install getdat\n```\n\nFrom Head commit of Repository:\n```bash\n-> pipx install git+https://github.com/Audiosutras/getdat.git\n```\n\n## Commands\n\n### Job\nLaunches [Braintrust](https://bit.ly/braintrust-gigs-talent-search), the job board powered by blockchain, in your default browser\n\n### Sport\nLaunches [Totalsportk](https://www.totalsportk.org/) in your default browser\n\n### Cinema\nLaunches [movie-web.app](https://movie-web.app/search/movie) in your default browser\n\n<div align=\"center\" class=\"gif-image\">\n    <img\n        src=\"{{ 'assets/images/getdat-cinema.gif' | relative_url }}\"\n        alt=\"Gif of GetDat Cinema Command In Action\"\n    />\n</div>\n\n```bash\n-> getdat cinema\n```\n\n### Ebook\nSearch and download an ebook available through [Anna's Archive](https://annas-archive.org/). You can think of this command as \"headless\" Anna's Archive\n\n<div align=\"center\" class=\"gif-image\">\n    <img\n        src=\"{{ 'assets/images/getdat-ebook.gif' | relative_url }}\"\n        alt=\"Gif of GetDat Ebook Command In Action\"\n        style=\"border: red\"\n    />\n</div>\n\n* The demo for this command downloaded an epub format of Robert Louis Stevenson's and N.C. Wyeth's book *Treasure Island*. This book is in the public domain.\n* The demo for this command opens the downloaded ebook using [epr](https://github.com/wustho/epr), a terminal epub reader to show the contents of the downloaded book. You can expect higher ebook quality by using a desktop e-reader like [librum](https://librumreader.com/)\n* Anna's Archive `SciDB` search is not yet supported.\n\n\n```bash\n-> getdat ebook [OPTIONS] [Q]\n```\n\n#### ARGUMENTS\n\n| Name | Help |\n|------|------|\n| Q    | Search |\n\nExample:\n```bash\n-> getdat ebook \"Treasure Island Stevenson\"\n```\nor\n```bash\n-> getdat ebook Treasure Island Stevenson\n```\n\n#### OPTIONS\n\n```bash\n-> getdat ebook --help\nUsage: getdat ebook [OPTIONS] [Q]...\n\n  Search and download an ebook available through Anna's Archive\n\n  ex: getdat ebook <Search>\n\nOptions:\n  -o, --output_dir TEXT           Path to ebook's output directory from home\n                                  directory. Path must be prefixed by '~' on\n                                  Unix or '~user' on Windows. This argument\n                                  overrides GETDAT_BOOK_DIR env var if set.\n                                  Outputs book to working directory if neither\n                                  are set.\n  -e, --ext [pdf|epub|mobi|cbr|cbz|fb2|fb2.zip|azw3|djvu]\n                                  Preferred ebook extension for ebooks in\n                                  search results.\n  -l, --lang TEXT                 Preferred language of ebooks in search\n                                  results. Provided Language must be ISO 639-1\n                                  format. Language region extension supported.\n                                  Filtering by multiple languages supported.\n                                  Examples: English - en, Spanish - es,\n                                  Traditional Chinese - zh-Hant, Multiple\n                                  Langauges - en,es,zh-Hant\n  -i, --instance [org|gs|se]      The instance of Anna's Archive you would\n                                  like to use for your search:  https://annas-\n                                  archive.org, https://annas-archive.gs,\n                                  https://annas-archive.se - Default: org\n  --help                          Show this message and exit.\n\n```\n\nExample:\n```bash\n-> getdat ebook Treasure Island Stevenson --ext=epub --output_dir=~/books/epub/ --instance=gs --lang=en,es,zh-Hant\n```\nor\n```bash\n-> getdat ebook \"Treasure Island Stevenson\" -e epub -o ~/books/epub -i gs -l es\n```\nor\n```bash\n-> getdat ebook \"Treasure Island Stevenson\"\n```\n\n#### Environment Variable\n\n- `GETDAT_BOOK_DIR` - Path from home directory to destination directory. Ignored if `--output_dir` is specified as an [option](#options)\n\n## Local Development\n\nPython Version: `3.11`. To install python on MacOS & Debian-based systems\n```bash\n-> sudo apt install software-properties-common\n-> sudo add-apt-repository ppa:deadsnakes/ppa\n-> sudo apt update\n-> sudo apt install python3.11\n```\n\nThis python package uses [poetry](https://python-poetry.org/docs/) for dependency management. To install:\n```bash\n# install pipx if you have not already\n-> python3 -m pip install --user pipx\n-> python3 -m pipx ensurepath\n# install poetry\n-> pipx install poetry\n```\n\nAssuming that you have *forked the repository* and have a copy on your local machine. Within the `getdat` directory, install dependencies and open a `virtualenv` shell managed by poetry.\n```bash\n-> poetry install\n-> poetry shell\n(getdat-py3.11) ->\n```\n\nTo run/develop the cli program.\n```bash\n(getdat-py3.11) -> getdat\nUsage: getdat [OPTIONS] COMMAND [ARGS]...\n\n  A command line utility for getting resources available online\n\nOptions:\n  --help  Show this message and exit.\n\nCommands:\n  cinema  Launches movie-web.app in your default browser\n  ebook   Search and download an ebook available through Anna's Archive...\n\n  Check out our docs at https://github.com/Audiosutras/getdat/docs for more\n  details\n\n```\n\nProject uses [pytest](https://docs.pytest.org/en/7.4.x/) for unit testing. Test run quickly with the help of [pytest-mock](https://pytest-mock.readthedocs.io/en/latest/usage.html)\n```bash\n(getdat-py3.11) -> pytest -v --cov=. tests/\n```\n\nStyle guide and code check enforced with [pre-commit](https://pre-commit.com/)\n```bash\n(getdat-py3.11) -> pre-commit install\n```\n\nRunning `docs` site locally for making changes to `github-pages` requires [ruby](https://jekyllrb.com/docs/installation/ubuntu/) to be installed. After installation make sure to install *bundler* with `gem install jekyll bundler` as well:\n```bash\n-> cd docs\n-> bundler install\n-> bundler exec jekyll build\n-> bundler exec jekyll serve\n```\n\n## Deployment\n\n### Publishing Getdat\n\nWorkflow: `master` branch\n\n- In `pyproject.toml` *bump* the version number `*.*.*`\n\n- Create a [git tag](https://git-scm.com/book/en/v2/Git-Basics-Tagging) with the new version number `*.*.*` you specified in `pyproject.toml`.\n\n- Push the newly created tag `git push origin *.*.*` to the repository. This will trigger the `pre-release.yml` github workflow to publish our package to `test.pypi`. The pre-release can be seen [here](https://test.pypi.org/project/getdat/) for testing. Install with:\n```bash\n-> python3.11 -m pip install --index-url https://test.pypi.org/simple/ getdat --extra-index-url https://pypi.org/simple beautifulsoup4 requests click\n```\n    - *Note*: `--extra-index-url` option is pulling dependencies from `pypi.org` and not `test.pypi.org` though our package is coming in from `test.pypi.org`. Make sure to add all dependencies from `[tool.poetry.dependencies]` in `pyproject.toml` (except python) before running this command.\n\n- *Create* a [release](https://www.toolsqa.com/git/github-releases/) on github. Make sure to select `Tags` from the toggle menu. Select the latest tag (highest version number). Name the release `Release *.*.*`. Make sure the version number in `pyproject.toml` syncs up with the release version. *Click* `Publish release`. This will kick off our `release.yml` workflow to publish our package to `pypi`. The release can be seen [here and installed](https://pypi.org/project/getdat/) for production use. Install with:\n```bash\n-> pipx install getdat\n```\n\n### Publishing Docs\nDocs are published to the [site](https://getdat.chrisdixononcode.dev) when a release is created for the python package to pypi.org. This is *automated*, but can be triggered manually by running the github workflow *Deploy Jekyll with GitHub Pages dependencies preinstalled*.\n\n---\n## Contributors\n\n![GitHub Contributors Image](https://contrib.rocks/image?repo=Audiosutras/getdat)\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A command line utility for getting resources available online",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://audiosutras.github.io/getdat/",
        "Repository": "https://github.com/Audiosutras/getdat"
    },
    "split_keywords": [
        "cli",
        "books",
        "movies",
        "episodes",
        "anna's archive",
        "movie-web",
        "web scraper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b1a4bd300d6a8088fc98a552c4287a96f2c70ca849b4897a4b2a682365f74b3d",
                "md5": "5aa82cbbcd2a06cc5d5891a17a7c4438",
                "sha256": "9fab6f946e4d0b42050e944416e93189846c04c3f7271a0cbcedfc5c3a474b0b"
            },
            "downloads": -1,
            "filename": "getdat-0.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5aa82cbbcd2a06cc5d5891a17a7c4438",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 11686,
            "upload_time": "2023-12-04T17:14:50",
            "upload_time_iso_8601": "2023-12-04T17:14:50.230800Z",
            "url": "https://files.pythonhosted.org/packages/b1/a4/bd300d6a8088fc98a552c4287a96f2c70ca849b4897a4b2a682365f74b3d/getdat-0.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cd106de48800d08f83e879006f6e114d03e21286489786e6c43d4040fe38c37e",
                "md5": "2fe7aa887ecd819f717c823c1675a4bf",
                "sha256": "ef9b9fdd3706e3f202c28c0fb89e4ed005cd6205066c484ed71f689f9d136bbb"
            },
            "downloads": -1,
            "filename": "getdat-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "2fe7aa887ecd819f717c823c1675a4bf",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 13100,
            "upload_time": "2023-12-04T17:14:51",
            "upload_time_iso_8601": "2023-12-04T17:14:51.165840Z",
            "url": "https://files.pythonhosted.org/packages/cd/10/6de48800d08f83e879006f6e114d03e21286489786e6c43d4040fe38c37e/getdat-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-04 17:14:51",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Audiosutras",
    "github_project": "getdat",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "getdat"
}
        
Elapsed time: 0.22128s