Automation and integration tools for Upwork projects
Project description
Upwork Learning
Automation and Integration Tools for Upwork Projects.
A comprehensive Python library for building automation workflows with Google Sheets, PDF processing, email automation, and API integrations.
Features
- Google Sheets Integration - Read, write, and sync data with Google Sheets
- PDF Processing - Extract text, tables, and structured data from PDFs
- Email Automation - Send emails, fetch inbox, and auto-reply workflows
- API Integrations - Tools for integrating with APIs like Bol.com
- CLI Tools - Command-line interface for all operations
- Best Practices - Type hints, testing, linting, documentation, and security scanning
Use Case Catalog
Quick reference for common automation tasks. Each use case includes CLI command and Python API.
| # | Use Case | Input | Output | CLI Command | Python API | ENV Required |
|---|---|---|---|---|---|---|
| 1 | Read Google Sheet | spreadsheet_id, range |
2D list [["A","B"],["C","D"]] |
python -m src.cli sheets-read -s ID -r "A1:C10" |
GoogleSheetsClient.read_range() |
GOOGLE_SHEETS_CREDENTIALS_PATH |
| 2 | Write to Google Sheet | spreadsheet_id, range, values |
Updated cells | python -m src.cli sheets-write -s ID -r A1 --values '[["X"]]' |
GoogleSheetsClient.write_range() |
GOOGLE_SHEETS_* |
| 3 | List worksheets | spreadsheet_id |
List ["Sheet1","Sheet2"] |
python -m src.cli sheets-list -s ID |
GoogleSheetsClient.get_worksheets() |
GOOGLE_SHEETS_* |
| 4 | Extract PDF text | PDF file path | String with all text | python -m src.cli pdf-extract-text doc.pdf |
PDFProcessor.extract_all_text() |
- |
| 5 | Extract PDF tables | PDF file path | List of dicts [{col: val}] |
python -m src.cli pdf-extract-tables doc.pdf -o tables.json |
PDFProcessor.extract_tables_as_dicts() |
- |
| 6 | Extract invoice data | Invoice PDF path | Dict {invoice_number, date, total, vat} |
python -m src.cli pdf-extract-invoice invoice.pdf |
PDFProcessor.extract_invoice_data() |
- |
| 7 | Search in PDF | PDF path, keyword | Matches with context | - | PDFProcessor.extract_by_keyword("invoice") |
- |
| 8 | Send email | to, subject, body |
Sent status | python -m src.cli email-send -t "a@b.com" -s "Hi" -b "Hello" |
EmailClient.send_email() |
SMTP_HOST, SMTP_USER, SMTP_PASSWORD |
| 9 | Fetch emails | folder, limit |
List [ReceivedEmail(...)] |
python -m src.cli email-fetch -f INBOX -l 10 |
EmailClient.fetch_emails() |
IMAP_HOST, IMAP_USER, IMAP_PASSWORD |
| 10 | Mark email read | UID | Updated flags | - | EmailClient.mark_as_read(uid) |
IMAP_* |
| 11 | Delete email | UID | Moved to trash | - | EmailClient.delete_email(uid) |
IMAP_* |
| 12 | PDF → Google Sheets | PDF path, spreadsheet_id | Synced table rows | - | examples/pdf_to_sheets.py |
GOOGLE_SHEETS_* |
| 13 | Bol.com → Sheets | category, spreadsheet_id | Product catalog in Sheet | python -m examples.bol_com.cli sync-sheets -s ID -c electronics |
sync_to_sheets() |
BOL_CLIENT_ID, BOL_CLIENT_SECRET |
| 14 | Daily report email | recipients, data dict | Sent email | - | examples/auto_email.py::send_daily_report() |
SMTP_*, GOOGLE_SHEETS_* |
| 15 | Alert email | recipients, alert_type, message | Sent alert | - | examples/auto_email.py::send_alert_email() |
SMTP_* |
Environment Variables
# Google Sheets
GOOGLE_SHEETS_CREDENTIALS_PATH=config/credentials.json
GOOGLE_SHEETS_SPREADSHEET_ID=your_spreadsheet_id
# Email
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_app_password
IMAP_HOST=imap.gmail.com
IMAP_PORT=993
IMAP_USER=your_email@gmail.com
IMAP_PASSWORD=your_app_password
# API Keys
BOL_CLIENT_ID=your_client_id
BOL_CLIENT_SECRET=your_client_secret
Installation
# Using uv (recommended)
uv venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
uv pip install -e .
# Using pip
pip install -e .
Quick Start
Python API
from src.integrations.google_sheets import GoogleSheetsClient
# Read from Google Sheets
with GoogleSheetsClient(spreadsheet_id="YOUR_ID") as client:
data = client.read_range("Sheet1!A1:C10")
print(data)
from src.integrations.pdf_processor import PDFProcessor
# Extract data from PDF
processor = PDFProcessor()
with processor:
processor.open("invoice.pdf")
text = processor.extract_all_text()
tables = processor.extract_tables()
CLI
# Read from Google Sheets
python -m src.cli sheets-read --spreadsheet-id ID --range "A1:C10"
# Extract text from PDF
python -m src.cli pdf-extract-text document.pdf
# Send email
python -m src.cli email-send --to "a@b.com" --subject "Hi" --body "Hello"
Development
Using Nox (Recommended)
# Install nox
uv pip install nox
# Run all quality checks
nox -s all
# Run specific session
nox -s lint # Lint code
nox -s test # Run tests with coverage
nox -s test-fast # Run tests (faster)
nox -s typecheck # Type check with mypy
nox -s format # Format code
nox -s docs # Build documentation
nox -s docs-serve # Serve docs locally
nox -s security # Secret scanning
nox -s spell # Spell check
# Run specific test
nox -s test -- tests/integrations/test_google_sheets.py
# Install pre-commit hooks
nox -s install-hooks
# Clean build artifacts
nox -s clean
Manual Commands
# Install development dependencies
uv pip install -e ".[dev]"
# Run tests
pytest
# Lint code
ruff check src/ tests/
# Format code
ruff format src/ tests/
# Type check
mypy src/
# Build docs
mkdocs build --strict
# Secret scanning
gitleaks detect --source . -v
# Spell check
codespell src/ tests/ docs/
Project Structure
upwork-learning/
├── src/
│ ├── integrations/ # Integration modules (Sheets, PDF, Email)
│ ├── utils/ # Utilities (logger, config, retry)
│ └── cli.py # CLI entry point
├── tests/ # Test suite
├── examples/ # Example usage
│ ├── bol_com/ # Bol.com API integration
│ ├── pdf_to_sheets.py # PDF to Sheets workflow
│ └── auto_email.py # Email automation examples
├── docs/ # MkDocs documentation
├── .github/
│ └── workflows/ # CI/CD pipelines
├── noxfile.py # Development tasks
├── pyproject.toml # Project configuration
└── .gitleaks.toml # Secret scanning rules
Documentation
Full documentation is available at:
License
MIT License - see LICENSE for details.
Author
Petr Nazarenko
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file upwork_learning-0.1.0.tar.gz.
File metadata
- Download URL: upwork_learning-0.1.0.tar.gz
- Upload date:
- Size: 165.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
34dce693118cd205aca7a9a89f09c74284db5d25bb34c725c1355607cb5b8c88
|
|
| MD5 |
3dbb6ee77be3c57922085cd60842a0f2
|
|
| BLAKE2b-256 |
24566d54e9f6814c66eca6ab3c25fe2c59a4869dae746731f4d12f0cf63040dc
|
Provenance
The following attestation bundles were made for upwork_learning-0.1.0.tar.gz:
Publisher:
release.yml on petro-nazarenko/Agent-Guidelines-for-Upwork-Learning-Projects
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
upwork_learning-0.1.0.tar.gz -
Subject digest:
34dce693118cd205aca7a9a89f09c74284db5d25bb34c725c1355607cb5b8c88 - Sigstore transparency entry: 1188935101
- Sigstore integration time:
-
Permalink:
petro-nazarenko/Agent-Guidelines-for-Upwork-Learning-Projects@c0000bc230bdb0fe31438022e1aba5080afa1c45 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/petro-nazarenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c0000bc230bdb0fe31438022e1aba5080afa1c45 -
Trigger Event:
push
-
Statement type:
File details
Details for the file upwork_learning-0.1.0-py3-none-any.whl.
File metadata
- Download URL: upwork_learning-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e07c77d746ad5fa1a6866ec840012c803458478a231f9940a116061b023e2a7c
|
|
| MD5 |
1cb61fc32a748fe97862f513c5ee0dcc
|
|
| BLAKE2b-256 |
384e3a11595f6732935ab87f8165ca155c4efda0706aa53ecd4f78d189370857
|
Provenance
The following attestation bundles were made for upwork_learning-0.1.0-py3-none-any.whl:
Publisher:
release.yml on petro-nazarenko/Agent-Guidelines-for-Upwork-Learning-Projects
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
upwork_learning-0.1.0-py3-none-any.whl -
Subject digest:
e07c77d746ad5fa1a6866ec840012c803458478a231f9940a116061b023e2a7c - Sigstore transparency entry: 1188935106
- Sigstore integration time:
-
Permalink:
petro-nazarenko/Agent-Guidelines-for-Upwork-Learning-Projects@c0000bc230bdb0fe31438022e1aba5080afa1c45 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/petro-nazarenko
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c0000bc230bdb0fe31438022e1aba5080afa1c45 -
Trigger Event:
push
-
Statement type: