czds

- ICANN Centralized Zone Data Service Tool
git clone git://git.acid.vegas/czds.git
Log | Files | Refs | Archive | README | LICENSE

commit 72b4ec78fcc3be9cdf1610d8511aefccc8de28b4
parent ea2919b8bad4fdc2b3de567b2adc83f39ef3089d
Author: acidvegas <acid.vegas@acid.vegas>
Date: Fri, 21 Feb 2025 12:13:00 -0500

Fixed cli not parsing args or showing help

Diffstat:
Mczds/__init__.py | 2+-
Mczds/__main__.py | 14+++++++++-----
Aczds_api.egg-info/PKG-INFO | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Aczds_api.egg-info/SOURCES.txt | 12++++++++++++
Aczds_api.egg-info/dependency_links.txt | 1+
Aczds_api.egg-info/entry_points.txt | 2++
Aczds_api.egg-info/top_level.txt | 1+
Adist/czds_api-1.0.0-py3-none-any.whl | 0
Adist/czds_api-1.0.0.tar.gz | 0
Msetup.py | 2+-

10 files changed, 117 insertions(+), 7 deletions(-)

diff --git a/czds/__init__.py b/czds/__init__.py
@@ -5,7 +5,7 @@
 from .client import CZDS
 
 
-__version__ = '1.0.0'
+__version__ = '1.0.1'
 __author__  = 'acidvegas'
 __email__   = 'acid.vegas@acid.vegas'
 __github__  = 'https://github.com/acidvegas/czds'
 \ No newline at end of file
diff --git a/czds/__main__.py b/czds/__main__.py
@@ -12,7 +12,7 @@ import time
 from .client import CZDS
 
 
