Skip to main content

Autoseeder CLI tool

Project description

The autoseeder-cli tools allow you to interact easily with the Autoseeder API to submit new URLs and check the status of existing URLs.

Installation

pip install autoseeder_cli

Usage

Please Note: Only Python 3.6+ are officially supported by autoseeder-cli. Python 2.7 will reach EOL as of the 1st of January 2020 and will not be supported.

For each of these tools, before use you should configure the following as environment variables:

AUTOSEEDER_BASE_URL  The URL that the Autoseeder service resides at [e.g.: https://your.instance.hostname/autoseeder/]
AUTOSEEDER_TOKEN     Token to authenticate with - recommended method

Linux/MacOS:

export AUTOSEEDER_BASE_URL=https://your.instance.hostname/autoseeder/
export AUTOSEEDER_TOKEN='35999b9065…'

Windows Powershell:

$env:AUTOSEEDER_BASE_URL = "https://your.instance.hostname/autoseeder/"
$env:AUTOSEEDER_TOKEN = "35999b9065…"

Windows Command Prompt:

set AUTOSEEDER_BASE_URL=https://your.instance.hostname/autoseeder/
set AUTOSEEDER_TOKEN=35999b9065…

Commands available:

autoseeder-cli get_token

Required Environment Variables

  • AUTOSEEDER_USER

  • AUTOSEEDER_PASS

  • AUTOSEEDER_BASE_URL

via CLI

Log in to autoseeder and obtain an API token. Note that if you’ve been supplied with a token string to use already, you do not need to do this.

Linux/MacOS Command line:

AUTOSEEDER_USER=josephpilgrim
AUTOSEEDER_PASS=onthetrail
AUTOSEEDER_BASE_URL=https://oregon.usa/autoseeder/

export AUTOSEEDER_TOKEN=$(autoseeder-cli get_token)

via Python lib

import os
import autoseeder_cli

username = os.environ.get('AUTOSEEDER_USER')
password = os.environ.get('AUTOSEEDER_PASS')
base_url = os.environ.get('AUTOSEEDER_BASE_URL')

api = autoseeder_cli.AutoseederTokenGetter(user=username, password=password, base_url=base_url)
print('API token: {}'.format(api.get_token()))

autoseeder-cli submit

Required Environment Variables

  • AUTOSEEDER_TOKEN

  • AUTOSEEDER_BASE_URL

via CLI

Submit a single URL to Autoseeder for seeding. You can optionally select a geographic region to limit seeding activity to.

Command line:

autoseeder-cli submit https://example.com/ --seed-region=AU

via Python lib

import os
import autoseeder_cli

token = os.environ.get('AUTOSEEDER_TOKEN')
base_url = os.environ.get('AUTOSEEDER_BASE_URL')

submitter = autoseeder_cli.AutoseederSubmitter(token=token, base_url=base_url)
response = submitter.submit_url('http://example.com', seed_region='AU')
uuid = response.get('uuid')

print('URL trackable via {}'.format(uuid))

autoseeder-cli list

Required Environment Variables

  • AUTOSEEDER_TOKEN

  • AUTOSEEDER_BASE_URL

via CLI

Presents a report of URLs you’ve submitted and their status.

You may find it helpful to filter and format the output with the jq tool.

Linux/MacOS command line:

# show last 100
autoseeder-cli list --limit 100

# filter down with jq
autoseeder-cli list --limit 100 | \
    jq '.[] | \
        select(.statistics != null) | \
       [ .statistics[].canoncical_url, .statistics[].status ]'

Windows command line:

REM show last 100
autoseeder-cli list --limit 100

REM filter down with jq
autoseeder-cli list --limit 100 | jq ".[]| select(.statistics != null)| [.statistics[].canonical_url, .statistics[].status]"

via Python lib

import os
import autoseeder_cli

token = os.environ.get('AUTOSEEDER_TOKEN')
base_url = os.environ.get('AUTOSEEDER_BASE_URL')

lister = autoseeder_cli.AutoseederLister(token=token, base_url=base_url)
urls = lister.get_url_list()

for url in urls:
    print(url['url'])

autoseeder-cli view

Required Environment Variables

  • AUTOSEEDER_TOKEN

  • AUTOSEEDER_BASE_URL

via CLI

Presents a report of a single URL via its associated Universally unique identifier (UUID) or specific URL.

Command line:

# view by URL UUID
autoseeder-cli view 2118f16a-3270-4e63-88dc-24b6097739ab  # UUID is sample only
# partial URL string which must match only one registered URL
autoseeder-cli view example.com/myurl

via Python lib

import os
import autoseeder_cli

# 2118f16a-3270-4e63-88dc-24b6097739ab is a SAMPLE ONLY, would map to a seeded URL you previously submitted
viewer = autoseeder_cli.AutoseederURLView(token=token, base_url=myinstance_url)
url_data = viewer.view('2118f16a-3270-4e63-88dc-24b6097739ab')

for url in url_data:
    print(url['url'])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autoseeder-cli-2.3.2.tar.gz (8.5 kB view details)

Uploaded Source

Built Distributions

autoseeder_cli-2.3.2-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

autoseeder_cli-2.3.2-py2-none-any.whl (9.3 kB view details)

Uploaded Python 2

File details

Details for the file autoseeder-cli-2.3.2.tar.gz.

File metadata

  • Download URL: autoseeder-cli-2.3.2.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for autoseeder-cli-2.3.2.tar.gz
Algorithm Hash digest
SHA256 2819eb9b5a92508e4a9bd7c617a3c72946060d232242f85719e4269282464d99
MD5 2506e7397f1d926bc4beb1fade9cffed
BLAKE2b-256 533bbde0cecf45a8e9f3e7b25371251d3adacff060c0c73d26a0fc82a8f0a4a2

See more details on using hashes here.

File details

Details for the file autoseeder_cli-2.3.2-py3-none-any.whl.

File metadata

  • Download URL: autoseeder_cli-2.3.2-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for autoseeder_cli-2.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fc0a86bf2a9ed636ea8b25354e6387f6512d1625e64d1d19c3a21d7a2cb26040
MD5 46249ade1e4be08ea0fa1fd72507b5dd
BLAKE2b-256 f107591acd5d2fe4f935366edadf8dc88251aa78b53bebdfa1b22d6e1893b08c

See more details on using hashes here.

File details

Details for the file autoseeder_cli-2.3.2-py2-none-any.whl.

File metadata

  • Download URL: autoseeder_cli-2.3.2-py2-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.6.8

File hashes

Hashes for autoseeder_cli-2.3.2-py2-none-any.whl
Algorithm Hash digest
SHA256 bd442d9a7e019f413a32b2990fe99693d2d1371cbba05399e059b70fa09020bb
MD5 3d00b18ee1578c537f8c2f7b9b33d71b
BLAKE2b-256 1813d126cc7300487a10a7e4d7fa450b210e7440434ea2ec58b3cfbcf1c74a2e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page