Skip to content

Schema

pycodecov.schemas

Module to store common schema classes used by pycodecov.

BaseCommit dataclass

A schema used to store info about base commit.

Attributes:

Name Type Description
commitid str

commit SHA.

message str | None

commit message.

timestamp datetime

timestamp when commit was made.

BaseReportFile dataclass

A schema used to store info about base report file.

Attributes:

Name Type Description
name str

file path.

totals ReportTotal

coverage totals.

BaseTotal dataclass

A schema used to store info about base totals coverage information.

Attributes:

Name Type Description
files int

files count.

lines int

lines count.

hits int

hits count.

misses int

misses count.

partials int

partials count.

coverage float

coverage count.

branches int

branches count.

methods int

methods count.

Branch dataclass

A schema used to store info about branch.

Attributes:

Name Type Description
name str

branch name.

updatestamp datetime

last time the branch was updated.

BranchDetail dataclass

Bases: Branch

A schema used to store info about branch detail.

Attributes:

Name Type Description
head_commit CommitDetail

branch's current head commit.

Commit dataclass

Bases: BaseCommit

A schema used to store info about commit.

Attributes:

Name Type Description
ci_passed bool | None

whether the CI process passed for this commit.

author Owner | None

commit author.

branch str | None

branch name on which this commit currently lives.

totals CommitTotal | None

commit totals coverage information.

state CommitState | None

codecov processing state for this commit.

parent str | None

commit SHA of first ancestor commit with coverage.

CommitComparison dataclass

A schema used to store info about commit comparison.

Attributes:

Name Type Description
base_commit str

base commit SHA.

head_commit str

head commit SHA.

totals TotalComparison

total comparison.

commit_uploads list[Commit]

list of commits.

diff DiffComparison

diff comparison.

files list[FileComparison]

list of files comparison.

untracked list[str]

list of untracked files name.

has_unmerged_base_commits bool

whether if any commits exist in the base reference but not in the head reference.

CommitCoverage dataclass

A schema used to store info about commit coverage.

Attributes:

Name Type Description
totals ReportTotal

totals coverage report information.

commit_file_url str

Codecov URL to see file coverage on commit.

CommitCoverageReport dataclass

Bases: CommitCoverage

A schema used to store info about commit coverage report.

Attributes:

Name Type Description
files list[ReportFile]

file specific commit coverage totals.

CommitCoverageTotal dataclass

Bases: CommitCoverage

A schema used to store info about commit coverage report.

Attributes:

Name Type Description
files list[BaseReportFile]

file specific commit coverage totals.

CommitDetail dataclass

Bases: Commit

A schema used to store info about commit detail.

Attributes:

Name Type Description
report Report

coverage report.

CommitTotal dataclass

Bases: BaseTotal

A schema used to store info about totals coverage commit information.

Attributes:

Name Type Description
sessions int

sessions count.

complexity float

complexity count.

complexity_total float

complexity_total count.

complexity_ratio float

complexity_ratio count.

Component dataclass

A schema used to store info about component.

Attributes:

Name Type Description
component_id str

component id.

name str

component name.

ComponentComparison dataclass

Bases: Component

A schema used to store info about component comparison.

Attributes:

Name Type Description
base_report_totals ReportTotal

base totals coverage report information.

head_report_totals ReportTotal

head totals coverage report information.

diff_totals ReportTotal | None

diff totals coverage report information.

CoverageTrend dataclass

A schema used to store info about coverage trend.

Attributes:

Name Type Description
timestamp datetime

coverage trend timestamp.

min float

minimum value coverage trend.

max float

maximum value coverage trend.

avg float

average value coverage trend.

DiffComparison dataclass

A schema used to store info about diff comparison.

Attributes:

Name Type Description
git_commits list[GitCommit]

list of git commit.

FileChangeSummaryComparison dataclass

A schema used to store info about file coverage change summary comparison.

Attributes:

Name Type Description
hits int | None

line coverage hits count summary.

misses int | None

line coverage misses count summary.

partials int | None

line coverage partials count summary.

FileComparison dataclass

A schema used to store info about file comparison.

Attributes:

Name Type Description
name FileNameComparison

file name comparison.

totals TotalComparison

totals file comparison.

has_diff bool

whether the file has diff data.

stats FileStatComparison | None

file stat.

change_summary FileChangeSummaryComparison | None

file coverage change summary.

lines list[LineComparison]

lines comparison.

FileNameComparison dataclass

A schema used to store info about file name comparison.

Attributes:

Name Type Description
base str | None

base file name.

head str | None

head file name.

FileStatComparison dataclass

