Skip to content

ark1375/GoftinoWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Goftino Python Wrapper

Logo

A lightweight, structured Python wrapper for interacting with the Goftino API. This package provides a clean client interface, typed data models, logging support, and optional data fetching utilities.


Disclaimer

This project is developed by the Data Team at PayPing (Mana Tadbir Avatech).

This repository is an unofficial Python wrapper for the Goftino Web API and is not affiliated with, endorsed by, or maintained by Goftino.
The official Goftino API documentation is available at: Goftino API.

This project is released under the MIT License, and its use is permitted under the terms of that license.

All feature requests, bug reports, and improvements should be submitted through the GitHub Issues section of this repository.


✨ Features

  • Clean and minimal API client (wrapper.client)
  • Typed request/response models (wrapper.data_types)
  • Fetcher utilities for structured retrieval (fetcher.fetcher)
  • Logging support via log_config.json
  • Packaged and distributable via pyproject.toml / setup.py
  • Unit and manual tests included

πŸ“¦ Installation

Install from source

git clone https://github.com/ark1375/GoftinoWrapper.git
cd goftino-wrapper
pip install .

Note that you may need python build tools installed on your system.

Install in development mode

pip install -e .

πŸ“ Project Structure

goftino-wrapper/
β”‚
β”œβ”€β”€ goftino/
β”‚   β”œβ”€β”€ wrapper/
β”‚   β”‚   β”œβ”€β”€ client.py        # Main API client
β”‚   β”‚   β”œβ”€β”€ data_types.py    # Typed request/response models
β”‚   β”‚   └── __init__.py
β”‚   β”‚
β”‚   β”œβ”€β”€ fetcher/
β”‚   β”‚   β”œβ”€β”€ fetcher.py       # Higher-level data retrieval logic
β”‚   β”‚   └── __init__.py
β”‚   β”‚
β”‚   β”œβ”€β”€ utils.py             # Utility helpers
β”‚   └── __init__.py
β”‚
β”œβ”€β”€ tests/                   # Unit and integration tests
β”œβ”€β”€ logs/                    # Log output directory
β”œβ”€β”€ log_config.json          # Logging configuration
β”œβ”€β”€ pyproject.toml           # Modern packaging configuration
β”œβ”€β”€ setup.py                 # Legacy packaging support
β”œβ”€β”€ README.md
└── LICENSE

πŸš€ Quick Start

1️⃣ Initialize the Client

from goftino.wrapper.client import GoftinoClient

client = GoftinoClient(
    api_key="YOUR_API_KEY"
)

The GoftinoClient is the main entry point to interact with the API.


2️⃣ Using Typed Data Models

The wrapper uses structured data classes from:

from goftino.wrapper.data_types import SomeRequestType

Example:

request = SomeRequestType(
    field1="value",
    field2=123
)

response = client.some_method(request)
print(response)

Typed models ensure:

  • Better IDE autocomplete
  • Type safety
  • Cleaner request validation
  • Structured API responses

🧠 Architecture Overview

🧩 Wrapper Layer (wrapper/)

This is the core of the library.

client.py

  • Handles authentication
  • Manages HTTP requests
  • Parses responses
  • Centralizes error handling

The wrapper abstracts raw API calls and exposes Pythonic methods instead.

data_types.py

  • Defines structured request/response schemas
  • Encapsulates payload formatting
  • Improves clarity and maintainability

πŸ“‘ Fetcher Layer (fetcher/)

The fetcher module builds on top of the client to:

  • Retrieve bulk or paginated data
  • Handle retries
  • Normalize results
  • Provide higher-level abstractions

Example usage:

from goftino.fetcher.fetcher import GoftinoFetcher

fetcher = GoftinoFetcher(client)
data = fetcher.retrieve_all()

Use the fetcher when:

  • You need bulk extraction
  • You want automation around pagination
  • You need structured retrieval workflows

⚠️ Consider this module as Experimental. Proceed with caution.


πŸ”§ Utilities (utils.py)

Shared helpers used internally by:

  • Client
  • Fetcher
  • Logging system

This keeps the client clean and avoids duplication.


πŸ” Configuration

Logging

Logging is configured via:

log_config.json

Logs are written to:

logs/goftino.log

You can customize:

  • Log level
  • Format
  • Output destination

πŸ—οΈ Packaging

This project supports both:

  • pyproject.toml (PEP 517/518 modern build system)
  • setup.py (legacy compatibility)

Build distribution:

python -m build

Artifacts will appear in:

dist/

Example:

goftino_wrapper-0.1.7.*-py3-none-any.whl

Install locally from built wheel:

pip install dist/goftino_wrapper-0.1.7.*-py3-none-any.whl

πŸ›  Development Workflow

1️⃣ Create virtual environment

python -m venv venv
source venv/bin/activate

2️⃣ Install dependencies

pip install -r requirements.txt

or

pip install -e .

🎯 When to Use This Wrapper

Use this package if you:

  • Want a structured Python interface to Goftino
  • Prefer typed request/response handling
  • Need clean abstraction over HTTP calls
  • Want reusable retrieval workflows

πŸ“Œ Example End-to-End Usage

from goftino.wrapper.client import GoftinoClient
from goftino.fetcher.fetcher import GoftinoFetcher

client = GoftinoClient(api_key="YOUR_API_KEY")
fetcher = GoftinoFetcher(client)

conversations = fetcher.retrieve_all()

for conv in conversations:
    print(conv.id, conv.created_at)

πŸ“„ License

This project is licensed under the MIT License.


🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Add tests
  4. Submit a PR

About

A Python Wrapper for Goftino API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages