mirror of
https://github.com/ada-dmitry/osint_parser_ada.git
synced 2026-09-24 09:20:21 +00:00
- Implemented DisciplinaryAction model for tracking disciplinary measures. - Created Organization model to represent auditing organizations with relevant details. - Developed TrainingCenter model for educational and methodological centers. - Added methods to convert models to dictionaries for easy export. feat: Implement parsers for auditors and organizations - Developed AuditorsParser to scrape and parse auditor registry data. - Created OrganizationsParser for scraping auditing organizations' registry. - Implemented GenericRegistryParser for handling generic tabular data. chore: Set up base parser functionality - Established BaseParser class with common methods for making requests and parsing HTML. - Added pagination handling and detailed page parsing capabilities. feat: Implement Excel export functionality - Created ExcelExporter class for exporting data to Excel files with formatting options. - Added support for exporting multiple sheets and organization data specifically. chore: Add logging utilities - Implemented setup_logger function for consistent logging across the application. - Configured logging to output to both console and file. chore: Update requirements and scripts - Added necessary dependencies for parsing, Excel handling, and logging. - Created run.sh and run.fish scripts for easy execution of the parser.
56 lines
2.1 KiB
Python
56 lines
2.1 KiB
Python
"""
|
|
Модель данных для сети аудиторских организаций
|
|
"""
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Optional, List, Dict
|
|
from datetime import datetime
|
|
|
|
|
|
@dataclass
|
|
class AuditNetwork:
|
|
"""Модель сети аудиторских организаций"""
|
|
|
|
# Основная информация
|
|
name: str
|
|
network_type: str # "Российская" или "Международная"
|
|
registration_number: Optional[str] = None
|
|
|
|
# Участники
|
|
member_organizations: List[str] = field(default_factory=list)
|
|
member_count: Optional[int] = None
|
|
|
|
# Дополнительная информация
|
|
country: Optional[str] = None
|
|
headquarters: Optional[str] = None
|
|
website: Optional[str] = None
|
|
description: Optional[str] = None
|
|
|
|
# Контакты
|
|
contact_person: Optional[str] = None
|
|
phone: Optional[str] = None
|
|
email: Optional[str] = None
|
|
|
|
# Метаинформация
|
|
source_url: Optional[str] = None
|
|
parsed_at: datetime = field(default_factory=datetime.now)
|
|
|
|
def to_dict(self) -> Dict:
|
|
"""Преобразование в словарь для экспорта"""
|
|
return {
|
|
"Название сети": self.name,
|
|
"Тип": self.network_type,
|
|
"Регистрационный номер": self.registration_number or "",
|
|
"Количество участников": self.member_count or "",
|
|
"Участники": ", ".join(self.member_organizations[:10]), # Первые 10
|
|
"Страна": self.country or "",
|
|
"Штаб-квартира": self.headquarters or "",
|
|
"Сайт": self.website or "",
|
|
"Описание": self.description or "",
|
|
"Контактное лицо": self.contact_person or "",
|
|
"Телефон": self.phone or "",
|
|
"Email": self.email or "",
|
|
"URL источника": self.source_url or "",
|
|
"Дата сбора данных": self.parsed_at.strftime("%d.%m.%Y %H:%M:%S"),
|
|
}
|