Python library for getting a list of details regarding the Bulgarian State Gazette (Държавен вестник) issues
Project description
📰 Vestige
A Python library for fetching and parsing issues of the Bulgarian State Gazette (Държавен вестник).
Vestige gives you a clean, dependency-light Python interface to the official Държавен вестник listing. Scrape issue metadata and download links without wrestling with raw HTML or cryptic JSF form fields ever again.
✨ Features
- 📄 Issue Listings: Fetch paginated lists of State Gazette issues, including issue number, date, year, and type.
- 📥 Download Links: Automatically resolve the PDF and RTF download URLs for each issue.
- 🔌 Pluggable Architecture: Swap out the HTTP transport or the HTML parser via simple interfaces — great for testing with mocks.
- 🗂️ Typed Models: Clean dataclasses (
IssueEntry,DownloadFile,PageResult) withto_dict()helpers for easy JSON serialization. - ⚡ Minimal Dependencies: Only needs
selectolaxandhttpx[http2].
📥 Installation
pip install vestige-scraper
Or, to install directly from source:
pip install .
🚀 Quick Start
import asyncio
from vestige import DVClient
async def main():
client = DVClient()
try:
# Fetch the first page of issues (with download URLs resolved)
page = await client.get_page(1)
print(page)
# PageResult(page=1, total_results=..., total_pages=..., entries=...)
for entry in page.entries:
print(entry)
for file in entry.download_urls:
print(f" → {file.filename}: {file.url}")
finally:
await client.aclose()
asyncio.run(main())
Fetch all pages at once
import asyncio
from vestige import DVClient
async def main():
client = DVClient()
try:
all_pages = await client.get_all_pages(max_pages=5)
for page in all_pages:
for entry in page.entries:
print(entry.to_dict())
finally:
await client.aclose()
asyncio.run(main())
Skip download URL resolution (faster)
page = client.get_page(1, fetch_downloads=False)
🗂️ Models
| Class | Description |
|---|---|
IssueEntry |
One issue of the State Gazette — number, date, year, type, and download files. |
DownloadFile |
A single downloadable file (url, filename). |
PageResult |
One page of results — holds metadata and a list of IssueEntry objects. |
⚙️ Advanced Usage
Custom transport / parser (e.g. for testing)
from vestige import DVClient
from vestige.network.transport import AsyncRequestsTransport
from vestige.scraping.parsers import IssueParser
client = DVClient(
transport=MyCustomTransport(),
parser=MyCustomParser(),
)
Both transport and parser accept any object that satisfies the AsyncPageFetcher and PageParser interfaces defined in vestige.core.interfaces.
🐍 Requirements
- Python 3.10+
asyncio>=4.0.0selectolax>=0.4.7httpx[http2]>=0.28.1
🤝 Contributing
Issues and pull requests are welcome! Please file an issue if you encounter any problems or have suggestions for improvements.
Built with ❤️ for Bulgaria's open data. MIT Licensed.
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 vestige_scraper-1.2.0.tar.gz.
File metadata
- Download URL: vestige_scraper-1.2.0.tar.gz
- Upload date:
- Size: 13.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
674a47dd7de9abdfe1998360549918e48aca52d68204305acbb0c887a54bd70f
|
|
| MD5 |
557b79984997baba221e47d9fd72ba75
|
|
| BLAKE2b-256 |
a406ebf72233b915bab4f81f5eed5b3d67f6a0dca0298b50771b48d109b846bd
|
Provenance
The following attestation bundles were made for vestige_scraper-1.2.0.tar.gz:
Publisher:
publish.yml on ytcalifax/vestige
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vestige_scraper-1.2.0.tar.gz -
Subject digest:
674a47dd7de9abdfe1998360549918e48aca52d68204305acbb0c887a54bd70f - Sigstore transparency entry: 1145263042
- Sigstore integration time:
-
Permalink:
ytcalifax/vestige@14942657515874c5785a2c1b93deb0b8bff9aed6 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/ytcalifax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@14942657515874c5785a2c1b93deb0b8bff9aed6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file vestige_scraper-1.2.0-py3-none-any.whl.
File metadata
- Download URL: vestige_scraper-1.2.0-py3-none-any.whl
- Upload date:
- Size: 14.3 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 |
9de9b9467243f6955b3eded02c7128888dba7c88846ca6290caf16e83dddf63a
|
|
| MD5 |
eb597d75d91199815aafac2efc223a29
|
|
| BLAKE2b-256 |
5c07ebdfab3df0b0440892c7fd1fb3f667dfb812820a5b049463f6f1e3d1dd0d
|
Provenance
The following attestation bundles were made for vestige_scraper-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on ytcalifax/vestige
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
vestige_scraper-1.2.0-py3-none-any.whl -
Subject digest:
9de9b9467243f6955b3eded02c7128888dba7c88846ca6290caf16e83dddf63a - Sigstore transparency entry: 1145263103
- Sigstore integration time:
-
Permalink:
ytcalifax/vestige@14942657515874c5785a2c1b93deb0b8bff9aed6 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/ytcalifax
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@14942657515874c5785a2c1b93deb0b8bff9aed6 -
Trigger Event:
release
-
Statement type: