Skip to main content

python-gitea

Python CI pre-commit.ci status Documentation Status codecov PyPI Version Python Versions License: MIT Security: bandit DOI SPEC 0 — Minimum Supported Dependencies

A Python package for interacting with the Gitea API. It provides a simple, intuitive interface to access Gitea repositories, users, organizations, issues, and more, enabling seamless integration with Gitea instances for automation, data retrieval, and management tasks.

Features

  • Full API Coverage: Repositories, users, organizations, issues, pull requests, comments, labels, milestones, notifications, projects, and Actions workflows, runs, and job logs.
  • Easy Authentication: Token-based authentication, with multiple saved accounts and a default-account fallback.
  • Asynchronous Support: Built with async/await for non-blocking operations alongside the synchronous client.
  • Type Hints: Full type annotations for better IDE support and code reliability.
  • Command-Line Interface: Interact with the Gitea API directly from the terminal for quick, scriptable operations without writing code.
  • Comprehensive Documentation: Detailed guides and a generated API reference.

Quick Start

1. Install

uv venv --python 3.13
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install python-gitea

2. Configure an account

gitea-cli config add --name my_account --token YOUR_API_TOKEN --base-url https://gitea.example.com

3. Use the CLI

# List issues of a repository
gitea-cli issue list --owner my-org --repository my-repo

# Get a user
gitea-cli user get --username my-org

4. Use the Python API

from gitea.client.gitea import Gitea

with Gitea(token="YOUR_API_TOKEN", base_url="https://gitea.example.com") as client:
    issues, _ = client.issue.list_issues(owner="my-org", repository="my-repo")

For details, see the Quick Start, Configuration, and Python API guides in the documentation.

Installation

We recommend using uv to manage virtual environments for installing python-gitea.

If you don't have uv installed, you can install it with pip. See the project pages for more details:

  • Install via pip: pip install --upgrade pip && pip install uv
  • Project pages: uv on PyPI | uv on GitHub
  • Full documentation and usage guide: uv docs

Requirements

  • Python 3.12 or higher
  • Operating System: Linux, macOS, or Windows

Install from PyPI

The recommended way to install python-gitea is from PyPI:

# Create a virtual environment (recommended with uv)
uv venv --python 3.12
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install python-gitea

Optional Dependencies

For development or specific features:

# Development dependencies (testing, linting, etc.)
uv pip install python-gitea[dev]

# Documentation dependencies
uv pip install python-gitea[docs]

# All dependencies
uv pip install python-gitea[dev,docs]

Install from Source

For the latest development version:

git clone git@github.com:isaac-cf-wong/python-gitea.git
cd python-gitea
# Create a virtual environment (recommended with uv)
uv venv --python 3.12
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv pip install .

Development Installation

To set up for development:

git clone git@github.com:isaac-cf-wong/python-gitea.git
cd python-gitea

# Create a virtual environment (recommended with uv)
uv venv --python 3.12
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
uv sync --group dev

# Install pre-commit hooks
uv run prek install

Verify Installation

Check that python-gitea is installed correctly:

gitea-cli --help
python -c "import gitea; print(gitea.__version__)"

Documentation

Full documentation is available at https://isaac-cf-wong.github.io/python-gitea.

Contributing

Contributions are welcome! Please read the Contributing Guide before opening a pull request.

Testing

Run the test suite:

uv run pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions, issues, or contributions, please:

Changelog

See Release Notes for version history.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_gitea-0.11.1.tar.gz (483.7 kB view details)

Uploaded Source

Built Distribution

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

python_gitea-0.11.1-py3-none-any.whl (265.2 kB view details)

Uploaded Python 3

File details

Details for the file python_gitea-0.11.1.tar.gz.

File metadata

  • Download URL: python_gitea-0.11.1.tar.gz
  • Upload date:
  • Size: 483.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for python_gitea-0.11.1.tar.gz
Algorithm Hash digest
SHA256 623c04109092c5522c54e9898cf7dad65d5492b2b60c0255e2960975f718c8e6
MD5 349fec5d56ed502593e38ed6d91f4f3e
BLAKE2b-256 fc7b8fd2d215ecbc82f5484e0b0514cfc2a5df083dd4bad5d384ba1188145e7d

See more details on using hashes here.

File details

Details for the file python_gitea-0.11.1-py3-none-any.whl.

File metadata

  • Download URL: python_gitea-0.11.1-py3-none-any.whl
  • Upload date:
  • Size: 265.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for python_gitea-0.11.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f338f5fe69be4800f102c6e36cf8c35e81804a9a86698e8d70427c466cfee0d6
MD5 45b0155e0d7d88e48fe3ed76c2d81b6b
BLAKE2b-256 3b68d86188ce6b1d68bd65500ed806a540fdb10b58119b4b0ea4c30fdfa6a6fa

See more details on using hashes here.

Release history Release notifications | RSS feed

0.11.5

2 files

0.11.4

2 files

0.11.3

2 files

0.11.2

2 files

This release

0.11.1 This release

2 files

0.11.0

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.1

2 files

0.4.0

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page