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.11).

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.

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) 2023 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.4.tar.gz (57.3 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.4-py3-none-any.whl (73.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: censys-2.2.4.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-1041-azure

File hashes

Hashes for censys-2.2.4.tar.gz
Algorithm Hash digest
SHA256 2bcace81886b490b8e9b89e9269ee78ec7442631f5ac6e3fae8c94421a2b9d09
MD5 717218a5d13a6cab16336cbb4392a1cb
BLAKE2b-256 d22f1b7c7cb70c5e49d89a8d4545c1c5f3b42f68e470331512356d8a27f23041

See more details on using hashes here.

File details

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

File metadata

  • Download URL: censys-2.2.4-py3-none-any.whl
  • Upload date:
  • Size: 73.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-1041-azure

File hashes

Hashes for censys-2.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e8ae70185c9cc817956dd9b436ec1966ca797a6e59b9e29dbb5ac6dd3630c7d8
MD5 d36d93e4d8d0b896d727c0b9086cdcab
BLAKE2b-256 3f7640441b493dce0b202997ec5f57bdf6e4ed517a59edea46c98407db11e947

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