-def main(username: str, password: str, concurrency: int) -> None:
+def run_czds(username: str, password: str, concurrency: int) -> None:
     '''
     Main function to download all zone files
     
@@ -61,8 +61,8 @@ def main(username: str, password: str, concurrency: int) -> None:
                 logging.error(f'{url} generated an exception: {e}')
 
 
-
-if __name__ == '__main__':
+def main():
+    '''Entry point for the command line interface'''
     parser = argparse.ArgumentParser(description='ICANN API for the Centralized Zones Data Service')
     parser.add_argument('-u', '--username', default=os.getenv('CZDS_USER'), help='ICANN Username')
     parser.add_argument('-p', '--password', default=os.getenv('CZDS_PASS'), help='ICANN Password')
@@ -75,4 +75,8 @@ if __name__ == '__main__':
     username = args.username or input('ICANN Username: ')
     password = args.password or getpass.getpass('ICANN Password: ')
     
-    main(username, password, args.concurrency) 
-\ No newline at end of file
+    run_czds(username, password, args.concurrency)
+
+
+if __name__ == '__main__':
+    main() 
+\ No newline at end of file
diff --git a/czds_api.egg-info/PKG-INFO b/czds_api.egg-info/PKG-INFO
@@ -0,0 +1,90 @@
+Metadata-Version: 2.2
+Name: czds-api
+Version: 1.0.0
+Summary: ICANN API for the Centralized Zones Data Service
+Home-page: https://github.com/acidvegas/czds
+Author: acidvegas
+Author-email: acid.vegas@acid.vegas
+Project-URL: Bug Tracker, https://github.com/acidvegas/czds/issues
+Project-URL: Documentation, https://github.com/acidvegas/czds#readme
+Project-URL: Source Code, https://github.com/acidvegas/czds
+Classifier: Development Status :: 5 - Production/Stable
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: ISC License (ISCL)
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.6
+Classifier: Programming Language :: Python :: 3.7
+Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3.9
+Classifier: Programming Language :: Python :: 3.10
+Classifier: Programming Language :: Python :: 3.11
+Classifier: Topic :: Internet
+Classifier: Topic :: Security
+Classifier: Topic :: Software Development :: Libraries :: Python Modules
+Requires-Python: >=3.6
+Description-Content-Type: text/markdown
+License-File: LICENSE
+Dynamic: author
+Dynamic: author-email
+Dynamic: classifier
+Dynamic: description
+Dynamic: description-content-type
+Dynamic: home-page
+Dynamic: project-url
+Dynamic: requires-python
+Dynamic: summary
+
+# ICANN Centralized Zone Data Service API
+
+The [ICANN Centralized Zone Data Service](https://czds.icann.org) *(CZDS)* allows *approved* users to request and download DNS zone files in bulk, provided they represent a legitimate company or academic institution and their intended use is legal and ethical. Once ICANN approves the request, this tool streamlines the retrieval of extensive domain name system data, facilitating research and security analysis in the realm of internet infrastructure.
+
+## Zone Information
+Zone files are updated once every 24 hours, specifically from 00:00 UTC to 06:00 UTC. Access to these zones is granted in increments, and the total time for approval across all zones may extend to a month or longer. It is typical for more than 90% of requested zones to receive approval. Access to certain zone files may require additional application forms with the TLD organization. Please be aware that access to certain zones is time-bound, expiring at the beginning of the following year, or up to a decade after the initial approval has been confirmed.
+
+At the time of writing this repository, the CZDS offers access to 1,151 zones in total.
+
+1,079 have been approved, 55 are still pending *(after 3 months)*, 10 have been revoked because the TLDs are longer active, and 6 have been denied. Zones that have expired automatically had the expiration extended for me without doing anything, aside from 13 zones that remained expired. I have included a recent [stats file](./extras/stats.csv) directly from my ICANN account.
+
+## Installation
+```bash
+pip install czds-api
+```
+
+## Usage
+###### Command line
+```bash
+czds [--username <username> --password <password>] [--concurrency <int>]
+```
+
+You can also set the `CZDS_USER` & `CZDS_PASS` environment variables to automatically authenticate:
+
+```bash
+export CZDS_USER='your_username'
+export CZDS_PASS='your_password'
+```
+
+###### As a Python module
+```python
+import os
+
+from czds import CZDS
+
+CZDS_client = CZDS(username, password)
+
+CZDS_client.download_report('report.csv')
+
+zone_links = CZDS_client.fetch_zone_links()
+
+os.makedirs('zones', exist_ok=True)
+
+for zone_link in zone_links:
+    CZDS_client.download_zone(zone_link, 'zones')
+```
+
+## Respects & extras
+While ICANN does have an official [czds-api-client-python](https://github.com/icann/czds-api-client-python) repository, I rewrote it from scratch to be more streamline & included a [POSIX version](./extras/czds) for portability. There is some [official documentation](https://raw.githubusercontent.com/icann/czds-api-client-java/master/docs/ICANN_CZDS_api.pdf) that was referenced in the creation of the POSIX version. Either way, big props to ICANN for allowing me to use the CZDS for research purposes!
+
+___
+
+###### Mirrors for this repository: [acid.vegas](https://git.acid.vegas/czds) • [SuperNETs](https://git.supernets.org/acidvegas/czds) • [GitHub](https://github.com/acidvegas/czds) • [GitLab](https://gitlab.com/acidvegas/czds) • [Codeberg](https://codeberg.org/acidvegas/czds)
diff --git a/czds_api.egg-info/SOURCES.txt b/czds_api.egg-info/SOURCES.txt
@@ -0,0 +1,11 @@
+LICENSE
+README.md
+setup.py
+czds/__init__.py
+czds/__main__.py
+czds/client.py
+czds_api.egg-info/PKG-INFO
+czds_api.egg-info/SOURCES.txt
+czds_api.egg-info/dependency_links.txt
+czds_api.egg-info/entry_points.txt
+czds_api.egg-info/top_level.txt
+\ No newline at end of file
diff --git a/czds_api.egg-info/dependency_links.txt b/czds_api.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/czds_api.egg-info/entry_points.txt b/czds_api.egg-info/entry_points.txt
@@ -0,0 +1,2 @@
+[console_scripts]
+czds = czds.__main__:main
diff --git a/czds_api.egg-info/top_level.txt b/czds_api.egg-info/top_level.txt
@@ -0,0 +1 @@
+czds
diff --git a/dist/czds_api-1.0.0-py3-none-any.whl b/dist/czds_api-1.0.0-py3-none-any.whl
Binary files differ.
diff --git a/dist/czds_api-1.0.0.tar.gz b/dist/czds_api-1.0.0.tar.gz
Binary files differ.
diff --git a/setup.py b/setup.py
@@ -11,7 +11,7 @@ with open('README.md', 'r', encoding='utf-8') as fh:
 
 setup(
 	name='czds-api',
-	version='1.0.0',
+	version='1.0.1',
 	author='acidvegas',
 	author_email='acid.vegas@acid.vegas',
 	description='ICANN API for the Centralized Zones Data Service',