A schema used to store info about file stat comparison.

Attributes:

Name Type Description
added int

added count.

removed int

removed count.

Flag dataclass

A schema used to store info about flag.

Attributes:

Name Type Description
name str

flag name.

FlagComparison dataclass

Bases: Flag

A schema used to store info about flag comparison.

Attributes:

Name Type Description
base_report_totals ReportTotal

base totals coverage report information.

head_report_totals ReportTotal

head totals coverage report information.

diff_totals ReportTotal | None

diff totals coverage report information.

GitAuthor dataclass

A schema used to store info about git author.

Attributes:

Name Type Description
id int

git author id.

username str | None

username of the git author.

name str

name of the git author.

email str

name of the git author.

GitCommit dataclass

Bases: BaseCommit

A schema used to store info about git commit.

Attributes:

Name Type Description
author GitAuthor

commit author.

Line dataclass

A schema used to store info about line.

Attributes:

Name Type Description
number int

line number.

coverage Coverage

line coverage status.

LineComparison dataclass

A schema used to store info about line comparison.

Attributes:

Name Type Description
value str

text contained in the line.

number LineNumberComparison

line number comparison.

coverage LineCoverageComparison

line coverage status comparison.

is_diff bool

whether the line is in diff.

added bool

whether the line was added.

removed bool

whether the line was removed.

sessions int

sessions count.

LineCoverageComparison dataclass

A schema used to store info about line coverage comparison.

Attributes:

Name Type Description
base Coverage | None

base line coverage status.

head Coverage | None

head line coverage status.

LineNumberComparison dataclass

A schema used to store info about line number comparison.

Attributes:

Name Type Description
base int | None

base line number.

head int | None

head line number.

Owner dataclass

A schema used to store info about owner.

Attributes:

Name Type Description
service Service

Git hosting service provider of the owner.

username str | None

username of the owner.

name str | None

name of the owner.

PaginatedList dataclass

A schema used to store info about paginated list.

Attributes:

Name Type Description
count int

total number of result elements.

next CodecovUrl | None

codecov uri for the next result page.

previous CodecovUrl | None

codecov uri for the previous result page.

results list[T]

list of contained elements for the current page.

total_pages int

total result pages.

Pull dataclass

A schema used to store info about pull.

Attributes:

Name Type Description
pullid int

pull id number.

title str | None

title of the pull.

base_total CommitTotal

coverage totals of base commit.

head_total CommitTotal

coverage totals of head commit.

updatestamp datetime

last time the pull was updated.

state PullState

pull state of the pull.

ci_passed bool

whether pull pass ci.

author Owner | None

pull author.

Repo dataclass

A schema used to store info about repository.

Attributes:

Name Type Description
name str

repository name.

private bool

whether private or public repository.

updatestamp datetime | None

last time the repository was updated.

author Owner

repository owner.

language Language | None

primary programming language used.

branch str

default branch name.

active bool | None

whether the repository has received a coverage upload.

activated bool | None

whether the repository has been manually deactivated.

totals CommitTotal | None

recent commit totals on the default branch.

RepoConfig dataclass

A schema used to store info about repository config.

Attributes:

Name Type Description
upload_token str

token used for uploading coverage reports for repository.

graph_token str

token used for repository graphs.

Report dataclass

A schema used to store info about report.

Attributes:

Name Type Description
totals ReportTotal

coverage totals.

files list[BaseReportFile]

file specific coverage totals.

ReportFile dataclass

Bases: BaseReportFile

A schema used to store info about report file.

Attributes:

Name Type Description
line_coverage list[Line]

line-by-line coverage values.

ReportTotal dataclass

Bases: BaseTotal

A schema used to store info about totals coverage report information.

Attributes:

Name Type Description
messages int

messages count.

sessions int

sessions count.

complexity float

complexity count.

complexity_total float

complexity_total count.

complexity_ratio float

complexity_ratio count.

diff int | list[int | str | None]

diff report.

TotalComparison dataclass

A schema used to store info about total comparison.

Attributes:

Name Type Description
base ReportTotal

base totals coverage report information.

head ReportTotal

head totals coverage report information.

patch ReportTotal | None

patch totals coverage report information.

User dataclass

Bases: Owner

A schema used to store info about user.

Attributes:

Name Type Description
activated bool | None

whether the user has been manually deactivated.

is_admin bool | None

whether the user is an admin.

email str | None

email of the user.

Note

It is actually impossible for the fields activated and is_admin to have the value None based on the API documentation, however, to make it easier to use the API wrapper so that it is more flexible, these fields are made so that they can contain the value None.