Skip to content

Commit 4bdb1aa

Browse files
committed
improve docs, add ci/cd workflow, add unit & integration tests
1 parent 4370097 commit 4bdb1aa

File tree

22 files changed

+655
-100
lines changed

22 files changed

+655
-100
lines changed

.github/workflows/ci.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
python-version: [3.9, 3.10, 3.11, 3.12, 3.13]
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install Poetry
26+
run: curl -sSL https://install.python-poetry.org | python3 -
27+
28+
- name: Configure Poetry to create virtualenvs in project root
29+
run: poetry config virtualenvs.in-project true
30+
31+
- name: Install dependencies
32+
run: poetry install --no-root
33+
34+
- name: Type check with mypy
35+
run: poetry run mypy proxyproviders
36+
37+
- name: Run tests with coverage
38+
env:
39+
RUN_INTEGRATION_TESTS: 1
40+
WEBSHARE_API_KEY: ${{ secrets.WEBSHARE_API_KEY }}
41+
run: |
42+
poetry run coverage run -m pytest
43+
poetry run coverage report --fail-under=95

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: 3.11
19+
20+
- name: Install Poetry
21+
run: curl -sSL https://install.python-poetry.org | python3 -
22+
23+
- name: Configure Poetry
24+
run: poetry config virtualenvs.in-project true
25+
26+
- name: Install dependencies
27+
run: poetry install --no-root
28+
29+
- name: Publish to PyPI
30+
env:
31+
POETRY_PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
32+
run: poetry publish --build

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
__pycache__
2-
test.py
2+
test.py
3+
poetry.lock
4+
.coverage
5+
.DS_Store

.sphinx/conf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
# -- Project information -----------------------------------------------------
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
88

9+
import toml
910
import os
1011
import sys
1112

1213
sys.path.insert(0, os.path.abspath('../'))
14+
pyproject = toml.load('../pyproject.toml')
1315

1416
project = 'ProxyProviders'
1517
copyright = '2025, David Teather'
1618
author = 'David Teather'
17-
release = '0.1.0'
19+
release = pyproject['project']['version']
1820

1921
# -- General configuration ---------------------------------------------------
2022
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

.sphinx/index.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ ProxyProviders Quick Start Documentation
1010
.. include:: ../README.md
1111
:parser: myst_parser.sphinx_
1212

13+
.. _proxyprovider:
14+
.. include:: proxyprovider.rst
15+
1316
.. _providers:
1417
.. include:: proxyproviders.rst
1518

.sphinx/providers/webshare.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
Webshare Provider
2-
-----------------
3-
41
.. automodule:: proxyproviders.providers.webshare
52
:members:
6-
:undoc-members:
7-
:show-inheritance:
8-
:inherited-members:
3+
:show-inheritance:

.sphinx/proxyprovider.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ProxyProvider Shared Interface
2+
===============================
3+
4+
.. automodule:: proxyproviders.proxy_provider
5+
:members:
6+
:undoc-members:
7+
:show-inheritance:
8+
:inherited-members:

.sphinx/proxyproviders.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ ProxyProviders Supported Providers
44
Current Providers Supported:
55

66
* `Webshare.io <https://www.webshare.io/?referral_code=3x5812idzzzp>`_ (referral link) - try out 10 free datacenter proxies
7-
* BrightData
87

98
Don't see a provider you need? Open an issue or submit a PR!
109

10+
.. _webshare:
1111
.. include:: providers/webshare.rst

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,43 @@
1-
# proxyproviders
1+
# ProxyProviders
22
Unified python interface for proxy provider APIs, supports BrightData, WebShare, and more.
3+
4+
[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white&style=flat-square)](https://www.linkedin.com/in/davidteather/) [![Sponsor Me](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/davidteather) [![GitHub release (latest by date)](https://img.shields.io/github/v/release/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/releases) [![GitHub](https://img.shields.io/github/license/davidteather/proxyproviders)](https://github.com/davidteather/proxyproviders/blob/main/LICENSE) [![Downloads](https://pepy.tech/badge/proxyproviders)](https://pypi.org/project/proxyproviders/) ![](https://visitor-badge.laobi.icu/badge?page_id=davidteather.proxyproviders) [![Support Server](https://img.shields.io/discord/783108952111579166.svg?color=7289da&logo=discord&style=flat-square)](https://discord.gg/yyPhbfma6f)
5+
6+
## Table of Contents
7+
8+
- [Documentation](#documentation)
9+
- [Getting Started](#getting-started)
10+
- [How to Support The Project](#how-to-support-the-project)
11+
- [Installing](#installing)
12+
- [Common Issues](#common-issues)
13+
- [Quick Start Guide](#quick-start-guide)
14+
- [Examples](https://github.com/davidteather/proxyproviders/tree/main/examples)
15+
16+
## Documentation
17+
18+
You can find the full documentation [here](https://davidteather.github.io/proxyproviders)
19+
20+
**Note:** If you want to learn how to web scrape websites check my [free and open-source course for learning everything web scraping](https://github.com/davidteather/everything-web-scraping)
21+
22+
### How to Support The Project
23+
24+
- Star the repo 😎
25+
- Consider [sponsoring](https://github.com/sponsors/davidteather) me on GitHub
26+
- Send me an email or a [LinkedIn](https://www.linkedin.com/in/davidteather/) message about what you're doing with it :D
27+
- Submit PRs for issues or any new providers/features :)
28+
29+
## Getting Started
30+
31+
To get started using this package follow the instructions below.
32+
33+
### Installation
34+
35+
This package is installable via pip.
36+
```sh
37+
python -m pip install proxyproviders
38+
```
39+
40+
## Quick Start Guide
41+
42+
43+

proxyproviders/__init__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from .proxy_provider import ProxyProvider
2-
from .providers.brightdata import BrightData
1+
from .proxy_provider import ProxyProvider, ProxyConfig
32
from .providers.webshare import Webshare
43
from .models.proxy import Proxy
54

6-
__all__ = ["ProxyProvider", "BrightData", "Webshare", "Proxy"]
5+
__all__ = ["ProxyProvider", "ProxyConfig", "Webshare", "Proxy"]

0 commit comments

Comments
 (0)