This project is a web scraper that automatically collects BISAC (Book Industry Study Group Subject Codes) from the official BISG website and exports them to a CSV file. BISAC codes are the industry standard for categorizing books and publications.
BISAC (Book Industry Study Group Subject Codes) are standardized subject headings used by the book industry to categorize books and publications. Each code follows the format ABC123456 where:
- First 3 characters: Main category (e.g.,
ANTfor Antiques & Collectibles) - Last 6 digits: Specific subcategory
- 🔍 Automated Web Scraping: Fetches data from https://bisg.org/page/bisacedition
- 📊 CSV Export: Exports all codes to a structured CSV file
- 🌍 Turkish Translation: Automatically translates descriptions to Turkish using LibreTranslate
- 🐳 Docker Integration: Local LibreTranslate server for reliable, unlimited translations
- 🚀 Batch Processing: Optimized batch translation (50 items per batch)
- 🛡️ Error Handling: Robust error handling for network issues
- 🔄 Flexible Parsing: Adapts to different HTML structures
- 📝 Detailed Logging: Comprehensive console output for monitoring
- Clone the repository:
git clone <repository-url>
cd bisaccodes- Install dependencies:
npm install- Optional but Recommended: Install Docker Desktop for local translation server:
- Download from Docker Desktop
- Install and start Docker Desktop
- This enables unlimited, fast translations without API rate limits
Run the scraper:
node jscrapebisacs.js
# or
npm run scrapeStep 1: Start LibreTranslate server (if using Docker):
# Windows
start-libretranslate.bat
# Or manually with Docker Compose
docker-compose up -dStep 2: Run translation script:
node addtranslation.js
# or
npm run translateStep 3: Stop LibreTranslate server when done:
# Windows
stop-libretranslate.bat
# Or manually
docker-compose downRun both scraping and translation:
npm run fullThe scripts will:
- Load the main BISG page
- Find all subcategory links
- Scrape BISAC codes from each page
- Save results to
bisac.csv - (Optional) Translate descriptions to Turkish using LibreTranslate and save to
bisac_with_translations.csv
The generated CSV file contains:
- Code: BISAC code (e.g.,
ANT000000) - Description: Category description (e.g.,
Antiques & Collectibles / General) - DescriptionTR: Turkish translation (e.g.,
Antikalar ve Koleksiyon Ürünleri / Genel) - Comment: Additional notes (if any)
jsdom: HTML parsing and DOM manipulationnode-fetch: HTTP requests (built-in fetch in Node.js 18+)Docker: For running LibreTranslate locally (optional but recommended)LibreTranslate: Open-source translation server (runs in Docker container)
bisaccodes/
├── jscrapebisacs.js # Main scraping script
├── addtranslation.js # Turkish translation script
├── docker-compose.yml # LibreTranslate Docker configuration
├── start-libretranslate.bat # Start LibreTranslate server
├── stop-libretranslate.bat # Stop LibreTranslate server
├── bisac.csv # Generated CSV output
├── bisac_with_translations.csv # CSV with Turkish translations
├── package.json # Node.js configuration
├── package-lock.json # Dependency lock file
└── README.md # This file
"Code","Description","Comment"
"","Complete BISAC Subject Headings List","Generated on 2025-10-10T13:56:11.302Z from https://bisg.org/page/bisacedition"
"ANT000000","Antiques & Collectibles / General",""
"ANT056000","Antiques & Collectibles / Advertising",""
"ANT002000","Antiques & Collectibles / Art","""Code","Description","DescriptionTR","Comment"
"","Complete BISAC Subject Headings List","Türkçe çeviriler eklendi","Generated on 2025-10-10T13:56:11.302Z from https://bisg.org/page/bisacedition"
"ANT000000","Antiques & Collectibles / General","Antikalar ve Koleksiyon Ürünleri / Genel",""
"ANT056000","Antiques & Collectibles / Advertising","Antikalar ve Koleksiyon Ürünleri / Reklamcılık",""
"ANT002000","Antiques & Collectibles / Art","Antikalar ve Koleksiyon Ürünleri / Sanat Eserleri",""- 🚀 Local LibreTranslate Server: No API rate limits or external dependencies
- 📦 Docker Integration: Easy setup with
docker-compose up -d - ⚡ Batch Processing: Processes 50 translations per batch for optimal performance
- 🔄 Automatic Retry: Handles temporary network issues gracefully
- 📊 Progress Tracking: Real-time progress updates during translation
- 🛡️ Fallback Handling: Uses original text if translation fails
The script includes comprehensive error handling for:
- Network connectivity issues
- HTTP response errors
- HTML parsing failures
- Missing DOM elements
- Translation API failures
- Docker container issues
ISC License - see LICENSE file for details.
Bu proje, resmi BISG web sitesinden BISAC (Book Industry Study Group Subject Codes) kodlarını otomatik olarak toplayan ve bunları CSV dosyasına aktaran bir web scraper'dır. BISAC kodları, kitapları ve yayınları kategorize etmek için kullanılan endüstri standardıdır.
BISAC (Book Industry Study Group Subject Codes), kitap endüstrisi tarafından kitapları ve yayınları kategorize etmek için kullanılan standartlaştırılmış konu başlıklarıdır. Her kod ABC123456 formatını takip eder:
- İlk 3 karakter: Ana kategori (örn.
ANTAntiques & Collectibles için) - Son 6 rakam: Spesifik alt kategori
- 🔍 Otomatik Web Scraping: https://bisg.org/page/bisacedition adresinden veri çeker
- 📊 CSV Dışa Aktarma: Tüm kodları yapılandırılmış CSV dosyasına aktarır
- 🌍 Türkçe Çeviri: LibreTranslate kullanarak açıklamaları otomatik olarak Türkçe'ye çevirir
- 🐳 Docker Entegrasyonu: Güvenilir, sınırsız çeviriler için yerel LibreTranslate sunucusu
- 🚀 Toplu İşleme: Optimize edilmiş toplu çeviri (grup başına 50 öğe)
- 🛡️ Hata Yönetimi: Ağ sorunları için güçlü hata yönetimi
- 🔄 Esnek Ayrıştırma: Farklı HTML yapılarına uyum sağlar
- 📝 Detaylı Loglama: İzleme için kapsamlı konsol çıktısı
- Depoyu klonlayın:
git clone <repository-url>
cd bisaccodes- Bağımlılıkları yükleyin:
npm install- İsteğe Bağlı ama Önerilen: Yerel çeviri sunucusu için Docker Desktop kurun:
- Docker Desktop adresinden indirin
- Docker Desktop'ı kurun ve başlatın
- Bu, API hız sınırları olmadan sınırsız, hızlı çeviriler sağlar
Scraper'ı çalıştırın:
node jscrapebisacs.js
# veya
npm run scrapeAdım 1: LibreTranslate sunucusunu başlatın (Docker kullanıyorsanız):
# Windows
start-libretranslate.bat
# Veya manuel olarak Docker Compose ile
docker-compose up -dAdım 2: Çeviri scriptini çalıştırın:
node addtranslation.js
# veya
npm run translateAdım 3: İşiniz bittiğinde LibreTranslate sunucusunu durdurun:
# Windows
stop-libretranslate.bat
# Veya manuel olarak
docker-compose downHem scraping hem çeviriyi çalıştırın:
npm run fullScript şunları yapacak:
- Ana BISG sayfasını yükleyecek
- Tüm alt kategori linklerini bulacak
- Her sayfadan BISAC kodlarını toplayacak
- Sonuçları
bisac.csvdosyasına kaydedecek - (İsteğe bağlı) Açıklamaları LibreTranslate kullanarak Türkçe'ye çevirip
bisac_with_translations.csvdosyasına kaydedecek
Oluşturulan CSV dosyası şunları içerir:
- Code: BISAC kodu (örn.
ANT000000) - Description: Kategori açıklaması (örn.
Antiques & Collectibles / General) - DescriptionTR: Türkçe çeviri (örn.
Antikalar ve Koleksiyon Ürünleri / Genel) - Comment: Ek notlar (varsa)
jsdom: HTML ayrıştırma ve DOM manipülasyonunode-fetch: HTTP istekleri (Node.js 18+ ile yerleşik fetch)Docker: LibreTranslate'ı yerel olarak çalıştırmak için (isteğe bağlı ama önerilen)LibreTranslate: Açık kaynak çeviri sunucusu (Docker konteynerinde çalışır)
bisaccodes/
├── jscrapebisacs.js # Ana scraping scripti
├── addtranslation.js # Türkçe çeviri scripti
├── docker-compose.yml # LibreTranslate Docker yapılandırması
├── start-libretranslate.bat # LibreTranslate sunucusunu başlat
├── stop-libretranslate.bat # LibreTranslate sunucusunu durdur
├── bisac.csv # Oluşturulan CSV çıktısı
├── bisac_with_translations.csv # Türkçe çevirilerle CSV
├── package.json # Node.js yapılandırması
├── package-lock.json # Bağımlılık kilidi dosyası
└── README.md # Bu dosya
"Code","Description","Comment"
"","Complete BISAC Subject Headings List","Generated on 2025-10-10T13:56:11.302Z from https://bisg.org/page/bisacedition"
"ANT000000","Antiques & Collectibles / General",""
"ANT056000","Antiques & Collectibles / Advertising",""
"ANT002000","Antiques & Collectibles / Art","""Code","Description","DescriptionTR","Comment"
"","Complete BISAC Subject Headings List","Türkçe çeviriler eklendi","Generated on 2025-10-10T13:56:11.302Z from https://bisg.org/page/bisacedition"
"ANT000000","Antiques & Collectibles / General","Antikalar ve Koleksiyon Ürünleri / Genel",""
"ANT056000","Antiques & Collectibles / Advertising","Antikalar ve Koleksiyon Ürünleri / Reklamcılık",""
"ANT002000","Antiques & Collectibles / Art","Antikalar ve Koleksiyon Ürünleri / Sanat Eserleri",""- 🚀 Yerel LibreTranslate Sunucusu: API hız sınırları veya harici bağımlılıklar yok
- 📦 Docker Entegrasyonu:
docker-compose up -dile kolay kurulum - ⚡ Toplu İşleme: Optimal performans için grup başına 50 çeviri işler
- 🔄 Otomatik Yeniden Deneme: Geçici ağ sorunlarını zarif bir şekilde halleder
- 📊 İlerleme Takibi: Çeviri sırasında gerçek zamanlı ilerleme güncellemeleri
- 🛡️ Yedek İşleme: Çeviri başarısız olursa orijinal metni kullanır
Script şunlar için kapsamlı hata yönetimi içerir:
- Ağ bağlantı sorunları
- HTTP yanıt hataları
- HTML ayrıştırma hataları
- Eksik DOM elementleri
- Çeviri API hataları
- Docker konteyner sorunları
ISC Lisansı - detaylar için LICENSE dosyasına bakın.
Contributions are welcome! Please feel free to submit a Pull Request.
Katkılarınız memnuniyetle karşılanır! Lütfen Pull Request göndermekten çekinmeyin.
If you encounter any issues or have questions, please open an issue on GitHub.
Herhangi bir sorunla karşılaşırsanız veya sorularınız varsa, lütfen GitHub'da bir issue açın.