Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python: ["3.8", "3.10"]
python: ["3.9", "3.13"]
poetry: ["2.2.1"]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
Expand All @@ -37,20 +37,6 @@ jobs:
run: |
poetry install

#- name: Get all doc files that have changed
#id: changed_docs
#uses: tj-actions/changed-files@v41
#with:
#files: |
#docs

#- name: Build docs
#if: steps.changed_docs.outputs.any_changed == 'true' && startsWith(matrix.os, 'ubuntu') && startsWith(matrix.python, '3.10')
#working-directory: docs
#run: |
#poetry run pip install -r requirements.txt
#poetry run make html

- name: Lint with flake8
if: startsWith(matrix.os, 'ubuntu')
run: |
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Censys Python Library

[![PyPI](https://img.shields.io/pypi/v/censys?color=orange&logo=pypi&logoColor=orange)](https://pypi.org/project/censys/)
[![Python Version](https://img.shields.io/badge/python-3.8%2B-blue?logo=python)](https://www.python.org/downloads/)
[![Python Version](https://img.shields.io/badge/python-3.9%2B-blue?logo=python)](https://www.python.org/downloads/)
[![Read the Docs (version)](https://img.shields.io/readthedocs/censys-python/latest?logo=read%20the%20docs)](https://censys-python.readthedocs.io/en/stable/?badge=stable)
[![GitHub Discussions](https://img.shields.io/badge/GitHub-Discussions-brightgreen?logo=github)](https://github.com/censys/censys-python/discussions)
[![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**.
>
>
> - 📖 **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/)
> - 🖥️ **New CLI Tool** (`cencli`): [https://docs.censys.com/docs/platform-cli](https://docs.censys.com/docs/platform-cli)
> - ⚠️ **If you plan to use the new CLI, you will need to uninstall this package's CLI first** as both use the `censys` command name
>
>
> 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).
An easy-to-use and lightweight API wrapper for Censys APIs ([censys.io](https://censys.io/)). Python 3.9+ is currently supported. This library has been tested on Python 3.9 and 3.x (Currently version 3.13).

## Features

Expand Down
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ sphinx==7.2.6
sphinxcontrib-autoprogram==0.1.9
sphinx-rtd-theme==3.0.2
sphinx-prompt==1.8.0
sphinx-tabs==3.4.1
sphinx-tabs==3.5.0
sphinx-copybutton==0.5.2
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: PyPy",
]

Expand All @@ -50,7 +51,7 @@ classifiers = [
censys = "censys.cli:main"

[tool.poetry.dependencies]
python = ">=3.8,<4.0"
python = ">=3.9,<4.0"
requests = ">=2.29.0"
urllib3 = "<3.0.0"
backoff = ">=2.0.0,<3.0.0"
Expand Down Expand Up @@ -83,7 +84,7 @@ mypy = "^1.5.1"
types-requests = "^2.29.0.0"

[tool.black]
target-version = ["py38"]
target-version = ["py39"]

[tool.isort]
profile = "black"
Expand All @@ -95,7 +96,7 @@ sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
extend_skip = ["setup.py", "conf.py"]

[tool.mypy]
python_version = "3.8"
python_version = "3.9"
files = ["censys"]
namespace_packages = true
explicit_package_bases = true
Expand Down
10 changes: 6 additions & 4 deletions tests/cli/test_account.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ def test_table(self):

temp_stdout = StringIO()
# Actual call
with contextlib.redirect_stdout(temp_stdout), pytest.raises(
SystemExit, match="0"
with (
contextlib.redirect_stdout(temp_stdout),
pytest.raises(SystemExit, match="0"),
):
cli_main()

Expand Down Expand Up @@ -61,8 +62,9 @@ def test_json(self):

temp_stdout = StringIO()
# Actual call
with contextlib.redirect_stdout(temp_stdout), pytest.raises(
SystemExit, match="0"
with (
contextlib.redirect_stdout(temp_stdout),
pytest.raises(SystemExit, match="0"),
):
cli_main()

Expand Down
50 changes: 30 additions & 20 deletions tests/cli/test_asm.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,9 @@ def test_add_seeds_bad_json(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -559,8 +560,9 @@ def test_add_seeds_none(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -1132,8 +1134,9 @@ def test_delete_seeds_no_id_or_ip(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="0"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="0"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2018,8 +2021,9 @@ def test_execute_saved_query_by_name_not_found(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2069,8 +2073,9 @@ def test_execute_saved_query_by_name_failed(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2107,8 +2112,9 @@ def test_execute_saved_query_by_name_invalid_page_size(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2176,8 +2182,9 @@ def test_execute_saved_query_by_id_not_found(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2218,8 +2225,9 @@ def test_execute_saved_query_by_id_failed(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2247,8 +2255,9 @@ def test_execute_saved_query_by_id_invalid_page_size(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down Expand Up @@ -2326,8 +2335,9 @@ def test_search_failed(self):

# Actual call
temp_stdout = StringIO()
with pytest.raises(SystemExit, match="1"), contextlib.redirect_stdout(
temp_stdout
with (
pytest.raises(SystemExit, match="1"),
contextlib.redirect_stdout(temp_stdout),
):
cli_main()

Expand Down
Loading