version updated

This commit is contained in:
Dionysus 2025-03-22 12:46:57 -04:00
parent 6585a7b081
commit c3f0be6777
Signed by: acidvegas
GPG Key ID: EF4B922DB85DC9DE
3 changed files with 11 additions and 13 deletions

View File

@ -5,7 +5,7 @@
from .client import CZDS from .client import CZDS
__version__ = '1.2.9' __version__ = '1.3.0'
__author__ = 'acidvegas' __author__ = 'acidvegas'
__email__ = 'acid.vegas@acid.vegas' __email__ = 'acid.vegas@acid.vegas'
__github__ = 'https://github.com/acidvegas/czds' __github__ = 'https://github.com/acidvegas/czds'

View File

@ -149,19 +149,17 @@ class CZDS:
''' '''
logging.debug(f'Decompressing {filepath}') logging.debug(f'Decompressing {filepath}')
output_path = filepath[:-3] # Remove .gz extension output_path = filepath[:-3] # Remove .gz extension
chunk_size = 1024 * 1024 # 1MB chunks
try: try:
async with aiofiles.open(filepath, 'rb') as f_in: with gzip.open(filepath, 'rb') as gz:
content = await f_in.read() async with aiofiles.open(output_path, 'wb') as f_out:
while True:
# Use BytesIO to handle the content as a file-like object chunk = gz.read(chunk_size)
with io.BytesIO(content) as bytes_io: if not chunk:
with gzip.GzipFile(fileobj=bytes_io, mode='rb') as gz: break
decompressed_content = gz.read() await f_out.write(chunk)
async with aiofiles.open(output_path, 'wb') as f_out:
await f_out.write(decompressed_content)
if cleanup: if cleanup:
os.remove(filepath) os.remove(filepath)

View File

@ -11,7 +11,7 @@ with open('README.md', 'r', encoding='utf-8') as fh:
setup( setup(
name='czds-api', name='czds-api',
version='1.2.9', version='1.3.0',
author='acidvegas', author='acidvegas',
author_email='acid.vegas@acid.vegas', author_email='acid.vegas@acid.vegas',
description='ICANN API for the Centralized Zones Data Service', description='ICANN API for the Centralized Zones Data Service',