Skip to main content

CLI for downloading all gists from a specified user.

Project description

gist-neko

CLI for downloading all gists from a specified user.

Requirements

requests is used to get information from the Github API and download the gists (if you don't use -g/--git to download using git).

Note that requests will not download submodules but git will.

If you want to build this on your own, you can install the requirements with

pip install -r requirements.txt

or install the package by running

pip install gist-neko

Python's native os (used to check for whether a folder exists or not), argparse (parse return request and set command argument), subprocess (call git clone and git pull on gists) and setuptools (used to build the script) packages are also used.

How it works

I send requests to https://api.github.com/users/{username}/gists, depending on the arguments passed to the script, I either download all the gists in specified user's account with either requests or git.

You can run the script with

gist-neko
    -u <github-username>
    -t <github-personal-access-token> (optional - you will just download the public gists instead of all gists)
    -e (optional - means you will be using environment variables. This overrides -u and -t)
    -g (optional - means you will be downloading using git)
    -gu <github-username> (this will set <github-username> as environment variable)
    -gpat <github-personal-access-token> (this will set <github-personal-access-token> as environment variable)

Examples

Setting Environment Variables

This will set the specified Github username and personal access token as your GITHUB_USERNAME and GITHUB_PERSONAL_ACCESS_TOKEN environment variable respectively. On Linux this is a bit buggy.

gist-neko -gu <github-username> -gpat <github-personal-access-token>

This will set the specified Github username as your GITHUB_USERNAME environment variable. On Linux this is a bit buggy.

gist-neko -gu <github-username>

This will set the specified personal access token as your GITHUB_PERSONAL_ACCESS_TOKEN environment variable. On Linux this is a bit buggy.

gist-neko -gpat <github-personal-access-token>

Public Gists without Environment Variables

This will use the specified Github username and download all public gists using requests.

gist-neko -u <github-username> -t <github-personal-access-token>

This will use the specified Github username and download all public gists using git.

gist-neko -u <github-username> -t <github-personal-access-token> -g <anything>

Public and Private Gists without Environment Variables

This will use the specified Github username and personal access token and download all public and private gists using requests.

gist-neko -u <github-username> -t <github-personal-access-token>

This will use the specified Github username and personal access token and download all public and private gists using git.

gist-neko -u <github-username> -t <github-personal-access-token> -g <anything>

Public and Private Gists with Environment Variables

This will use the Github username and personal access token in the environment variables and download all public and private gists using requests.

gist-neko -e <anything>

This will use the Github username and personal access token in the environment variables and download all public and private gists using git.

gist-neko -e <anything> -g <anything>

Public and Private Gists with Environment Variables (Overriding passed Username and Personal Access Token)

This will ignore the passed Github username and personal access token instead using environment variables and download all public and private gists using requests.

gist-neko -u <github-username> -t <github-personal-access-token> -e <anything>

This will ignore the passed Github username and personal access token instead using environment variables and download all public and private gists using git.

gist-neko -u <github-username> -t <github-personal-access-token> -e <anything> -g <anything>

Simplified Examples

If you want to only download your gists (public), you can do

gist-neko -u <your-username>

If you want to only download your gists (public and private), you can either do

gist-neko -u <your-username> -t <your-personal-access-token>

or you can put your information on environment variables and do

gist-neko -e <anything>

If you want to download other people's gists (public), you can do

gist-neko -u <their-username>

If you want to download other people's gists (public and private), you can do

gist-neko -u <their-username> -t <their-personal-access-token>

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

gist_neko-1.23.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gist_neko-1.23-py3-none-any.whl (14.7 kB view details)

Uploaded Python 3

File details

Details for the file gist_neko-1.23.tar.gz.

File metadata

  • Download URL: gist_neko-1.23.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gist_neko-1.23.tar.gz
Algorithm Hash digest
SHA256 057729bccf6ad1375e5932c362753d2fb1c671281f1c7c28353cb41f93181355
MD5 ceda21ff10db02d033c055c7a36c3bb3
BLAKE2b-256 4fbf1c087ddae0867ed9a732c9f434e60ee38c4f4d022990997f023ea7f98344

See more details on using hashes here.

Provenance

The following attestation bundles were made for gist_neko-1.23.tar.gz:

Publisher: publish.yml on NecRaul/gist-neko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file gist_neko-1.23-py3-none-any.whl.

File metadata

  • Download URL: gist_neko-1.23-py3-none-any.whl
  • Upload date:
  • Size: 14.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for gist_neko-1.23-py3-none-any.whl
Algorithm Hash digest
SHA256 b3473b4410f1ce50309208cb5b0f9ddb0b707794b625fb68048695ba975f1de0
MD5 f9babf16493d9147fde6a77be5987531
BLAKE2b-256 437327f8adc99b841a31afc0150a17a6accf9959f8707993be6f6737832c249d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gist_neko-1.23-py3-none-any.whl:

Publisher: publish.yml on NecRaul/gist-neko

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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