Skip to main content

Save data from GitLab to a SQLite database

Project description

gitlab-to-sqlite

PyPI License

Save data from GitLab to a SQLite database.

Attribution

The overall structure and CLI is taken from https://github.com/dogsheep/github-to-sqlite/.

How to install

$ pip install gitlab-to-sqlite

Authentication

Create a GitLab personal access token: https://gitlab.com/-/profile/personal_access_tokens

Run this command and paste in your new token:

$ gitlab-to-sqlite auth

This will create a file called auth.json in your current directory containing the required value. To save the file at a different path or filename, use the --auth=myauth.json option.

As an alternative to using an auth.json file you can add your access token to an environment variable called GITLAB_TOKEN.

Using custom gitlab instance

When running auth you may specify an optional --host parameter pointing to a custom instance.

$ gitlab-to-sqlite auth --host gitlab.internal

Fetching projects

The projects command retrieves a single project.

$ gitlab-to-sqlite projects gitlab.db group/project-name

Fetching merge requests

The merge-requests command retrieves updated or created merge requests.

$ gitlab-to-sqlite merge-requests gitlab.db group/project-name

This command can be run regularly. Based on the most recent created or updated merge request it only fetches changes that happened afterwards.

Fetching pipelines

The pipelines command retrieves updated or created pipelines with their corresponding jobs.

$ gitlab-to-sqlite pipelines gitlab.db group/project-name

This command can be run regularly. Based on the most recent created or updated pipeline it only fetches changes that happened afterwards.

Fetching environments

The environments command retrieves all environments of a single project.

$ gitlab-to-sqlite projects gitlab.db group/project-name

Fetching deployments

The deployments command retrieves all deployments of a specific environment in a single project.

$ gitlab-to-sqlite deployments gitlab.db group/project-name environment-name

This command can be run regularly. Based on the most recent created or updated deployment it only fetches changes that happened afterwards.

Fetching commits

The commits command retrieves all commits of a single project.

$ gitlab-to-sqlite commits gitlab.db group/project-name

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

gitlab_to_sqlite-0.0.3.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

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

gitlab_to_sqlite-0.0.3-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file gitlab_to_sqlite-0.0.3.tar.gz.

File metadata

  • Download URL: gitlab_to_sqlite-0.0.3.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for gitlab_to_sqlite-0.0.3.tar.gz
Algorithm Hash digest
SHA256 757999d8bca15246102d3b4ddb5beead37c27a0b628e7910766c0b68ba20e91a
MD5 73bd8df71ec301da133c73d548934397
BLAKE2b-256 2d24a9a99ea8aa5c2f58b7a18cf24ae132f78741aa02ed2b8ab2fcd3f278c05d

See more details on using hashes here.

File details

Details for the file gitlab_to_sqlite-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for gitlab_to_sqlite-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4b67e582b871b41da9f1a41c83823c686717dcf3176c0b2cc041ded701e4d0ad
MD5 32ea35c37bba13299f2b493e6a94100c
BLAKE2b-256 be1f0e4a709ba26081c20bde58cc0563cf00476b981a343f687fb4483689c91b

See more details on using hashes here.

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