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

[!WARNING] DEPRECATION NOTICE: The Censys Search v1 and v2 APIs will be deprecated soon. Please migrate to the new 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). Python 3.8+ is currently supported. This library has been tested on Python 3.8 and 3.x (Currently version 3.10).

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.19.tar.gz (62.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

censys-2.2.19-py3-none-any.whl (80.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: censys-2.2.19.tar.gz
  • Upload date:
  • Size: 62.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for censys-2.2.19.tar.gz
Algorithm Hash digest
SHA256 9202e17c2583d4b3d0af32a5be161ddb505edd390a9ca909f2e7470d4af19a97
MD5 ae17688ccd9d1b651f111a7add6881b3
BLAKE2b-256 41aaed0d0faf4f7015bac902cdad929f487f9baefd224ab6fa9aba5635dd5d60

See more details on using hashes here.

File details

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

File metadata

  • Download URL: censys-2.2.19-py3-none-any.whl
  • Upload date:
  • Size: 80.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.11.0-1018-azure

File hashes

Hashes for censys-2.2.19-py3-none-any.whl
Algorithm Hash digest
SHA256 eaad49779a3bbe290e244222563a48e78ca33777fbbdf6d329d8b52223fc1084
MD5 95ca9818e1a146e2bfa633bec1438882
BLAKE2b-256 664b96c1ebc5f8534c18527c81b4df9cdb2a96151010f540ecbb4c9c2af4fee4

See more details on using hashes here.

Supported by

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