From 19d5a1c551a696d96994f0ca9a137856dd6d233c Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Wed, 23 Jul 2025 11:29:15 -0400 Subject: [PATCH 1/2] chore: add deprecation warnings for search API --- README.md | 8 ++++++++ censys/search/v1/api.py | 11 +++++++++++ censys/search/v2/api.py | 11 +++++++++++ 3 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 19573077..f901430a 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,14 @@ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-organge.svg?logo=git&logoColor=organge)](http://makeapullrequest.com) [![License](https://img.shields.io/github/license/censys/censys-python?logo=apache)](https://github.com/censys/censys-python/blob/main/LICENSE) +> [!WARNING] +> **DEPRECATION NOTICE**: The Censys Search v1 and v2 APIs will be deprecated soon. Please migrate to the new **Censys Platform API**. +> +> - 📖 **New API Documentation**: [https://docs.censys.com/reference/get-started#/](https://docs.censys.com/reference/get-started#/) +> - 📦 **New Python SDK**: Install with `pip install censys-platform` - [https://pypi.org/project/censys-platform/](https://pypi.org/project/censys-platform/) +> +> The **Censys ASM APIs in this library are NOT deprecated** and will continue to be supported. + An easy-to-use and lightweight API wrapper for Censys APIs ([censys.io](https://censys.io/)). Python 3.8+ is currently supported. This library has been tested on Python 3.8 and 3.x (Currently version 3.10). > **Notice:** The Censys Search v1 endpoints are deprecated as of Nov. 30, 2021. Please begin using v2 endpoints to query hosts and certificates and check out our [support center](https://support.censys.io/hc/en-us/sections/360013076551-Censys-Search-2-0) for resources. diff --git a/censys/search/v1/api.py b/censys/search/v1/api.py index 5e433ed5..6bf7295d 100644 --- a/censys/search/v1/api.py +++ b/censys/search/v1/api.py @@ -1,6 +1,7 @@ """Base for interacting with the Censys Search API.""" import os +import warnings from typing import List, Optional, Type from requests.models import Response @@ -39,6 +40,16 @@ def __init__( Raises: CensysException: Base Exception Class for the Censys API. """ + warnings.warn( + "CensysSearchAPIv1 will be deprecated soon. " + "Please migrate to the new Censys Platform API. " + "Visit https://docs.censys.com/reference/get-started#/ for documentation " + "and install the new SDK with: pip install censys-platform " + "(https://pypi.org/project/censys-platform/)", + category=DeprecationWarning, + stacklevel=2, + ) + CensysAPIBase.__init__(self, kwargs.pop("url", self.DEFAULT_URL), **kwargs) # Gets config file diff --git a/censys/search/v2/api.py b/censys/search/v2/api.py index 1edc2ddb..7ffef32b 100644 --- a/censys/search/v2/api.py +++ b/censys/search/v2/api.py @@ -1,6 +1,7 @@ """Base for interacting with the Censys Search API.""" import os +import warnings from concurrent.futures import ThreadPoolExecutor, as_completed from typing import Any, Dict, Iterable, Iterator, List, Optional, Type, Union @@ -44,6 +45,16 @@ def __init__( Raises: CensysException: Base Exception Class for the Censys API. """ + warnings.warn( + "CensysSearchAPIv2 will be deprecated soon. " + "Please migrate to the new Censys Platform API. " + "Visit https://docs.censys.com/reference/get-started#/ for documentation " + "and install the new SDK with: pip install censys-platform " + "(https://pypi.org/project/censys-platform/)", + category=DeprecationWarning, + stacklevel=2, + ) + CensysAPIBase.__init__(self, kwargs.pop("url", self.DEFAULT_URL), **kwargs) # Gets config file From 483d9922bbc63e5e7cc451f0b1b6a67debe90124 Mon Sep 17 00:00:00 2001 From: Ben Schwartz Date: Wed, 23 Jul 2025 13:00:43 -0400 Subject: [PATCH 2/2] build: bump version from 2.2.17 to 2.2.18 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 2907666f..ace7257c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "censys" -version = "2.2.17" +version = "2.2.18" description = "An easy-to-use and lightweight API wrapper for Censys APIs (censys.io)." authors = ["Censys, Inc. "] license = "Apache-2.0"