Registry / devops / ci-info

ci-info

JSON →
library0.4.0pypypi✓ verified 87d ago

ci-info is a Python library that provides information about the current Continuous Integration (CI) environment. It allows developers to detect if code is running on a CI server, identify the specific CI provider (e.g., GitHub Actions, GitLab CI, CircleCI), and check if the current build is for a pull request. The library aims to maintain parity with `watson/ci-info` (a JavaScript equivalent) and is actively developed with a focus on adding new CI provider detections. The latest version is 0.4.0, released in February 2026.

pip install ci-info
INSTALL
IMPORT
SIG · CI-INFO
C
ci-info
devopspythonv0.4.0
Install
1.5s avg
Import
9ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.006s · 17.8MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 1.5s · import 0.007s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

is_ci
import ci_info
name
import ci_info
is_pr
import ci_info
info
import ci_info

This quickstart demonstrates how to check if the current environment is a CI server, identify its name, and determine if the build is for a pull request using the `ci_info` module. It also shows how to retrieve all detected CI information in a dictionary.

import ci_info import os if ci_info.is_ci(): print(f"Running on CI: {ci_info.name()}") if ci_info.is_pr(): print("This is a Pull Request build.") else: print("This is not a Pull Request build.") # Example of accessing CI environment variables directly # os.environ.get('CI_NAME', 'Unknown') # Get all detected info as a dictionary all_ci_info = ci_info.info() print(f"All CI Info: {all_ci_info}") else: print("Not running on a CI server.")
Debug
Known issues
breakingVersion 0.3.0 dropped official support for Python 3.5 and 3.6. Users on these Python versions should either remain on `ci-info` version `0.2.x` or upgrade their Python interpreter to 3.7 or newer.
fix
Upgrade to Python 3.7+ or pin `ci-info<0.3.0` in your project dependencies.
affects: >=0.3.0
gotchaThe exact string value returned by `ci_info.name()` is not guaranteed to be constant across versions for a specific CI vendor. It is primarily for display and general identification.
fix
Avoid relying on precise string matching for `ci_info.name()`. If specific vendor logic is critical, consider using `ci_info.is_ci()` in conjunction with checking vendor-specific environment variables directly if `ci_info.name()` changes might break your logic.
affects: All versions
gotchaIt is possible for `ci_info.is_ci()` to return `True` while `ci_info.name()` returns `None`. This occurs when generic, vendor-neutral CI environment variables are detected, but no specific CI provider recognized by `ci-info` is found.
fix
If your logic depends on a specific CI provider, always check the return value of `ci_info.name()` after confirming `ci_info.is_ci()` is `True`. If only general CI detection is needed, `is_ci()` is sufficient.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'ci_info'
The 'ci-info' library is not installed in the Python environment or is being imported with an incorrect module name.
fix
Install the library using pip: `pip install ci-info`. Then, ensure the import statement is `import ci_info`.
AttributeError: module 'ci_info' has no attribute 'isCI'
Developers often confuse the Python library's snake_case naming convention (e.g., `is_ci`) with the camelCase convention of its JavaScript counterpart (`isCI`) or other common patterns.
fix
Use the correct snake_case attribute names for the Python library: `ci_info.is_ci()` instead of `ci_info.isCI` and `ci_info.is_pr()` instead of `ci_info.isPR`.
ci-info not detecting CI
This is not a Python exception, but a common problem where the `ci_info.is_ci()` function returns `False` or `ci_info.name()` returns `None` even when running in a Continuous Integration environment. This typically happens if the CI environment variables that `ci-info` relies on are not set as expected or if the CI provider is not yet supported by the library.
fix
Verify that your CI environment sets standard CI environment variables (e.g., `CI=true`) or specific variables for your CI provider as recognized by `ci-info`. Refer to the `ci-info` documentation for a list of supported CI tools and their detection methods. If your CI is not detected, consider setting a generic `CI` environment variable or contributing to the library's detection logic.
Upgrade
Version history
0.4.0latest on PyPI · released Feb 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
ci-info — pip install ci-info · libregistry