Skip to main content

An easy-to-use and lightweight API wrapper for Censys APIs (censys.io).

Project description

Censys Python Library

PyPI Python Version Read the Docs (version) GitHub Discussions PRs Welcome License

An easy-to-use and lightweight API wrapper for Censys APIs (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 for resources.

[!IMPORTANT] This library does not support the new Censys Platform, however a new set of SDKs that do support the platform are coming soon. Please refer to the platform API refrence docs in the mean time.

Features

Getting Started

The library can be installed using pip.

pip install censys

To upgraded using pip.

pip install --upgrade censys

Alternatively, you can install the library using poetry.

git clone https://github.com/censys/censys-python.git
cd censys-python/
poetry install

Optionally, you can enable tab completion for the CLI by adding this line to your ~/.bashrc, ~/.zshrc, or equivalent.

Please note that autocomplete is supported for field names in the search command.

eval "$(register-python-argcomplete censys)"

To configure your search credentials run censys config or set both CENSYS_API_ID and CENSYS_API_SECRET environment variables.

$ censys config

Censys API ID: XXX
Censys API Secret: XXX
Do you want color output? [y/n]: y

Successfully authenticated for your@email.com

If you have a Censys ASM account, you can configure your ASM credentials by running censys asm config or set both CENSYS_ASM_API_KEY environment variables.

$ censys asm config

Censys ASM API Key: XXX
Do you want color output? [y/n]: y

Successfully authenticated

Examples

The examples located in the examples/ directory are a great place to start. You can also find more examples in the usage documentation.

Documentation

Read the Docs

Resources

Contributing

All contributions (no matter how small) are always welcome. See Contributing to Censys Python

Development

This project uses poetry for dependency management. Please ensure you have installed the latest version.

git clone git@github.com:censys/censys-python.git
cd censys-python/
poetry install

Testing

# Run tests
poetry run pytest
# With coverage report
poetry run pytest --cov-report html

License

This software is licensed under Apache License, Version 2.0

  • Copyright (C) 2024 Censys, Inc.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

censys-2.2.17.tar.gz (63.1 kB view details)

Uploaded Source

Built Distribution

censys-2.2.17-py3-none-any.whl (80.1 kB view details)

Uploaded Python 3

File details

Details for the file censys-2.2.17.tar.gz.

File metadata

  • Download URL: censys-2.2.17.tar.gz
  • Upload date:
  • Size: 63.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.12.3 Linux/6.8.0-1021-azure

File hashes

Hashes for censys-2.2.17.tar.gz
Algorithm Hash digest
SHA256 da07d8589fc98b8878eec5772d275d199dda89a3340ce69cd6ab2dc5567e887f
MD5 9be18b203d34e6d79816bf4f65185a5c
BLAKE2b-256 f3db89a2a0709deeca690bee2bc77cb330c87f8bd2c41b7d8dfa2e5880048da6

See more details on using hashes here.

File details

Details for the file censys-2.2.17-py3-none-any.whl.

File metadata

  • Download URL: censys-2.2.17-py3-none-any.whl
  • Upload date:
  • Size: 80.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.12.3 Linux/6.8.0-1021-azure

File hashes

Hashes for censys-2.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 545124521450cd5e87ffb3248d5942681a047a637563d54da96bdf6113ef9d1d
MD5 527987f022474e3a40138a589994b8dc
BLAKE2b-256 0ca68298350ade6adb4d1b83014140ae5af11de1b95e44289337ca1e240060fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page