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
__version__ = '1.2.9'
__version__ = '1.3.0'
__author__ = 'acidvegas'
__email__ = 'acid.vegas@acid.vegas'
__github__ = 'https://github.com/acidvegas/czds'

View File

@ -149,19 +149,17 @@ class CZDS:
'''
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:
async with aiofiles.open(filepath, 'rb') as f_in:
content = await f_in.read()
# Use BytesIO to handle the content as a file-like object
with io.BytesIO(content) as bytes_io:
with gzip.GzipFile(fileobj=bytes_io, mode='rb') as gz:
decompressed_content = gz.read()
async with aiofiles.open(output_path, 'wb') as f_out:
await f_out.write(decompressed_content)
with gzip.open(filepath, 'rb') as gz:
async with aiofiles.open(output_path, 'wb') as f_out:
while True:
chunk = gz.read(chunk_size)
if not chunk:
break
await f_out.write(chunk)
if cleanup:
os.remove(filepath)

View File

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