Skip to main content

Script to help search code in self-hosted gitlab

Project description

gl-search

This is a lib that use gitlab api to search code. This code is based in the lib gitlab-search.

About

It is a lib to search code at gitlab. This search can be parameterized with params groups, extension, filename, path, max-workers and visibility.

How install?

pip install gl_search

How it works?

The lib use gitlab token (GITLAB_PRIVATE_TOKEN) to search.

How to setup the token?

Get your token at gitlab and then execute following command to save at home user at the .gl-settings.toml file.

gl-search setup-token <token>

Can I change gitlab official to self hosted?

Yes you can. Use following command to setup the gitlab-address

gl-search setup-gitlab-address <self-hosted-gitlab-address>

Where I get gitlab token?

You can get on following link gitlab-token The TOKEN must be generated with scope read_api.

Why this lib was built?

I had problem with repo visibility using a mentioned lib above so I built this script to resolve my problem.

How to use

gl-search search test

This options is show up below.

  gl_search git:(main)  gl-search search --help
Usage: gl-search search [OPTIONS] SEARCH_CODE_INPUT

  Search command.

Options:
  -p, --path TEXT                 search by Path
  -fn, --filename TEXT            search by filename
  -ext, --extension TEXT          code filename extension :: py,js,cs
  -g, --groups TEXT               search by gitlab group
  -mw, --max-workers INTEGER      number of parallel requests
  -v, --visibility [internal|public|private]
                                  repositories visibility
  -xdr, --max-delay-request INTEGER
  -d, --debug                     Debug :: show urls called.
  --help                          Show this message and exit.

How was made the lib?

The lib was built using click, rich, request, ThreadPoolExecutor.

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

gl_search-0.4.1.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

gl_search-0.4.1-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file gl_search-0.4.1.tar.gz.

File metadata

  • Download URL: gl_search-0.4.1.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-1014-azure

File hashes

Hashes for gl_search-0.4.1.tar.gz
Algorithm Hash digest
SHA256 38c1114bec515c19aaa880d6c431ff3b58fd8f4c13cb4fc0021a850acc480155
MD5 a6e97d608f78a36542485b00fe571aad
BLAKE2b-256 e5e5b8940eec73f8d48f83db0d43ef586e414064be2eddfd68c6d2171299ce3a

See more details on using hashes here.

File details

Details for the file gl_search-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: gl_search-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.10.12 Linux/6.8.0-1014-azure

File hashes

Hashes for gl_search-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4facaacf8edc6442ba1146aa2be3947e77814d20fe8f4186b56c257ef22e8157
MD5 72976d5644a6585ce9747d1a0109fe2a
BLAKE2b-256 145e8c52101e381e61c8c9b3ffb4161694c661891785f72b9b3cafe41ac98fcb

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